Conditionally build BND Maven plugin

This commit is contained in:
Mikolaj Izdebski 2021-08-19 11:15:01 +02:00
parent c12c8087bc
commit 9ef9460aa2

View File

@ -1,5 +1,11 @@
%bcond_with bootstrap
%if %{without bootstrap} && !0%{?rhel}
%bcond_without maven_plugin
%else
%bcond_with maven_plugin
%endif
Name: aqute-bnd
Version: 5.2.0
Release: 5%{?dist}
@ -28,6 +34,13 @@ BuildRequires: maven-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
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)
%endif
%if %{with maven_plugin}
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
@ -37,11 +50,6 @@ BuildRequires: mvn(org.apache.maven:maven-compat)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.eclipse.aether:aether-api)
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)
BuildRequires: mvn(org.sonatype.plexus:plexus-build-api)
%endif
@ -68,11 +76,13 @@ Summary: BND library
%description -n aqute-bndlib
%{summary}.
%if %{with maven_plugin}
%package -n bnd-maven-plugin
Summary: BND Maven plugin
%description -n bnd-maven-plugin
%{summary}.
%endif
%package javadoc
Summary: Javadoc for %{name}
@ -92,6 +102,10 @@ rm biz.aQute.bnd/src/aQute/bnd/main/{ExportReportCommand,MbrCommand,RemoteComman
sed 's/@VERSION@/%{version}/' %SOURCE2 > pom.xml
sed -i 's|${Bundle-Version}|%{version}|' biz.aQute.bndlib/src/aQute/bnd/osgi/bnd.info
%if %{without maven_plugin}
%pom_disable_module maven
%endif
# libg
pushd aQute.libg
cp -p %{SOURCE3} pom.xml
@ -169,10 +183,12 @@ popd
%mvn_package biz.aQute.bnd:biz.aQute.bndlib bndlib
%mvn_package biz.aQute.bnd:biz.aQute.bnd.annotation bndlib
%mvn_package biz.aQute.bnd:aQute.libg bndlib
%mvn_package biz.aQute.bnd:bnd-maven-plugin maven
%mvn_package biz.aQute.bnd:bnd-baseline-maven-plugin maven
%mvn_package biz.aQute.bnd:parent __noinstall
%mvn_package biz.aQute.bnd:bnd-plugin-parent __noinstall
%if %{with maven_plugin}
%mvn_package biz.aQute.bnd:bnd-maven-plugin maven
%mvn_package biz.aQute.bnd:bnd-baseline-maven-plugin maven
%endif
%build
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
@ -193,7 +209,9 @@ echo "aqute-bnd slf4j/api slf4j/simple osgi-annotation osgi-core osgi-compendium
%files -n aqute-bndlib -f .mfiles-bndlib
%license LICENSE
%if %{with maven_plugin}
%files -n bnd-maven-plugin -f .mfiles-maven
%endif
%files javadoc -f .mfiles-javadoc
%license LICENSE