Name: aqute-bnd
Version: 3.5.0
Release: 10
Summary: BND Tool
License: ASL 2.0
URL: https://github.com/bndtools/bnd/
Source0: https://github.com/bndtools/bnd/archive/refs/tags/%{version}.REL.tar.gz
Source1: https://repo1.maven.org/maven2/biz/aQute/bnd/parent/2.4.0/parent-2.4.0.pom#/parent.pom
Source2: https://repo1.maven.org/maven2/biz/aQute/bnd/aQute.libg/%{version}/aQute.libg-%{version}.pom
Source3: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/%{version}/biz.aQute.bnd-%{version}.pom
Source4: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/%{version}/biz.aQute.bndlib-%{version}.pom
Source5: https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.annotation/%{version}/biz.aQute.bnd.annotation-%{version}.pom
Source6: add-maven-dependency-plugin.patch
Patch0001: 0001-Disable-removed-commands.patch
Patch0002: 0002-Fix-ant-compatibility.patch
Patch0003: 0003-Port-to-OSGI-7.0.0.patch
BuildRequires: maven-local mvn(org.osgi:osgi.annotation) mvn(org.osgi:osgi.cmpn) mvn(org.osgi:osgi.core)
BuildRequires: mvn(org.slf4j:slf4j-api) mvn(org.slf4j:slf4j-simple) mvn(org.apache.ant:ant) mvn(junit:junit)
BuildRequires: mvn(org.apache.maven:maven-artifact) mvn(org.apache.maven:maven-compat) mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-plugin-api) mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.eclipse.aether:aether-api) mvn(org.sonatype.plexus:plexus-build-api)
BuildRequires: java-1.8.0-openjdk-devel maven-local maven
BuildRequires: maven-dependency-plugin
Requires: java-1.8.0-openjdk
Requires: javapackages-tools
Provides: aqute-bndlib = %{version}-%{release} bnd-maven-plugin = %{version}-%{release}
Obsoletes: aqute-bndlib < %{version}-%{release} bnd-maven-plugin < %{version}-%{release}
BuildArch: noarch
%description
Bnd is the engine behind a number of popular software development tools that support OSGi.
It can be found in several maven plugins, ant, gradle, and of course Eclipse (bndtools).
It actively seeks other build tool vendors to use bnd to improve the quality of the generated
OSGi metadata.
%package help
Provides: aqute-bnd-javadoc = %{version}-%{release}
Obsoletes: aqute-bnd-javadoc < %{version}-%{release}
Summary: Documentation for aqute-bnd
%description help
Documentation for aqute-bnd api.
%prep
%autosetup -n bnd-%{version}.REL -p1
rm gradlew*
rm biz.aQute.bnd/src/aQute/bnd/main/{RemoteCommand,ResolveCommand}.java
cp %{SOURCE1} .
sed -i 's/2.4.0/@VERSION@/' parent.pom
sed -i '$d' parent.pom
echo "
aQute.libg
biz.aQute.bndlib
biz.aQute.bnd
biz.aQute.bnd.annotation
maven
src
src/
**/*.java
**/packageinfo
org.apache.maven.plugins
maven-compiler-plugin
3.5.1
1.7
1.7
" >> parent.pom
sed 's/@VERSION@/%{version}/' parent.pom > pom.xml
sed -i 's|${Bundle-Version}|%{version}|' biz.aQute.bndlib/src/aQute/bnd/osgi/bnd.info
cd aQute.libg
cp -p %{SOURCE2} pom.xml
cp -p %{SOURCE6} add-maven-dependency-plugin.patch
%pom_add_parent biz.aQute.bnd:parent:%{version}
%pom_add_dep org.osgi:osgi.cmpn:7.0.0
%pom_add_dep org.slf4j:slf4j-api:1.7.25
patch -p1 < add-maven-dependency-plugin.patch
cd -
cd biz.aQute.bnd.annotation
cp -p %{SOURCE5} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
cd -
cd biz.aQute.bndlib
cp -p %{SOURCE4} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
%pom_add_dep org.osgi:osgi.annotation
%pom_add_dep org.osgi:osgi.core
%pom_add_dep org.osgi:osgi.cmpn
%pom_add_dep org.slf4j:slf4j-api
%pom_add_dep biz.aQute.bnd:aQute.libg:%{version}
%pom_add_dep biz.aQute.bnd:biz.aQute.bnd.annotation:%{version}
cd -
cd biz.aQute.bnd
cp -p %{SOURCE3} pom.xml
%pom_add_parent biz.aQute.bnd:parent:%{version}
%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}
%pom_add_dep org.apache.ant:ant
%pom_add_dep org.osgi:osgi.annotation
%pom_add_dep org.osgi:osgi.core
%pom_add_dep org.osgi:osgi.cmpn
%pom_add_dep org.slf4j:slf4j-api
%pom_add_dep org.slf4j:slf4j-simple::runtime
cd -
cd maven
rm bnd-shared-maven-lib/src/main/java/aQute/bnd/maven/lib/resolve/DependencyResolver.java
%pom_remove_dep -r :biz.aQute.resolve
%pom_remove_dep -r :biz.aQute.repository
%pom_disable_module bnd-indexer-maven-plugin
%pom_disable_module bnd-export-maven-plugin
%pom_disable_module bnd-resolver-maven-plugin
%pom_disable_module bnd-testing-maven-plugin
%pom_remove_plugin -r :maven-invoker-plugin
%pom_remove_plugin -r :maven-javadoc-plugin
%pom_remove_plugin -r :flatten-maven-plugin
cd -
%mvn_alias biz.aQute.bnd:biz.aQute.bnd :bnd biz.aQute:bnd
%mvn_alias biz.aQute.bnd:biz.aQute.bndlib :bndlib biz.aQute:bndlib
%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-shared-maven-lib maven
%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
%build
cd aQute.libg
mvn package -DskipTests -Pdist -Dtar
cd -
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
%install
%mvn_install
install -d -m 755 %{buildroot}%{_sysconfdir}/ant.d
echo "aqute-bnd slf4j/api slf4j/simple osgi-annotation osgi-core osgi-compendium" >%{buildroot}%{_sysconfdir}/ant.d/aqute-bnd
%jpackage_script aQute.bnd.main.bnd "" "" aqute-bnd:slf4j/slf4j-api:slf4j/slf4j-simple:osgi-annotation:osgi-core:osgi-compendium bnd 1
cp -arf aQute.libg/target/biz.aQute.bnd.embedded-repo-4.3.0.jar %{buildroot}%{_javadir}/%{name}/
cp -arf aQute.libg/target/biz.aQute.repository-3.5.0.jar %{buildroot}%{_javadir}/%{name}/
%files -f .mfiles
%files -f .mfiles-bndlib
%files -f .mfiles-maven
%doc LICENSE
%{_bindir}/bnd
%config(noreplace) %{_sysconfdir}/ant.d/*
%{_javadir}/%{name}/biz.aQute.bnd.embedded-repo-4.3.0.jar
%{_javadir}/%{name}/biz.aQute.repository-3.5.0.jar
%files help -f .mfiles-javadoc
%changelog
* Thu May 04 2023 Ge Wang - 3.5.0-10
- fix bnd compile failure
* Mon Mar 22 2021 lingsheng - 3.5.0-9
- Do not edit source directly before packaging
* Wed Dec 23 2020 Ge Wang - 3.5.0-8
- Modify homepage url and source url
* Sat Sep 12 2020 yanan li - 3.5.0-7
- fix build fail
* Fri Feb 14 likexin - 3.5.0-6
- Package init