From ea9987afa36ffc9b5b7e3a16413ed3b3a2747d36 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Tue, 28 Jul 2020 18:10:26 +0100
Subject: [PATCH] Update to latest 4.x release

---
 .gitignore     |  28 +--------
 aqute-bnd.spec |  82 +++++++++++++++++---------
 parent.pom     | 156 +------------------------------------------------
 sources        |  12 ++--
 4 files changed, 67 insertions(+), 211 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9d1f87a..7673d94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,33 +1,11 @@
 /results_*
 /*.src.rpm
-
-/aqute-service.tar.gz
-/bnd-0.0.363.jar
+/*.noarch.rpm
 /2.4.1.REL.tar.gz
-/biz.aQute.bnd-2.4.1.pom
-/biz.aQute.bndlib-2.4.1.pom
 /3.2.0.REL.tar.gz
-/aQute.libg-3.2.0.pom
-/biz.aQute.bnd-3.2.0.pom
-/biz.aQute.bndlib-3.2.0.pom
-/biz.aQute.bnd.annotation-3.2.0.pom
 /3.3.0.REL.tar.gz
-/aQute.libg-3.3.0.pom
-/biz.aQute.bnd-3.3.0.pom
-/biz.aQute.bndlib-3.3.0.pom
-/biz.aQute.bnd.annotation-3.3.0.pom
 /3.4.0.REL.tar.gz
-/aQute.libg-3.4.0.pom
-/biz.aQute.bnd-3.4.0.pom
-/biz.aQute.bndlib-3.4.0.pom
-/biz.aQute.bnd.annotation-3.4.0.pom
 /3.5.0.REL.tar.gz
-/aQute.libg-3.5.0.pom
-/biz.aQute.bnd-3.5.0.pom
-/biz.aQute.bndlib-3.5.0.pom
-/biz.aQute.bnd.annotation-3.5.0.pom
 /4.3.0.REL.tar.gz
-/aQute.libg-4.3.0.pom
-/biz.aQute.bnd-4.3.0.pom
-/biz.aQute.bndlib-4.3.0.pom
-/biz.aQute.bnd.annotation-4.3.0.pom
+/4.3.1.REL.tar.gz
+/*.pom
diff --git a/aqute-bnd.spec b/aqute-bnd.spec
index ac39ac2..61a3ddd 100644
--- a/aqute-bnd.spec
+++ b/aqute-bnd.spec
@@ -1,6 +1,6 @@
 
 Name:           aqute-bnd
-Version:        4.3.0
+Version:        4.3.1
 Release:        1%{?dist}
 Summary:        BND Tool
 # Part of jpm is under BSD, but jpm is not included in binary RPM
@@ -14,14 +14,23 @@ Source0:        %{version}.REL.tar.gz
 # ./repack-tarball.sh
 Source1:        repack-tarball.sh
 
+# A custom aggregator pom to run the build
 Source2:        parent.pom
+# Poms from maven central since upstream uses gradle to build
 Source3:        https://repo1.maven.org/maven2/biz/aQute/bnd/aQute.libg/%{version}/aQute.libg-%{version}.pom
 Source4:        https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd/%{version}/biz.aQute.bnd-%{version}.pom
 Source5:        https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/%{version}/biz.aQute.bndlib-%{version}.pom
 Source6:        https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.annotation/%{version}/biz.aQute.bnd.annotation-%{version}.pom
+Source7:        https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.exporters/%{version}/biz.aQute.bnd.exporters-%{version}.pom
+Source8:        https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.reporter/%{version}/biz.aQute.bnd.reporter-%{version}.pom
 
+# Remove support for remote and resolve commands since they bring more deps than we want
 Patch0:         0001-Disable-removed-commands.patch
+
+# Fix build failure against ant
 Patch1:         0002-Fix-ant-compatibility.patch
+
+# Fix unimplemented new APIs introduced in OSGi R7
 Patch2:         0003-Port-to-OSGI-7.0.0.patch
 
 # Twig is dead upstream, so patch out the option to use it for reports
@@ -92,31 +101,32 @@ rm gradlew*
 %patch2 -p1
 %patch3 -p1
 
-# the commands pull in more dependencies than we want (felix-resolver, jetty)
-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
 
-# remove twig plugin for report generator (twig is dead upstream)
-rm biz.aQute.bnd.reporter/src/biz/aQute/bnd/reporter/plugins/transformer/JtwigTransformerPlugin.java
-
 # libg
 pushd aQute.libg
 cp -p %{SOURCE3} pom.xml
 %pom_add_parent biz.aQute.bnd:parent:%{version}
 %pom_remove_dep :org.osgi.util.function
 %pom_remove_dep :org.osgi.util.promise
-%pom_add_dep org.osgi:osgi.core
 %pom_add_dep org.osgi:osgi.cmpn
+%pom_add_dep org.osgi:osgi.core
 popd
 
-# bndlib.annotations
-pushd biz.aQute.bnd.annotation
-cp -p %{SOURCE6} pom.xml
+# bnd
+pushd biz.aQute.bnd
+cp -p %{SOURCE4} pom.xml
+sed -i -r 's/provided/compile/' pom.xml
 %pom_add_parent biz.aQute.bnd:parent:%{version}
-%pom_add_dep org.osgi:osgi.core
-%pom_add_dep org.osgi:osgi.cmpn
+# add missing dep for ant tasks
+%pom_add_dep org.apache.ant:ant
+# remove support for remote and resolve commands
+rm src/aQute/bnd/main/{RemoteCommand,ResolveCommand}.java
+%pom_remove_dep :biz.aQute.resolve
+%pom_remove_dep :biz.aQute.repository
+%pom_remove_dep :biz.aQute.remote.api
+%pom_remove_dep :snakeyaml
 popd
 
 # bndlib
@@ -131,20 +141,35 @@ cp -p %{SOURCE5} pom.xml
 %pom_add_dep biz.aQute.bnd:biz.aQute.bnd.annotation:%{version}
 popd
 
-# bnd
-cp -r biz.aQute.bnd.exporters/src/aQute/bnd/exporter biz.aQute.bnd/src/aQute/bnd/main/
-cp -r biz.aQute.bnd.reporter/src/biz/aQute/bnd/reporter biz.aQute.bnd/src/aQute/bnd/main/
-pushd biz.aQute.bnd
-cp -p %{SOURCE4} pom.xml
+# bnd.annotation
+pushd biz.aQute.bnd.annotation
+cp -p %{SOURCE6} pom.xml
 %pom_add_parent biz.aQute.bnd:parent:%{version}
-%pom_remove_dep :biz.aQute.resolve
-%pom_remove_dep :biz.aQute.repository
-%pom_remove_dep :biz.aQute.bnd.exporters
-%pom_remove_dep :biz.aQute.bnd.reporter
-%pom_remove_dep :biz.aQute.remote.api
-%pom_remove_dep :snakeyaml
-%pom_add_dep com.github.javaparser:javaparser-core
-%pom_add_dep org.apache.ant:ant
+%pom_add_dep org.osgi:osgi.core
+%pom_add_dep org.osgi:osgi.cmpn
+popd
+
+# bnd.exporters
+pushd biz.aQute.bnd.exporters
+cp -p %{SOURCE7} pom.xml
+%pom_add_parent biz.aQute.bnd:parent:%{version}
+%pom_add_dep org.osgi:osgi.core
+%pom_add_dep org.osgi:osgi.cmpn
+popd
+
+# bnd.reporter
+pushd biz.aQute.bnd.reporter
+cp -p %{SOURCE8} pom.xml
+%pom_add_parent biz.aQute.bnd:parent:%{version}
+%pom_add_dep org.osgi:osgi.core
+%pom_add_dep org.osgi:osgi.cmpn
+# remove twig dep and friends (twig is dead upstream)
+rm src/biz/aQute/bnd/reporter/plugins/transformer/JtwigTransformerPlugin.java
+%pom_remove_dep org.jtwig:
+%pom_remove_dep com.googlecode.concurrentlinkedhashmap:
+%pom_remove_dep com.google.guava:
+# uneeded dependency
+%pom_remove_dep :commons-lang3
 popd
 
 # maven-plugins
@@ -202,7 +227,7 @@ popd
 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/%{name}
 
-%jpackage_script aQute.bnd.main.bnd "" "" aqute-bnd:slf4j/slf4j-api:slf4j/slf4j-simple:osgi-annotation:osgi-core:osgi-compendium bnd 1
+%jpackage_script aQute.bnd.main.bnd "" "" aqute-bnd:slf4j/slf4j-api:slf4j/slf4j-simple:jline/jline:jansi/jansi:osgi-annotation:osgi-core:osgi-compendium bnd 1
 
 %files -f .mfiles
 %license LICENSE
@@ -218,6 +243,9 @@ echo "aqute-bnd slf4j/api slf4j/simple osgi-annotation osgi-core osgi-compendium
 %license LICENSE
 
 %changelog
+* Tue Jul 28 2020 Mat Booth <mat.booth@redhat.com> - 4.3.1-1
+- Update to latest 4.x release
+
 * Mon Jul 27 2020 Mat Booth <mat.booth@redhat.com> - 4.3.0-1
 - Update to upstream version 4.3.0
 
diff --git a/parent.pom b/parent.pom
index e637e27..cda8582 100644
--- a/parent.pom
+++ b/parent.pom
@@ -9,165 +9,13 @@
 
     <packaging>pom</packaging>
 
-    <name>Parent project for bnd tool suite</name>
-    <description>Project information for bnd.</description>
-    <url>http://www.aQute.biz/Code/Bnd</url>
-
-    <organization>
-        <name>aQute SARL</name>
-        <url>http://www.aQute.biz</url>
-    </organization>
-
-    <licenses>
-        <license>
-            <name>Apache Software License 2.0</name>
-            <url>http://www.opensource.org/licenses/apache2.0.php</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-
-    <developers>
-        <developer>
-            <id>bnd</id>
-            <name>Peter Kriens</name>
-            <organization>aQute SARL</organization>
-            <roles>
-                <role>Primary Developer</role>
-            </roles>
-        </developer>
-        <developer>
-            <id>bjhargrave</id>
-            <name>BJ Hargrave</name>
-        </developer>
-        <developer>
-            <id>mcculls</id>
-            <name>Stuart McCulloch</name>
-        </developer>
-        <developer>
-            <id>njbartlett</id>
-            <name>Neil Bartlett</name>
-            <organization>Paremus</organization>
-        </developer>
-        <developer>
-            <id>fhuberts</id>
-            <name>Ferry Huberts</name>
-            <organization>Pelagic</organization>
-        </developer>
-        <developer>
-            <id>psoreide</id>
-            <name>PK S&#248;reide</name>
-            <organization>Comactivity AB</organization>
-        </developer>
-    </developers>
-    <contributors>
-        <contributor>
-            <!--<id>derheld42</id>-->
-            <name>Carter Smithhart</name>
-        </contributor>
-        <contributor>
-            <!--<id>cchabanois</id>-->
-            <name>Chabanois Cédric</name>
-            <organization>Entropysoft</organization>
-        </contributor>
-        <contributor>
-            <!--<id>paulbakker</id>-->
-            <name>Paul Bakker</name>
-            <organization>Luminis Technologies</organization>
-        </contributor>
-        <contributor>
-            <!--<id>djencks</id>-->
-            <name>David Jencks</name>
-        </contributor>
-        <contributor>
-            <!--<id>rkrzewski</id>-->
-            <name>Rafa&#322; Krzewski</name>
-            <organization>Caltha - Krzewski, Mach, Potempski Sp. J.</organization>
-        </contributor>
-        <contributor>
-            <!--<id>xfournet</id>-->
-            <name>Xavier Fournet</name>
-        </contributor>
-        <contributor>
-            <!--<id>crabbkw</id>-->
-            <name>Casey Crabb</name>
-        </contributor>
-        <contributor>
-            <!--<id>david.bosschaert</id>-->
-            <name>David Bosschaert</name>
-        </contributor>
-        <contributor>
-            <!--<id>harald.wellmann</id>-->
-            <name>Harald Wellmann</name>
-        </contributor>
-        <contributor>
-            <!--<id>janwillem.janssen</id>-->
-            <name>Jan Willem Janssen</name>
-        </contributor>
-        <contributor>
-            <!--<id>marcel.offermans</id>-->
-            <name>Marcel Offermans</name>
-        </contributor>
-        <contributor>
-            <!--<id>marian.grigoras</id>-->
-            <name>Marian Grigoras</name>
-        </contributor>
-        <contributor>
-            <!--<id>markuswolf</id>-->
-            <name>Markus Wolf</name>
-        </contributor>
-        <contributor>
-            <!--<id>nicolas.lalevee</id>-->
-            <name>Nicolas Lalevée</name>
-        </contributor>
-        <contributor>
-            <!--<id>pierre.labiausse</id>-->
-            <name>Pierre Labiausse</name>
-        </contributor>
-        <contributor>
-            <!--<id>raymond.auge</id>-->
-            <name>Raymond Auge</name>
-        </contributor>
-        <contributor>
-            <!--<id>timothyjward</id>-->
-            <name>Tim Ward</name>
-        </contributor>
-        <contributor>
-            <!--<id>bramk</id>-->
-            <name>Bram de Kruijff</name>
-        </contributor>
-        <contributor>
-            <!--<id>tangyong</id>-->
-            <name>Tang Yong</name>
-        </contributor>
-        <contributor>
-            <!--<id>gamerson</id>-->
-            <name>Gregory Amerson</name>
-        </contributor>
-        <contributor>
-            <!--<id>gnodet</id>-->
-            <name>Guillaume Nodet</name>
-        </contributor>
-        <contributor>
-            <!--<id>marcdejonge</id>-->
-            <name>Marc de Jonge</name>
-        </contributor>
-        <contributor>
-            <!--<id>trespasserw</id>-->
-            <name>Roman Shevchenko</name>
-        </contributor>
-    </contributors>
-
-    <scm>
-        <url>https://github.com/bndtools/bnd</url>
-        <connection>scm:git:git://github.com/bndtools/bnd.git</connection>
-        <developerConnection>scm:git:ssh://github.com/bndtools/bnd.git</developerConnection>
-    </scm>
-
     <modules>
         <module>aQute.libg</module>
         <module>biz.aQute.bndlib</module>
         <module>biz.aQute.bnd</module>
         <module>biz.aQute.bnd.annotation</module>
+        <module>biz.aQute.bnd.exporters</module>
+        <module>biz.aQute.bnd.reporter</module>
         <module>maven</module>
     </modules>
 
diff --git a/sources b/sources
index ebf3d61..6a95e10 100644
--- a/sources
+++ b/sources
@@ -1,5 +1,7 @@
-SHA512 (4.3.0.REL.tar.gz) = 0bae90a388fb52b9af88457b2a9b78530958be72567d66a0369c534df1aad7f2e7dae13e97a7153f847283b8fc31b1f76ef00c88944076a35e64b9e596925fec
-SHA512 (aQute.libg-4.3.0.pom) = a60d7d41a3eae51827e30a683b078087dde2d7f1dca79a4acccee1e25df84f7498a3be01eea69bc06eba355f3df490452dd8edbac469c294b34327dd46802c9e
-SHA512 (biz.aQute.bnd-4.3.0.pom) = e9b4f64359965c1b7799e545212f269fa5ced54d28160079e111529609b22e45eb9f0f0853e7270734cb2d468cbd4127601dcfe523d53ec2ba7c6af8f50f5346
-SHA512 (biz.aQute.bndlib-4.3.0.pom) = d74384a5d3f590d10a29b47734365eae1cdcf566bbab5a193db9b31fd64133091a2fe836e035f2add6c21b12a537bd3618c03d3b3e5412ccf8ff7765097a2df7
-SHA512 (biz.aQute.bnd.annotation-4.3.0.pom) = ef578cea5b1773e307f168ef27d91344f6f7d7ac874ff841e1831ff12ec741a568777931a29528a55812afed737af893740b8d812de4c72d8d9e07c027b56cd6
+SHA512 (4.3.1.REL.tar.gz) = 103d5cba7a7f62b845c362001717eac0409b801813464252d5d4f8dd2aadd24f61e278309e92ba5dc20acc1940ba99b25b26bfa8437560169a84e34751d84ca1
+SHA512 (aQute.libg-4.3.1.pom) = 63b17d0519224e872007e5327e4743494b0654c43caab1204831f707f45a64c1691d92e0bccefc490476ab832f74dea871944251dadd037a74f0eba8ad7e640b
+SHA512 (biz.aQute.bnd-4.3.1.pom) = fa4ab223840ccb089ec2e2fc9bcf23849ead09ba9119c8e56047464bca6116c3a159b53d2b8374a057a77c9968ba852b2b10c6bd0a77e66043a4ddad761a6cb5
+SHA512 (biz.aQute.bnd.annotation-4.3.1.pom) = 24fd9ad310177edf65ad9ef3b890834dc46c7fd86071d3afef47b24a5bbc4f2d08d4d5c376b6e49699bdf38e35d719267f5ffc3e5537ddcf52fc94ab9427a0e4
+SHA512 (biz.aQute.bnd.exporters-4.3.1.pom) = 95303ed421f9514165ac8cd077ba7391852a3d195ab6603b2425fc5a5cdcd0a768ea746cfcf2d0ffa0d9c8f4de5c7a1856b361b9ddf1fd11ce69b73cde3e5f97
+SHA512 (biz.aQute.bndlib-4.3.1.pom) = ba8d535afdb94a2d74c67bd954216cccfd08a2f674dae959a9cd3df3a3d66248000b959c696b59f22b12f29f34bdda2e60a3d20880190d33f61abedef955cb91
+SHA512 (biz.aQute.bnd.reporter-4.3.1.pom) = 41181d44d01205679ea62f62dd57480a554e20b7c55470fd8d2204bbbeb6856e9728d826359c859f508f029551edfb9edb30d6a96110916e05d65eb917ee17b9