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