Expand conditionals

This commit is contained in:
Mikolaj Izdebski 2018-11-29 12:42:46 +00:00
parent 7a38eb6d86
commit 662adb73b8

View File

@ -1,5 +1,3 @@
%bcond_without junit5
%bcond_without osgi
Name: objectweb-asm
Version: 6.2
@ -29,20 +27,11 @@ BuildRequires: maven-local
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin)
BuildRequires: mvn(org.ow2:ow2:pom:)
%if %{with junit5}
BuildRequires: mvn(org.codehaus.janino:janino)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-params)
BuildRequires: mvn(org.junit.platform:junit-platform-surefire-provider)
%endif
%if %{with osgi}
# asm-all needs to be in pluginpath for BND. If this self-dependency
# becomes a problem then ASM core will have to be build from source
# with javac before main maven build, just like bnd-module-plugin
BuildRequires: objectweb-asm >= 6
%endif
# Explicit javapackages-tools requires since asm-processor script uses
# /usr/share/java-utils/java-functions
@ -67,26 +56,12 @@ This package provides %{summary}.
# A custom parent pom to aggregate the build
cp -p %{SOURCE1} pom.xml
%if %{without junit5}
%pom_disable_module asm-test
%endif
# Insert poms into modules
for pom in asm asm-analysis asm-commons asm-test asm-tree asm-util asm-xml; do
cp -p $RPM_SOURCE_DIR/${pom}-%{version}.pom $pom/pom.xml
# Fix junit5 configuration
%if %{with junit5}
%pom_add_dep org.junit.jupiter:junit-jupiter-engine:5.1.0:test $pom
%pom_add_plugin org.apache.maven.plugins:maven-surefire-plugin:2.21.0 $pom \
" <dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0-RC1</version>
</dependency>
</dependencies>"
%endif
%if %{with osgi}
if [ "$pom" != "asm-test" ] ; then
# Make into OSGi bundles
bsn="org.objectweb.${pom//-/.}"
@ -103,7 +78,6 @@ for pom in asm asm-analysis asm-commons asm-test asm-tree asm-util asm-xml; do
</instructions>
</configuration>"
fi
%endif
done
# Insert asm-all pom
@ -128,11 +102,7 @@ javac -sourcepath ../../asm/src/main/java/ -cp $(build-classpath aqute-bnd) $(fi
jar cf bnd-module-plugin.jar -C src/main/java org
popd
%if %{with junit5}
%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%else
%mvn_build -f -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%endif
%install
%mvn_install