Name:               jctools
Version:            2.0.2
Release:            5
Summary:            Java Concurrency Tools for the JVM
License:            ASL 2.0
BuildArch:          noarch
URL:                http://jctools.github.io/JCTools/
Source0:            https://github.com/JCTools/JCTools/archive/v2.0.2/jctools-2.0.2.tar.gz
BuildRequires:      maven-local mvn(junit:junit) mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:      mvn(org.hamcrest:hamcrest-all) mvn(org.ow2.asm:asm-all)
Provides:           jctools-experimental = %{version}-%{release} jctools-parent = %{version}-%{release}
Obsoletes:          jctools-experimental < %{version}-%{release} jctools-parent < %{version}-%{release}

%description
Java Concurrency Tools for the JVM. This project aims to offer some concurrent data structures currently missing from the JDK:
SPSC/MPSC/SPMC/MPMC variations for concurrent queues:
SPSC - Single Producer Single Consumer (Wait Free, bounded and unbounded)
MPSC - Multi Producer Single Consumer (Lock less, bounded and unbounded)
SPMC - Single Producer Multi Consumer (Lock less, bounded)
MPMC - Multi Producer Multi Consumer (Lock less, bounded)

%package            help
Summary:            Help documents for jctools
Provides:           jctools-javadoc = %{version}-%{release}
Obsoletes:          jctools-javadoc < %{version}-%{release}

%description        help
The jctools-help package conatins javadoc for jctools.

%prep
%autosetup -n JCTools-2.0.2 -p1

for filename in *.class *.jar;do
    find . -name ${filename} -delete
done

%pom_xpath_set pom:project/pom:version 2.0.2
%pom_xpath_set -r pom:parent/pom:version 2.0.2 jctools-core jctools-experimental
%pom_remove_plugin :maven-enforcer-plugin

for pom_disable_module in jctools-benchmarks jctools-concurrency-test;do
    %pom_disable_module ${pom_disable_module}
done

%pom_remove_dep "com.google.guava:guava-testlib" jctools-experimental

for pom_remove_plugin in cobertura-maven-plugin maven-source-plugin;do
    %pom_remove_plugin :${pom_remove_plugin} jctools-core
done

%pom_xpath_remove "pom:plugin[pom:artifactId = 'maven-javadoc-plugin']/pom:executions" jctools-core

for mod in core experimental; do
 %pom_xpath_set "pom:project/pom:packaging" bundle jctools-${mod}
 %pom_add_plugin org.apache.felix:maven-bundle-plugin:2.3.7 jctools-${mod} '
 <extensions>true</extensions>
 <executions>
   <execution>
     <id>bundle-manifest</id>
     <phase>process-classes</phase>
     <goals>
       <goal>manifest</goal>
     </goals>
   </execution>
 </executions>
 <configuration>
  <excludeDependencies>true</excludeDependencies>
 </configuration>'
done

%build
%mvn_build -s -f

%install
%mvn_install

%files -f .mfiles-jctools-core -f .mfiles-jctools-experimental -f .mfiles-jctools-parent
%doc README.md
%license LICENSE

%files help -f .mfiles-javadoc
%doc README.md

%changelog
* Mon Dec 23 2019 liujing<liujing144@huawei.com> - 2.0.2-5
- Package init
