Name:                jctools
Version:             2.1.2
Release:             1
Summary:             Java Concurrency Tools for the JVM
License:             Apache-2.0
URL:                 https://jctools.github.io/JCTools/
Source0:             https://github.com/JCTools/JCTools/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires:       fdupes maven-local mvn(com.github.javaparser:javaparser-core)
BuildRequires:       mvn(com.google.guava:guava-testlib) mvn(junit:junit)
BuildRequires:       mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:       mvn(org.codehaus.mojo:exec-maven-plugin) mvn(org.hamcrest:hamcrest-all)
BuildRequires:       mvn(org.ow2.asm:asm-util)
BuildArch:           noarch
%description
This project aims to offer some concurrent data structures
currently missing from the JDK:
° SPSC/MPSC/SPMC/MPMC Bounded lock free queues
° SPSC/MPSC Unbounded lock free queues
° Alternative interfaces for queues
° Offheap concurrent ring buffer for ITC/IPC purposes
° Single Writer Map/Set implementations
° Low contention stats counters
° Executor

%package channels
Summary:             JCTools Channel implementations
%description channels
Channel implementations for the
Java Concurrency Tools Library.

%package experimental
Summary:             JCTools Experimental implementations
%description experimental
Experimental implementations for the
Java Concurrency Tools Library.

%package javadoc
Summary:             Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.

%package parent
Summary:             JCTools Parent POM
%description parent
JCTools Parent POM.

%prep
%setup -q -n JCTools-%{version}
find . -name '*.class' -print -delete
find . -name '*.jar' -print -delete
rm jctools-core/src/test/java/org/jctools/queues/MpqSanityTestMpscCompound.java
rm jctools-core/src/test/java/org/jctools/queues/atomic/AtomicMpqSanityTestMpscCompound.java
%pom_xpath_set pom:project/pom:version %{version}
%pom_xpath_set -r pom:parent/pom:version %{version} %{name}-{build,core,channels,experimental}
%pom_remove_plugin :maven-enforcer-plugin
%pom_remove_plugin :coveralls-maven-plugin
%pom_remove_plugin :jacoco-maven-plugin
%pom_remove_plugin :maven-source-plugin %{name}-core
%pom_remove_plugin :maven-javadoc-plugin %{name}-core
%pom_disable_module %{name}-benchmarks
%pom_disable_module %{name}-concurrency-test
%pom_change_dep ":asm-all" ":asm-util" jctools-{channels,experimental}
for mod in core experimental; do
 %pom_xpath_set "pom:project/pom:packaging" bundle %{name}-${mod}
 %pom_add_plugin org.apache.felix:maven-bundle-plugin:2.3.7 %{name}-${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
%{mvn_package} :jctools-build __noinstall

%build
%{mvn_build} -s -f

%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}

%files -f .mfiles-%{name}-core
%doc README.md
%license LICENSE

%files channels -f .mfiles-%{name}-channels

%files experimental -f .mfiles-%{name}-experimental

%files javadoc -f .mfiles-javadoc
%license LICENSE

%files parent -f .mfiles-%{name}-parent
%license LICENSE

%changelog
* Sat Aug 1 2020 Jeffery.Gao <gaojianxing@huawei.com> - 2.1.2-1
- Package init
