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