122 lines
5.0 KiB
RPMSpec
122 lines
5.0 KiB
RPMSpec
#Global macro or variable
|
|
%global junit_url https://repo1.maven.org/maven2/org/junit
|
|
%global platform junit-platform
|
|
%global platform_version 1.3.1
|
|
%global jupiter junit-jupiter
|
|
%global vintage junit-vintage
|
|
|
|
#Basic Information
|
|
Name: junit5
|
|
Version: 5.3.1
|
|
Release: 3
|
|
Summary: Java regression testing framework
|
|
License: EPL-2.0 and ASL 2.0
|
|
URL: http://junit.org/junit5/
|
|
Source0: https://github.com/junit-team/junit5/archive/r%{version}.tar.gz
|
|
Source100: aggregator.pom
|
|
Source200: %{junit_url}/platform/%{platform}-commons/%{platform_version}/%{platform}-commons-%{platform_version}.pom
|
|
Source201: %{junit_url}/platform/%{platform}-console/%{platform_version}/%{platform}-console-%{platform_version}.pom
|
|
Source202: %{junit_url}/platform/%{platform}-console-standalone/%{platform_version}/%{platform}-console-standalone-%{platform_version}.pom
|
|
Source203: %{junit_url}/platform/%{platform}-engine/%{platform_version}/%{platform}-engine-%{platform_version}.pom
|
|
Source205: %{junit_url}/platform/%{platform}-launcher/%{platform_version}/%{platform}-launcher-%{platform_version}.pom
|
|
Source206: %{junit_url}/platform/%{platform}-runner/%{platform_version}/%{platform}-runner-%{platform_version}.pom
|
|
Source207: %{junit_url}/platform/%{platform}-suite-api/%{platform_version}/%{platform}-suite-api-%{platform_version}.pom
|
|
Source208: %{junit_url}/platform/%{platform}-surefire-provider/%{platform_version}/%{platform}-surefire-provider-%{platform_version}.pom
|
|
Source301: %{junit_url}/jupiter/%{jupiter}-api/%{version}/%{jupiter}-api-%{version}.pom
|
|
Source302: %{junit_url}/jupiter/%{jupiter}-engine/%{version}/%{jupiter}-engine-%{version}.pom
|
|
Source303: %{junit_url}/jupiter/%{jupiter}-migrationsupport/%{version}/%{jupiter}-migrationsupport-%{version}.pom
|
|
Source304: %{junit_url}/jupiter/%{jupiter}-params/%{version}/%{jupiter}-params-%{version}.pom
|
|
Source400: %{junit_url}/vintage/%{vintage}-engine/%{version}/%{vintage}-engine-%{version}.pom
|
|
BuildArch: noarch
|
|
|
|
#Dependency
|
|
BuildRequires: maven-local
|
|
BuildRequires: mvn(com.univocity:univocity-parsers)
|
|
BuildRequires: mvn(junit:junit)
|
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
|
BuildRequires: mvn(org.apache.maven.surefire:common-java5)
|
|
BuildRequires: mvn(org.apache.maven.surefire:surefire-api)
|
|
BuildRequires: mvn(org.apiguardian:apiguardian-api)
|
|
BuildRequires: mvn(org.opentest4j:opentest4j)
|
|
BuildRequires: asciidoc
|
|
|
|
|
|
%description
|
|
JUnit is a popular regression testing framework for Java platform.
|
|
|
|
%package javadoc
|
|
Summary: Javadoc for %{name}
|
|
|
|
%description javadoc
|
|
Junit5 API documentation.
|
|
|
|
%package_help
|
|
|
|
#Build sections
|
|
%prep
|
|
%setup -q -n %{name}-r%{version}
|
|
find -name \*.jar -delete
|
|
|
|
cp -p %{jupiter}-api/LICENSE.md LICENSE-Eclipse.md
|
|
cp -p %{platform}-surefire-provider/LICENSE.md LICENSE-Apache.md
|
|
|
|
cp -p %{SOURCE100} pom.xml
|
|
cp -p %{SOURCE200} %{platform}-commons/pom.xml
|
|
cp -p %{SOURCE201} %{platform}-console/pom.xml
|
|
cp -p %{SOURCE202} %{platform}-console-standalone/pom.xml
|
|
cp -p %{SOURCE203} %{platform}-engine/pom.xml
|
|
cp -p %{SOURCE205} %{platform}-launcher/pom.xml
|
|
cp -p %{SOURCE206} %{platform}-runner/pom.xml
|
|
cp -p %{SOURCE207} %{platform}-suite-api/pom.xml
|
|
cp -p %{SOURCE208} %{platform}-surefire-provider/pom.xml
|
|
cp -p %{SOURCE301} %{jupiter}-api/pom.xml
|
|
cp -p %{SOURCE302} %{jupiter}-engine/pom.xml
|
|
cp -p %{SOURCE303} %{jupiter}-migrationsupport/pom.xml
|
|
cp -p %{SOURCE304} %{jupiter}-params/pom.xml
|
|
cp -p %{SOURCE400} %{vintage}-engine/pom.xml
|
|
|
|
for pom in $(find -mindepth 2 -name pom.xml); do
|
|
# Set parent to aggregator
|
|
%pom_xpath_inject pom:project "<parent><groupId>org.openeuler.xmvn.junit5</groupId><artifactId>aggregator</artifactId><version>1.0.0</version></parent>" $pom
|
|
# OSGi BSN
|
|
bsn=$(sed 's|/pom.xml$||;s|.*/|org.|;s|-|.|g' <<<"$pom")
|
|
%pom_xpath_inject pom:project "<properties><osgi.bsn>${bsn}</osgi.bsn></properties>" $pom
|
|
# Incorrect scope - API guardian is just annotation, needed only during compilation
|
|
%pom_xpath_set -f "pom:dependency[pom:artifactId='apiguardian-api']/pom:scope" provided $pom
|
|
done
|
|
|
|
%pom_add_dep net.sf.jopt-simple:jopt-simple:5.0.4 %{platform}-console
|
|
%pom_add_dep com.univocity:univocity-parsers:2.5.4 %{jupiter}-params
|
|
|
|
%pom_xpath_set "pom:dependency[pom:groupId='org.apache.maven.surefire']/pom:scope" provided %{platform}-surefire-provider
|
|
|
|
%pom_xpath_set "pom:dependency[pom:artifactId='junit']/pom:scope" compile %{vintage}-engine
|
|
|
|
%pom_disable_module %{platform}-console
|
|
%pom_disable_module %{platform}-console-standalone
|
|
|
|
%mvn_package :aggregator __noinstall
|
|
|
|
%build
|
|
%mvn_build -f
|
|
|
|
asciidoc documentation/src/docs/asciidoc/index.adoc || :
|
|
ln -s ../../javadoc/junit5 documentation/src/docs/api
|
|
|
|
%install
|
|
%mvn_install
|
|
|
|
#Files list
|
|
%files -f .mfiles
|
|
%license LICENSE.md LICENSE-Eclipse.md LICENSE-Apache.md
|
|
|
|
%files javadoc -f .mfiles-javadoc
|
|
%license LICENSE.md LICENSE-Eclipse.md LICENSE-Apache.md
|
|
|
|
%files help
|
|
%doc documentation/src/docs/*
|
|
|
|
%changelog
|
|
* Thu Feb 27 2020 Jiangping Hu <hujp1985@foxmail.com> - 5.3.1-3
|
|
- Package init
|