aqute-bnd/aqute-bnd.spec

187 lines
7.5 KiB
RPMSpec
Raw Permalink Normal View History

2020-02-14 15:49:57 +08:00
Name: aqute-bnd
Version: 3.5.0
2024-03-29 15:22:54 +08:00
Release: 11
2020-02-14 15:49:57 +08:00
Summary: BND Tool
License: ASL 2.0
2020-12-24 15:41:48 +08:00
URL: https://github.com/bndtools/bnd/
2024-03-29 15:22:54 +08:00
Source0: https://github.com/bndtools/bnd/archive/refs/tags/%{version}.REL.tar.gz
2020-12-24 15:41:48 +08:00
Source1: https://repo1.maven.org/maven2/biz/aQute/bnd/parent/2.4.0/parent-2.4.0.pom#/parent.pom
2020-02-14 15:49:57 +08:00
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
2024-03-29 15:22:54 +08:00
Source6: add-maven-dependency-plugin.patch
2020-02-14 15:49:57 +08:00
Patch0001: 0001-Disable-removed-commands.patch
Patch0002: 0002-Fix-ant-compatibility.patch
2020-09-12 15:04:18 +08:00
Patch0003: 0003-Port-to-OSGI-7.0.0.patch
2020-02-14 15:49:57 +08:00
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)
2024-03-29 15:22:54 +08:00
BuildRequires: java-1.8.0-openjdk-devel maven
BuildRequires: maven-dependency-plugin
Requires: java-1.8.0-openjdk
2020-02-14 15:49:57 +08:00
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
2020-12-24 15:41:48 +08:00
echo " <modules>
<module>aQute.libg</module>
<module>biz.aQute.bndlib</module>
<module>biz.aQute.bnd</module>
<module>biz.aQute.bnd.annotation</module>
<module>maven</module>
</modules>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src/</directory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/packageinfo</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>" >> parent.pom
sed 's/@VERSION@/%{version}/' parent.pom > pom.xml
2020-02-14 15:49:57 +08:00
sed -i 's|${Bundle-Version}|%{version}|' biz.aQute.bndlib/src/aQute/bnd/osgi/bnd.info
cd aQute.libg
cp -p %{SOURCE2} pom.xml
2024-03-29 15:22:54 +08:00
cp -p %{SOURCE6} add-maven-dependency-plugin.patch
2020-02-14 15:49:57 +08:00
%pom_add_parent biz.aQute.bnd:parent:%{version}
2024-03-29 15:22:54 +08:00
%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
2020-02-14 15:49:57 +08:00
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
2024-03-29 15:22:54 +08:00
cd aQute.libg
mvn package -DskipTests -Pdist -Dtar
cd -
2020-02-14 15:49:57 +08:00
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
2024-03-29 15:22:54 +08:00
2020-02-14 15:49:57 +08:00
%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
2024-03-29 15:22:54 +08:00
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}/
2020-02-14 15:49:57 +08:00
%files -f .mfiles
%files -f .mfiles-bndlib
%files -f .mfiles-maven
%doc LICENSE
%{_bindir}/bnd
%config(noreplace) %{_sysconfdir}/ant.d/*
2024-03-29 15:22:54 +08:00
%{_javadir}/%{name}/biz.aQute.bnd.embedded-repo-4.3.0.jar
%{_javadir}/%{name}/biz.aQute.repository-3.5.0.jar
2020-02-14 15:49:57 +08:00
%files help -f .mfiles-javadoc
%changelog
2024-03-29 15:22:54 +08:00
* Mon Mar 18 2024 liyanan <liyanan61@h-partners.com> - 3.5.0-11
- Remove redundant depenedencies
* Thu May 04 2023 Ge Wang <wang__ge@126.com> - 3.5.0-10
- fix bnd compile failure
* Mon Mar 22 2021 lingsheng <lingsheng@huawei.com> - 3.5.0-9
- Do not edit source directly before packaging
2020-12-24 15:41:48 +08:00
* Wed Dec 23 2020 Ge Wang <wangge20@huawei.com> - 3.5.0-8
- Modify homepage url and source url
2020-09-12 15:04:18 +08:00
* Sat Sep 12 2020 yanan li <liyanan032@huawei.com> - 3.5.0-7
- fix build fail
2020-02-14 15:49:57 +08:00
* Fri Feb 14 likexin <likexin4@huawei.com> - 3.5.0-6
- Package init