diff --git a/n_tigervnc-reproducible-jar-mtime.patch b/n_tigervnc-reproducible-jar-mtime.patch new file mode 100644 index 0000000..81077f9 --- /dev/null +++ b/n_tigervnc-reproducible-jar-mtime.patch @@ -0,0 +1,32 @@ +diff -urEbwB tigervnc-1.13.1.orig/java/CMakeLists.txt tigervnc-1.13.1/java/CMakeLists.txt +--- tigervnc-1.13.1.orig/java/CMakeLists.txt 2024-09-26 22:41:57.677131737 +0200 ++++ tigervnc-1.13.1/java/CMakeLists.txt 2024-09-26 22:46:01.029014276 +0200 +@@ -139,6 +139,15 @@ + string(REGEX REPLACE "jar" "" Java_PATH ${Java_JAR_EXECUTABLE}) + string(REGEX REPLACE ".exe" "" Java_PATH ${Java_PATH}) + ++if (DEFINED ENV{SOURCE_DATE_EPOCH}) ++ execute_process( ++ COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%dT%H:%M:%SZ" ++ OUTPUT_VARIABLE COMPILATION_DATE ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++else () ++ string (TIMESTAMP COMPILATION_DATE "+%Y-%m-%dT%H:%M:%SZ") ++endif () ++ + add_custom_command(OUTPUT VncViewer.jar + DEPENDS ${JAVA_CLASSES} + ${SRCDIR}/${CLASSPATH}/MANIFEST.MF +@@ -148,8 +157,10 @@ + ${BINDIR}/${CLASSPATH}/insecure.png + ${BINDIR}/${CLASSPATH}/secure.png + COMMAND ${JAVA_ARCHIVE} +- ARGS cfm VncViewer.jar +- ${SRCDIR}/${CLASSPATH}/MANIFEST.MF ++ ARGS --create ++ --date=${COMPILATION_DATE} ++ --file=VncViewer.jar ++ --manifest=${SRCDIR}/${CLASSPATH}/MANIFEST.MF + ${CLASSPATH}/timestamp + ${CLASSPATH}/*.class + com/tigervnc/rfb/*.class diff --git a/tigervnc.changes b/tigervnc.changes index 9c15908..d4bae87 100644 --- a/tigervnc.changes +++ b/tigervnc.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Sep 26 20:58:00 UTC 2024 - Fridrich Strba + +- Added patch: + * n_tigervnc-reproducible-jar-mtime.patch + + Use SOURCE_DATE_EPOCH for reproducible jar mtime + + Applied if building with Java >= 17 + ------------------------------------------------------------------- Tue Sep 24 11:27:02 UTC 2024 - Stefan Dirsch diff --git a/tigervnc.spec b/tigervnc.spec index 4cfc143..8b790ee 100644 --- a/tigervnc.spec +++ b/tigervnc.spec @@ -61,6 +61,10 @@ Patch5: n_tigervnc-Date-time.patch Patch6: n_tigervnc-Correct-path-in-desktop-file.patch Patch7: n_tigervnc-Vncserver.patch Patch8: n_tigervnc-Dont-sign-java-client.patch +# The "--date" option was added into jar in OpenJDK 17 +%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0} +Patch9: n_tigervnc-reproducible-jar-mtime.patch +%endif Provides: tightvnc = 1.5.0 Obsoletes: tightvnc < 1.5.0 Provides: vnc @@ -132,7 +136,7 @@ BuildRequires: pkgconfig(xtrans) >= 1.2.2 BuildRequires: pkgconfig(zlib) %if 0%{?suse_version} >= 1315 Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %endif %description