1313
1414Name: javapackages-bootstrap
1515Version: 1.5.0
16- Release: 4 %{?dist }
16+ Release: 5 %{?dist }
1717Summary: A means of bootstrapping Java Packages Tools
1818# For detailed info see the file javapackages-bootstrap-PACKAGE-LICENSING
1919License: ASL 2.0 and ASL 1.1 and (ASL 2.0 or EPL-2.0) and (EPL-2.0 or GPLv2 with exceptions) and MIT and (BSD with advertising) and BSD-3-Clause and EPL-1.0 and EPL-2.0 and CDDL-1.0 and xpp and CC0 and Public Domain
@@ -25,6 +25,7 @@ Source0: https://github.com/fedora-java/javapackages-bootstrap/releases/d
2525# License breakdown
2626Source1: javapackages-bootstrap-PACKAGE-LICENSING
2727Source2: ignore.upstream.patch.txt
28+ Source3: guava.xml
2829
2930Source1002: apache-pom.tar.xz
3031Source1001: ant.tar.xz
@@ -52,7 +53,7 @@ Source1023: easymock.tar.xz
5253Source1024: felix-parent-pom.tar.xz
5354Source1025: felix-utils.tar.xz
5455Source1026: fusesource-pom.tar.xz
55- Source1027: guava.tar.xz
56+ Source1027: guava-32.1.3b .tar.xz
5657Source1028: guice.tar.xz
5758Source1029: hamcrest.tar.xz
5859Source1030: httpcomponents-client.tar.xz
@@ -138,6 +139,7 @@ Source1108: xz-java.tar.xz
138139Patch0: 0001-Bind-to-OpenJDK-11-for-runtime.patch
139140Patch1: 0001-Remove-usage-of-ArchiveStreamFactory.patch
140141Patch2: CVE-2023-37460.patch
142+ Patch3: Internal-Java-API.patch
141143
142144Provides: bundled(ant) = 1.10.9
143145Provides: bundled(apache-parent) = 23
@@ -165,7 +167,7 @@ Provides: bundled(easymock) = 4.2
165167Provides: bundled(felix-parent) = 7
166168Provides: bundled(felix-utils) = 1.11.6
167169Provides: bundled(fusesource-pom) = 1.12
168- Provides: bundled(guava) = 30.1
170+ Provides: bundled(guava) = 32.1.3
169171Provides: bundled(google-guice) = 4.2.3
170172Provides: bundled(hamcrest) = 2.2
171173Provides: bundled(httpcomponents-client) = 4.5.11
@@ -252,6 +254,7 @@ BuildRequires: byaccj
252254BuildRequires: msopenjdk-11
253255BuildRequires: javapackages-generators
254256BuildRequires: java-devel
257+ BuildRequires: jurand
255258
256259Requires: bash
257260Requires: coreutils
@@ -277,11 +280,11 @@ XMvn, allowing JPT to be used before one builds XMvn package.
277280
278281%prep
279282%setup -q
280-
283+ %patch 3 -p2
281284# leave out the first source as it has already been extracted
282285# leave out licensing breakdown file
283286# leave ignore patch text file
284- other_sources= $(echo %{sources } | cut -d' ' -f4 -)
287+ other_sources=$( echo %{sources} | cut -d' ' -f5 -)
285288
286289for source in ${other_sources}
287290do
@@ -297,11 +300,28 @@ pushd "downstream/plexus-archiver"
297300%patch2 -p1
298301popd
299302
303+ # remove guava.xml from javapackage-bootstrap 1.5.0
304+ # import guava.xml 32.1.3 from Fedora 40
305+ # edit version from guava.properties
306+ pushd "project"
307+ rm guava.xml
308+ cp %{SOURCE3 } .
309+ sed -i 's|version= 30.1|version= 32.1.3|' guava.properties
310+ sed -i 's|ref= v@.@|ref= v@.@.@|' guava.properties
311+ popd
312+
313+
300314for patch_path in patches/*/*
301315do
302316 package_name= "$(echo ${patch_path} | cut -f2 -d/)"
303317 patch_name= "$(echo ${patch_path} | cut -f3 -d/)"
304-
318+
319+ # ignore the patch provided by upstream javapackages-bootstrap as guava version has changed
320+ # and no longer compatible
321+ if [[ "$patch_name" == "0001-Fix-compilation-error-with-ECJ.patch" || "$patch_name" == "0002-Remove-use-of-sun.misc.Unsafe.patch" ]]
322+ then
323+ continue
324+ fi
305325 pushd "downstream/${package_name}"
306326 # not applying some patches provided by javapackages-bootstrap
307327 # some upstream patches become not applicable when upgrading any of the sources
@@ -364,6 +384,9 @@ sed -i 's|/usr/lib/jvm/java-11-openjdk|%{java_home}|' %{buildroot}%{launchersPat
364384%doc AUTHORS
365385
366386%changelog
387+ * Fri Mar 22 2024 Riken Maharjan <rmaharjan@microsoft.com> - 1.5.0-5
388+ - Update Guava to fix CVE-2023-2976 using Fedora 40 (License: MIT).
389+
367390* Fri Aug 11 2023 Saul Paredes <saulparedes@microsoft.com> - 1.5.0-4
368391- Patch plexus-archiver to fix CVE-2023-37460
369392
0 commit comments