57a928
# Component versions, taken from gradle.properties
57a928
%global platform_version 1.%(v=%{version}; echo ${v:2})
57a928
%global jupiter_version %{version}
57a928
%global vintage_version %{version}
57a928
57a928
Name:           junit5
57a928
Version:        5.5.2
57a928
Release:        3%{?dist}
57a928
Summary:        Java regression testing framework
57a928
License:        EPL-2.0
57a928
URL:            http://junit.org/junit5/
57a928
BuildArch:      noarch
57a928
57a928
Source0:        https://github.com/junit-team/junit5/archive/r%{version}/junit5-%{version}.tar.gz
57a928
57a928
# Aggregator POM (used for packaging only)
57a928
Source100:      aggregator.pom
57a928
# Platform POMs
57a928
Source200:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/%{platform_version}/junit-platform-commons-%{platform_version}.pom
57a928
Source201:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console/%{platform_version}/junit-platform-console-%{platform_version}.pom
57a928
Source202:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/%{platform_version}/junit-platform-console-standalone-%{platform_version}.pom
57a928
Source203:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/%{platform_version}/junit-platform-engine-%{platform_version}.pom
57a928
Source205:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/%{platform_version}/junit-platform-launcher-%{platform_version}.pom
57a928
Source206:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-runner/%{platform_version}/junit-platform-runner-%{platform_version}.pom
57a928
Source207:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-api/%{platform_version}/junit-platform-suite-api-%{platform_version}.pom
57a928
Source208:      https://repo1.maven.org/maven2/org/junit/platform/junit-platform-reporting/%{platform_version}/junit-platform-reporting-%{platform_version}.pom
57a928
# Jupiter POMs
57a928
Source300:      https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter/%{jupiter_version}/junit-jupiter-%{jupiter_version}.pom
57a928
Source301:      https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/%{jupiter_version}/junit-jupiter-api-%{jupiter_version}.pom
57a928
Source302:      https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/%{jupiter_version}/junit-jupiter-engine-%{jupiter_version}.pom
57a928
Source303:      https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-migrationsupport/%{jupiter_version}/junit-jupiter-migrationsupport-%{jupiter_version}.pom
57a928
Source304:      https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/%{jupiter_version}/junit-jupiter-params-%{jupiter_version}.pom
57a928
# Vintage POM
57a928
Source400:      https://repo1.maven.org/maven2/org/junit/vintage/junit-vintage-engine/%{vintage_version}/junit-vintage-engine-%{vintage_version}.pom
57a928
57a928
BuildRequires:  maven-local
57a928
BuildRequires:  mvn(com.univocity:univocity-parsers)
57a928
BuildRequires:  mvn(junit:junit)
57a928
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
57a928
BuildRequires:  mvn(org.apiguardian:apiguardian-api)
57a928
BuildRequires:  mvn(org.opentest4j:opentest4j)
57a928
57a928
BuildRequires:  asciidoc
57a928
57a928
%description
57a928
JUnit is a popular regression testing framework for Java platform.
57a928
57a928
%package javadoc
57a928
Summary:        Javadoc for %{name}
57a928
57a928
%description javadoc
57a928
Junit5 API documentation.
57a928
57a928
%package guide
57a928
Summary:        Documentation for %{name}
57a928
Requires:       %{name}-javadoc = %{version}-%{release}
57a928
57a928
%description guide
57a928
JUnit 5 User Guide.
57a928
57a928
%prep
57a928
%setup -q -n %{name}-r%{version}
57a928
find -name '*.jar' -delete
57a928
57a928
cp -p %{SOURCE100} pom.xml
57a928
cp -p %{SOURCE200} junit-platform-commons/pom.xml
57a928
cp -p %{SOURCE201} junit-platform-console/pom.xml
57a928
cp -p %{SOURCE202} junit-platform-console-standalone/pom.xml
57a928
cp -p %{SOURCE203} junit-platform-engine/pom.xml
57a928
cp -p %{SOURCE205} junit-platform-launcher/pom.xml
57a928
cp -p %{SOURCE206} junit-platform-runner/pom.xml
57a928
cp -p %{SOURCE207} junit-platform-suite-api/pom.xml
57a928
cp -p %{SOURCE208} junit-platform-reporting/pom.xml
57a928
cp -p %{SOURCE300} junit-jupiter/pom.xml
57a928
cp -p %{SOURCE301} junit-jupiter-api/pom.xml
57a928
cp -p %{SOURCE302} junit-jupiter-engine/pom.xml
57a928
cp -p %{SOURCE303} junit-jupiter-migrationsupport/pom.xml
57a928
cp -p %{SOURCE304} junit-jupiter-params/pom.xml
57a928
cp -p %{SOURCE400} junit-vintage-engine/pom.xml
57a928
57a928
for pom in $(find -mindepth 2 -name pom.xml); do
57a928
    # Set parent to aggregator
