Accepting request 1202894 from Java:packages

Use SOURCE_DATE_EPOCH for reproducible builds

OBS-URL: https://build.opensuse.org/request/show/1202894
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libreadline-java?expand=0&rev=35
This commit is contained in:
Ana Guerrero 2024-09-24 15:34:34 +00:00 committed by Git OBS Bridge
commit 95bf1296c0
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,25 @@
--- libreadline-java-0.8.3/Makefile 2024-09-24 11:56:26.680687376 +0200
+++ libreadline-java-0.8.3/Makefile 2024-09-24 12:01:12.635966813 +0200
@@ -163,10 +163,20 @@
world : jar build-native
jar: build-java
- cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar -cvmf ../$(MF_STUB) ../$(JAR) *
+ cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar \
+ --date="$$(date -u -d @$${SOURCE_DATE_EPOCH:-$$(date +%s)} +%Y-%m-%dT%H:%M:%SZ)" \
+ --create \
+ --verbose \
+ --manifest=../$(MF_STUB) \
+ --file=../$(JAR) *
$(JAR):
- cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar -cvmf ../$(MF_STUB) ../$(JAR) *
+ cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar \
+ --date="$$(date -u -d @$${SOURCE_DATE_EPOCH:-$$(date +%s)} +%Y-%m-%dT%H:%M:%SZ)" \
+ --create \
+ --verbose \
+ --manifest=../$(MF_STUB) \
+ --file=../$(JAR) *
build-java: $(BUILDDIR)
cd src ; $(MAKE) JAVAC="$(JAVAC)" JC_FLAGS="$(JC_FLAGS)" \

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Sep 24 10:04:54 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* libreadline-java-reproducible-jar-mtime.patch
+ use SOURCE_DATE_EPOCH for reproducible jar modification times
-------------------------------------------------------------------
Mon May 6 15:58:26 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@ -30,6 +30,7 @@ Patch0: libreadline-java-ncurses.patch
Patch1: libreadline-java-libdir.patch
Patch3: libreadline-java-0.8.0-jdk10.patch
Patch4: libreadline-java-gcc14.patch
Patch10: libreadline-java-reproducible-jar-mtime.patch
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-tools
@ -59,6 +60,10 @@ wrapper. This package contains the javadoc documentation for it.
%patch -P 1
%patch -P 3 -p1
%patch -P 4 -p1
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0}
%patch -P 10 -p1
%endif
find . -name "*.jar" -exec rm -f {} \;
sed -i 's|@LIBDIR@|%{_libdir}|' src/org/gnu/readline/Readline.java