diff --git a/ant-antlr.changes b/ant-antlr.changes index 6d3524c..3e7f82b 100644 --- a/ant-antlr.changes +++ b/ant-antlr.changes @@ -1,5 +1,16 @@ ------------------------------------------------------------------- -Sat May 4 00:53:40 UTC 2024 - Anton Shvetz +Thu Jul 18 12:09:04 UTC 2024 - Fridrich Strba + +- Added patches: + * reproducible-jar-mtime.patch + + make the modification times of files in a jar file + reproducible + * reproducible-javadoc.patch + + make javadoc generation reproducible: don't generate + timestamps, and normalize locale and encoding + +------------------------------------------------------------------- +Sat May 4 00:54:38 UTC 2024 - Anton Shvetz - Add forgotten open-test-reporting/events to %{_sysconfdir}/ant.d/junitlauncher diff --git a/ant-antlr.spec b/ant-antlr.spec index 0c2c293..0aca471 100644 --- a/ant-antlr.spec +++ b/ant-antlr.spec @@ -46,6 +46,8 @@ Patch5: reproducible-build-manifest.patch Patch6: apache-ant-xml-apis.patch # PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files Patch7: reproducible-propertyfile-task.patch +Patch8: reproducible-jar-mtime.patch +Patch9: reproducible-javadoc.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 @@ -395,6 +397,8 @@ find -name \*.jar -print -delete %patch -P 5 -p1 %patch -P 6 -p1 %patch -P 7 -p1 +%patch -P 8 -p1 +%patch -P 9 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant-junit.changes b/ant-junit.changes index d475e52..3e7f82b 100644 --- a/ant-junit.changes +++ b/ant-junit.changes @@ -1,5 +1,16 @@ ------------------------------------------------------------------- -Sat May 4 00:55:36 UTC 2024 - Anton Shvetz +Thu Jul 18 12:09:04 UTC 2024 - Fridrich Strba + +- Added patches: + * reproducible-jar-mtime.patch + + make the modification times of files in a jar file + reproducible + * reproducible-javadoc.patch + + make javadoc generation reproducible: don't generate + timestamps, and normalize locale and encoding + +------------------------------------------------------------------- +Sat May 4 00:54:38 UTC 2024 - Anton Shvetz - Add forgotten open-test-reporting/events to %{_sysconfdir}/ant.d/junitlauncher diff --git a/ant-junit.spec b/ant-junit.spec index 324f63a..f2b1b85 100644 --- a/ant-junit.spec +++ b/ant-junit.spec @@ -46,6 +46,8 @@ Patch5: reproducible-build-manifest.patch Patch6: apache-ant-xml-apis.patch # PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files Patch7: reproducible-propertyfile-task.patch +Patch8: reproducible-jar-mtime.patch +Patch9: reproducible-javadoc.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 @@ -395,6 +397,8 @@ find -name \*.jar -print -delete %patch -P 5 -p1 %patch -P 6 -p1 %patch -P 7 -p1 +%patch -P 8 -p1 +%patch -P 9 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant-junit5.changes b/ant-junit5.changes index 2156f70..3e7f82b 100644 --- a/ant-junit5.changes +++ b/ant-junit5.changes @@ -1,5 +1,16 @@ ------------------------------------------------------------------- -Sat May 4 00:55:23 UTC 2024 - Anton Shvetz +Thu Jul 18 12:09:04 UTC 2024 - Fridrich Strba + +- Added patches: + * reproducible-jar-mtime.patch + + make the modification times of files in a jar file + reproducible + * reproducible-javadoc.patch + + make javadoc generation reproducible: don't generate + timestamps, and normalize locale and encoding + +------------------------------------------------------------------- +Sat May 4 00:54:38 UTC 2024 - Anton Shvetz - Add forgotten open-test-reporting/events to %{_sysconfdir}/ant.d/junitlauncher diff --git a/ant-junit5.spec b/ant-junit5.spec index 53c45b6..4ec9300 100644 --- a/ant-junit5.spec +++ b/ant-junit5.spec @@ -46,6 +46,8 @@ Patch5: reproducible-build-manifest.patch Patch6: apache-ant-xml-apis.patch # PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files Patch7: reproducible-propertyfile-task.patch +Patch8: reproducible-jar-mtime.patch +Patch9: reproducible-javadoc.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 @@ -395,6 +397,8 @@ find -name \*.jar -print -delete %patch -P 5 -p1 %patch -P 6 -p1 %patch -P 7 -p1 +%patch -P 8 -p1 +%patch -P 9 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant.changes b/ant.changes index bd0432a..3e7f82b 100644 --- a/ant.changes +++ b/ant.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Jul 18 12:09:04 UTC 2024 - Fridrich Strba + +- Added patches: + * reproducible-jar-mtime.patch + + make the modification times of files in a jar file + reproducible + * reproducible-javadoc.patch + + make javadoc generation reproducible: don't generate + timestamps, and normalize locale and encoding + ------------------------------------------------------------------- Sat May 4 00:54:38 UTC 2024 - Anton Shvetz diff --git a/ant.spec b/ant.spec index 5efca30..7a3e57d 100644 --- a/ant.spec +++ b/ant.spec @@ -45,6 +45,8 @@ Patch5: reproducible-build-manifest.patch Patch6: apache-ant-xml-apis.patch # PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files Patch7: reproducible-propertyfile-task.patch +Patch8: reproducible-jar-mtime.patch +Patch9: reproducible-javadoc.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 @@ -394,6 +396,8 @@ find -name \*.jar -print -delete %patch -P 5 -p1 %patch -P 6 -p1 %patch -P 7 -p1 +%patch -P 8 -p1 +%patch -P 9 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/reproducible-jar-mtime.patch b/reproducible-jar-mtime.patch new file mode 100644 index 0000000..1d42f04 --- /dev/null +++ b/reproducible-jar-mtime.patch @@ -0,0 +1,89 @@ +--- apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Jar.java 2024-07-16 14:41:00.996055227 +0200 ++++ apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Jar.java 2024-07-16 14:52:07.583866195 +0200 +@@ -450,6 +450,13 @@ + serviceList.add(service); + } + ++ private long currentTimeMillisOrSourceDateEpoch() { ++ if ( System.getenv("SOURCE_DATE_EPOCH") != null ) { ++ return 1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")); ++ } ++ return System.currentTimeMillis(); ++ } ++ + /** + * Write SPI Information to JAR + */ +@@ -459,7 +466,7 @@ + //stolen from writeManifest + super.zipFile(is, zOut, + "META-INF/services/" + service.getType(), +- System.currentTimeMillis(), null, ++ currentTimeMillisOrSourceDateEpoch(), null, + ZipFileSet.DEFAULT_FILE_MODE); + } + } +@@ -579,7 +586,7 @@ + new ByteArrayInputStream(baos.toByteArray()); + try { + super.zipFile(bais, zOut, MANIFEST_NAME, +- System.currentTimeMillis(), null, ++ currentTimeMillisOrSourceDateEpoch(), null, + ZipFileSet.DEFAULT_FILE_MODE); + } finally { + // not really required +@@ -656,7 +663,7 @@ + writer.close(); + try (ByteArrayInputStream bais = + new ByteArrayInputStream(baos.toByteArray())) { +- super.zipFile(bais, zOut, INDEX_NAME, System.currentTimeMillis(), ++ super.zipFile(bais, zOut, INDEX_NAME, currentTimeMillisOrSourceDateEpoch(), + null, ZipFileSet.DEFAULT_FILE_MODE); + } + } +--- apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Zip.java 2024-07-16 14:41:00.999388566 +0200 ++++ apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Zip.java 2024-07-17 14:27:00.917945219 +0200 +@@ -682,6 +682,7 @@ + "Failed to create missing parent directory for %s", + zipFile); + } ++ parent.setLastModified(currentTimeMillisOrSourceDateEpoch()); + + updatedFile = true; + if (!zipFile.exists() && state.isWithoutAnyResources()) { +@@ -1669,6 +1670,13 @@ + extra); + } + ++ private long currentTimeMillisOrSourceDateEpoch() { ++ if ( System.getenv("SOURCE_DATE_EPOCH") != null ) { ++ return 1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")); ++ } ++ return System.currentTimeMillis(); ++ } ++ + /** + * Add a directory to the zip stream. + * @param dir the directory to add to the archive +@@ -1708,7 +1716,7 @@ + } else if (dir != null && dir.isExists()) { + ze.setTime(dir.getLastModified() + millisToAdd); + } else { +- ze.setTime(System.currentTimeMillis() + millisToAdd); ++ ze.setTime(currentTimeMillisOrSourceDateEpoch() + millisToAdd); + } + ze.setSize(0); + ze.setMethod(ZipEntry.STORED); +@@ -1794,7 +1802,11 @@ + + if (!skipWriting) { + final ZipEntry ze = new ZipEntry(vPath); +- ze.setTime(fixedModTime != null ? modTimeMillis : lastModified); ++ long newLastModified = lastModified; ++ if ( System.getenv("SOURCE_DATE_EPOCH") != null ) { ++ newLastModified = 1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")); ++ } ++ ze.setTime(fixedModTime != null ? modTimeMillis : newLastModified); + ze.setMethod(doCompress ? ZipEntry.DEFLATED : ZipEntry.STORED); + // if the input stream doesn't support mark/reset ability, we wrap it in a + // stream that adds that support. diff --git a/reproducible-javadoc.patch b/reproducible-javadoc.patch new file mode 100644 index 0000000..578b25d --- /dev/null +++ b/reproducible-javadoc.patch @@ -0,0 +1,38 @@ +--- apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Javadoc.java 2024-07-17 15:06:13.718343866 +0200 ++++ apache-ant-1.10.14/src/main/org/apache/tools/ant/taskdefs/Javadoc.java 2024-07-18 14:51:50.362329096 +0200 +@@ -1297,6 +1297,15 @@ + } + + /** ++ * Control generation of timestamps. ++ * ++ * @param b if true, don't generate timestamps. ++ */ ++ public void setNoTimestamp(final boolean b) { ++ addArgIf(b, "-notimestamp"); ++ } ++ ++ /** + * Create link to Javadoc output at the given URL. + * + * @return link argument to configure +@@ -1807,6 +1816,19 @@ + */ + @Override + public void execute() throws BuildException { ++ if (System.getenv("SOURCE_DATE_EPOCH") != null) { ++ java.util.List arguments = java.util.Arrays.asList(cmd.getCommandline()); ++ if (!arguments.contains("-locale")) { ++ setLocale("en"); ++ } ++ if (!arguments.contains("-encoding")) { ++ setEncoding("UTF-8"); ++ } ++ if (!arguments.contains("-notimestamp")) { ++ setNoTimestamp(true); ++ } ++ } ++ + checkTaskName(); + + final List packagesToDoc = new Vector<>();