57a928
    %pom_xpath_inject pom:project "<parent><groupId>org.fedoraproject.xmvn.junit5</groupId><artifactId>aggregator</artifactId><version>1.0.0</version></parent>" $pom
57a928
    # OSGi BSN
57a928
    bsn=$(sed 's|/pom.xml$||;s|.*/|org.|;s|-|.|g' <<<"$pom")
57a928
    %pom_xpath_inject pom:project "<properties><osgi.bsn>${bsn}</osgi.bsn></properties>" $pom
57a928
    # Incorrect scope - API guardian is just annotation, needed only during compilation
57a928
    %pom_xpath_set -f "pom:dependency[pom:artifactId='apiguardian-api']/pom:scope" provided $pom
57a928
done
57a928
57a928
# Add deps which are shaded by upstream and therefore not present in POMs.
57a928
%pom_add_dep net.sf.jopt-simple:jopt-simple:5.0.4 junit-platform-console
57a928
%pom_add_dep com.univocity:univocity-parsers:2.5.4 junit-jupiter-params
57a928
57a928
# Incorrect scope - Junit4 is needed for compilation too, not only runtime.
57a928
%pom_xpath_set "pom:dependency[pom:artifactId='junit']/pom:scope" compile junit-vintage-engine
57a928
57a928
# Disable the console modules
57a928
%pom_disable_module junit-platform-console
57a928
%pom_disable_module junit-platform-console-standalone
57a928
57a928
%mvn_package :aggregator __noinstall
57a928
57a928
%build
57a928
%mvn_build -f
57a928
57a928
# Build docs.  Ignore exit asciidoc -- it fails for some reason, but
57a928
# still produces readable docs.
57a928
asciidoc documentation/src/docs/asciidoc/index.adoc || :
57a928
ln -s ../../javadoc/junit5 documentation/src/docs/api
57a928
57a928
%install
57a928
%mvn_install
57a928
57a928
%files -f .mfiles
57a928
%license LICENSE.md LICENSE-notice.md
57a928
57a928
%files javadoc -f .mfiles-javadoc
57a928
%license LICENSE.md LICENSE-notice.md
57a928
57a928
%files guide
57a928
%doc documentation/src/docs/*
57a928
57a928
%changelog
57a928
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.5.2-3
57a928
- Mass rebuild for javapackages-tools 201902
57a928
57a928
* Mon Oct 28 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.5.2-2
57a928
- Build and install junit-jupiter aggregator
57a928
57a928
* Wed Sep 11 2019 Marian Koncek <mkoncek@redhat.com> - 5.5.2-1
57a928
- Update to upstream version 5.5.2
57a928
57a928
* Mon Jul 22 2019 Marian Koncek <mkoncek@redhat.com> - 5.5.1-1
57a928
- Update to upstream version 5.5.1
57a928
57a928
* Sat Jun 08 2019 Fabio Valentini <decathorpe@gmail.com> - 5.4.2-1
57a928
- Update to version 5.4.2
57a928
57a928
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.4.0-2
57a928
- Mass rebuild for javapackages-tools 201901
57a928
57a928
* Wed Mar 06 2019 Mat Booth <mat.booth@redhat.com> - 5.4.0-1
57a928
- Update to latest upstream release
57a928
- License switched to EPL only now the surefire provider was moved to the
57a928
  Apache Surefire project
57a928
57a928
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.1-2
57a928
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
57a928
57a928
* Tue Sep 11 2018 Mat Booth <mat.booth@redhat.com> - 5.3.1-1
57a928
- Update to latest upstream release
57a928
- Conditionally build the console modules
57a928
- Remove stuff for discontinued gradle plugin
57a928
57a928
* Fri Aug 31 2018 Severin Gehwolf <sgehwolf@redhat.com> - 5.2.0-3
57a928
- Add explicit requirement on javapackages-tools since junit5 script
57a928
  uses java-functions. See RHBZ#1600426.
57a928
57a928
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.0-2
57a928
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
57a928
57a928
* Wed Jun 27 2018 Mat Booth <mat.booth@redhat.com> - 5.2.0-1
57a928
- Update to latest upstream release
57a928
57a928
* Wed Jun 27 2018 Mat Booth <mat.booth@redhat.com> - 5.0.0-4
57a928
- Add java 9 automatic module name headers to jar files
57a928
- License correction EPL -> EPL-2.0
57a928
57a928
* Thu Mar 15 2018 Michael Simacek <msimacek@redhat.com> - 5.0.0-3
57a928
- Disable gradle plugin to fix FTBFS
57a928
57a928
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-2
57a928
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
57a928
57a928
* Thu Sep 14 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 5.0.0-1
57a928
- Initial packaging