Allow conditional builds without Ant tasks

This commit is contained in:
Mikolaj Izdebski 2016-10-10 17:46:31 +02:00
parent 5df2a65c7c
commit 6a91b1f429

View File

@ -1,10 +1,11 @@
%if 0%{?fedora}
%bcond_without ant_tasks
%bcond_without maven_plugin
%endif
Name: aqute-bnd
Version: 3.3.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: BND Tool
License: ASL 2.0
URL: http://bnd.bndtools.org/
@ -26,12 +27,14 @@ Patch0: 0001-Port-to-Java-8.patch
Patch1: 0002-Disable-removed-commands.patch
BuildRequires: maven-local
BuildRequires: mvn(ant:ant)
BuildRequires: mvn(org.osgi:osgi.annotation)
BuildRequires: mvn(org.osgi:osgi.cmpn)
BuildRequires: mvn(org.osgi:osgi.core)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-simple)
%if %{with ant_tasks}
BuildRequires: mvn(ant:ant)
%endif
%if %{with maven_plugin}
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.maven:maven-artifact)
@ -92,6 +95,10 @@ rm biz.aQute.bnd/src/aQute/bnd/main/{RemoteCommand,ResolveCommand}.java
sed 's/@VERSION@/%{version}/' %SOURCE2 > pom.xml
sed -i 's|${Bundle-Version}|%{version}|' biz.aQute.bndlib/src/aQute/bnd/osgi/bnd.info
%if %{without ant_tasks}
rm -rf biz.aQute.bnd/src/aQute/bnd/ant
%endif
%if %{without maven_plugin}
%pom_disable_module maven
%endif
@ -131,7 +138,9 @@ cp -p %{SOURCE4} pom.xml
%pom_add_dep biz.aQute.bnd:biz.aQute.bndlib:%{version}
%pom_add_dep biz.aQute.bnd:aQute.libg:%{version}
%pom_add_dep biz.aQute.bnd:biz.aQute.bnd.annotation:%{version}
%if %{with ant_tasks}
%pom_add_dep ant:ant
%endif
%pom_add_dep org.osgi:osgi.annotation
%pom_add_dep org.osgi:osgi.core
%pom_add_dep org.osgi:osgi.cmpn
@ -188,6 +197,9 @@ echo "aqute-bnd slf4j/api slf4j/simple osgi-annotation osgi-core osgi-compendium
%license LICENSE
%changelog
* Mon Oct 10 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.0-4
- Allow conditional builds without Ant tasks
* Mon Oct 10 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.0-3
- Allow conditional builds without Maven plugin