Name: reactive-streams
Version: 1.0.3
Release: 1%{?dist}
Summary: Reactive Streams Specification for the JVM
License: CC0
URL: https://github.com/reactive-streams/reactive-streams-jvm
BuildArch: noarch
Source0: %{url}/archive/v%{version}.tar.gz
Source1: https://repo1.maven.org/maven2/org/reactivestreams/%{name}/%{version}/%{name}-%{version}.pom
Source2: https://repo1.maven.org/maven2/org/reactivestreams/%{name}-tck/%{version}/%{name}-tck-%{version}.pom
Source3: https://repo1.maven.org/maven2/org/reactivestreams/%{name}-tck-flow/%{version}/%{name}-tck-flow-%{version}.pom
Source4: https://repo1.maven.org/maven2/org/reactivestreams/%{name}-examples/%{version}/%{name}-examples-%{version}.pom
# https://github.com/reactive-streams/reactive-streams-jvm/commit/4db62a514ff2f93781a9e06521cc9f80eeb9f9f2
# removed:
# - gradle/wrapper/gradle-wrapper.jar
Patch0: 4db62a514ff2f93781a9e06521cc9f80eeb9f9f2.patch
BuildRequires: maven-local
BuildRequires: mvn(biz.aQute.bnd:bnd-maven-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.testng:testng)
%description
The purpose of Reactive Streams is to provide a standard for asynchronous
stream processing with non-blocking backpressure.
%package -n %{name}-tck
Summary: Reactive Streams TCK
%description -n %{name}-tck
The purpose of the Reactive Streams Technology Compatibility Kit (from here on
referred to as: the TCK) is to guide and help Reactive Streams library
implementers to validate their implementations against the rules defined in the
Specification.
The TCK is implemented using plain Java (1.6) and TestNG tests, and should be
possible to use from other JVM-based languages and testing libraries.
%package -n %{name}-tck-flow
Summary: Reactive Streams TCK Flow
%description -n %{name}-tck-flow
The purpose of the Reactive Streams Technology Compatibility Kit (from here on
referred to as: the TCK) is to guide and help Reactive Streams library
implementers to validate their implementations against the rules defined in the
Specification.
Since this version of the TCK is intended to verify the interfaces contained in
Java 9 (under java.util.concurrent.Flow.*), at least Java 9 is required to run
this TCK.
%package -n %{name}-examples
Summary: Reactive Streams Examples
%description -n %{name}-examples
Reactive Streams Examples
%javadoc_package
%prep
%autosetup -p1 -n %{name}-jvm-%{version}
# Note:
# reactive-streams is a gradle project, we need to transform it to maven.
# remove jar and class files
find -type f \( -name \*.jar -o -name \*.class \) -delete
# copy reactive-streams pom file to api/ folder
cp %{SOURCE1} api/pom.xml
# copy reactive-streams-tck pom file to tck/ folder
cp %{SOURCE2} tck/pom.xml
# copy reactive-streams-tck-flow pom file to tck-flow/ folder
cp %{SOURCE3} tck-flow/pom.xml
# copy reactive-streams-examples pom file to examples/ folder
cp %{SOURCE4} examples/pom.xml
# this is the parent pom
# use source1 since it is the simplest form
cp %{SOURCE1} pom.xml
# set name for parent pom
%pom_xpath_set pom:project/pom:name %{name}-parent .
# set artifact id for parent pom
%pom_xpath_set pom:project/pom:artifactId %{name}-parent .
# set description for parent pom
%pom_xpath_set pom:project/pom:description 'Parent POM' .
# set packaging for parent pom
%pom_xpath_inject pom:project 'pom' .
# set modules for parent pom
%pom_xpath_inject pom:project '
apitcktck-flowexamples' .
# module api: set name to reactive-streams
%pom_xpath_set pom:project/pom:name %{name} api
# module api: add more sources -> src/main/java9
%pom_add_plugin org.codehaus.mojo:build-helper-maven-plugin api '
generate-sourcesadd-source'
# module api: add manifest plugin
%pom_add_plugin biz.aQute.bnd:bnd-maven-plugin api '
bnd-process
Bundle-Name: reactive-streams-jvm
Bundle-Vendor: Reactive Streams SIG
Bundle-Description: Reactive Streams API
Bundle-DocURL: https://reactive-streams.org
Bundle-Version: %{version}
Export-Package: org.reactivestreams.*
Automatic-Module-Name: org.reactivestreams
'
# module tck: set name to reactive-streams-tck
%pom_xpath_set pom:project/pom:name %{name}-tck tck
# module tck: add manifest plugin
%pom_add_plugin biz.aQute.bnd:bnd-maven-plugin tck '
bnd-process
Bundle-Name: reactive-streams-jvm
Bundle-Vendor: Reactive Streams SIG
Bundle-Description: Reactive Streams TCK
Bundle-DocURL: https://reactive-streams.org
Bundle-Version: %{version}
Export-Package: org.reactivestreams.tck.*
Automatic-Module-Name: org.reactivestreams.tck
'
# module tck-flow: set name to reactive-streams-tck-flow
%pom_xpath_set pom:project/pom:name %{name}-tck-flow tck-flow
# module tck-flow: add manifest plugin
%pom_add_plugin biz.aQute.bnd:bnd-maven-plugin tck-flow '
bnd-process
Bundle-Name: reactive-streams-jvm
Bundle-Vendor: Reactive Streams SIG
Bundle-Description: Reactive Streams TCK Flow
Bundle-DocURL: https://reactive-streams.org
Bundle-Version: %{version}
Export-Package: org.reactivestreams.tck.flow.*
Automatic-Module-Name: org.reactivestreams.tckflow
'
# module examples: set name to reactive-streams-examples
%pom_xpath_set pom:project/pom:name %{name}-examples examples
# module examples: add manifest plugin
%pom_add_plugin biz.aQute.bnd:bnd-maven-plugin examples '
bnd-process
Bundle-Name: reactive-streams-jvm
Bundle-Vendor: Reactive Streams SIG
Bundle-Description: Reactive Streams Examples
Bundle-DocURL: https://reactive-streams.org
Bundle-Version: %{version}
Export-Package: org.reactivestreams.example.*
Automatic-Module-Name: org.reactivestreams.examples
'
# module examples: remove test (reason: cyclic reference)
rm -rf examples/src/test/*
# module examples: remove test dependency (reason: cyclic reference)
%pom_remove_dep :reactive-streams-tck examples
# all modules: set up jar plugin
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin api tck tck-flow examples '
${project.build.outputDirectory}/META-INF/MANIFEST.MF'
# all modules: set up compiler plugin
%pom_add_plugin :maven-compiler-plugin api tck tck-flow examples '
UTF-8-Xlint:deprecation,unchecked'
# don't install parent pom
%mvn_package :%{name}-parent __noinstall
%build
%mvn_build -s -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%install
%mvn_install
%files -n %{name} -f .mfiles-%{name}
%license LICENSE COPYING
%doc README.md RELEASE-NOTES.md
%files -n %{name}-tck -f .mfiles-%{name}-tck
%license LICENSE COPYING
%doc README.md RELEASE-NOTES.md
%files -n %{name}-examples -f .mfiles-%{name}-examples
%license LICENSE COPYING
%doc README.md RELEASE-NOTES.md
%files -n %{name}-tck-flow -f .mfiles-%{name}-tck-flow
%license LICENSE COPYING
%doc README.md RELEASE-NOTES.md
%changelog
* Sun Sep 5 2021 Didik Supriadi - 1.0.3-1
- Initial package