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