From 0615f32bb745555671bcdc054e1535903cd9ddaab551f9f32848b8afd3a29a0d Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 11 Sep 2023 12:52:47 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/ant?expand=0&rev=177 --- ant-antlr.changes | 9 +++++++++ ant-antlr.spec | 3 +++ ant-junit.changes | 9 +++++++++ ant-junit.spec | 3 +++ ant-junit5.changes | 9 +++++++++ ant-junit5.spec | 3 +++ ant.changes | 9 +++++++++ ant.spec | 3 +++ reproducible-propertyfile-task.patch | 21 +++++++++++++++++++++ 9 files changed, 69 insertions(+) create mode 100644 reproducible-propertyfile-task.patch diff --git a/ant-antlr.changes b/ant-antlr.changes index a64bd41..f71e277 100644 --- a/ant-antlr.changes +++ b/ant-antlr.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Sep 11 12:50:03 UTC 2023 - Fridrich Strba + +- Added patch: + * reproducible-propertyfile-task.patch + + Debian patch to improve propertyfile task in RPM builds by + using the date specified by the SOURCE_DATE_EPOCH variable + in the header of the .properties file generated + ------------------------------------------------------------------- Thu Aug 31 06:49:53 UTC 2023 - Fridrich Strba diff --git a/ant-antlr.spec b/ant-antlr.spec index 19bd65f..1546032 100644 --- a/ant-antlr.spec +++ b/ant-antlr.spec @@ -44,6 +44,8 @@ Patch3: reproducible-build-date.patch # PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest 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 BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -392,6 +394,7 @@ find -name \*.jar -print -delete %patch3 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant-junit.changes b/ant-junit.changes index a64bd41..f71e277 100644 --- a/ant-junit.changes +++ b/ant-junit.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Sep 11 12:50:03 UTC 2023 - Fridrich Strba + +- Added patch: + * reproducible-propertyfile-task.patch + + Debian patch to improve propertyfile task in RPM builds by + using the date specified by the SOURCE_DATE_EPOCH variable + in the header of the .properties file generated + ------------------------------------------------------------------- Thu Aug 31 06:49:53 UTC 2023 - Fridrich Strba diff --git a/ant-junit.spec b/ant-junit.spec index 0930cbf..08fd0a4 100644 --- a/ant-junit.spec +++ b/ant-junit.spec @@ -44,6 +44,8 @@ Patch3: reproducible-build-date.patch # PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest 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 BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -392,6 +394,7 @@ find -name \*.jar -print -delete %patch3 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant-junit5.changes b/ant-junit5.changes index a64bd41..f71e277 100644 --- a/ant-junit5.changes +++ b/ant-junit5.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Sep 11 12:50:03 UTC 2023 - Fridrich Strba + +- Added patch: + * reproducible-propertyfile-task.patch + + Debian patch to improve propertyfile task in RPM builds by + using the date specified by the SOURCE_DATE_EPOCH variable + in the header of the .properties file generated + ------------------------------------------------------------------- Thu Aug 31 06:49:53 UTC 2023 - Fridrich Strba diff --git a/ant-junit5.spec b/ant-junit5.spec index bc97db3..618be54 100644 --- a/ant-junit5.spec +++ b/ant-junit5.spec @@ -44,6 +44,8 @@ Patch3: reproducible-build-date.patch # PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest 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 BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -392,6 +394,7 @@ find -name \*.jar -print -delete %patch3 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant.changes b/ant.changes index a64bd41..f71e277 100644 --- a/ant.changes +++ b/ant.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Sep 11 12:50:03 UTC 2023 - Fridrich Strba + +- Added patch: + * reproducible-propertyfile-task.patch + + Debian patch to improve propertyfile task in RPM builds by + using the date specified by the SOURCE_DATE_EPOCH variable + in the header of the .properties file generated + ------------------------------------------------------------------- Thu Aug 31 06:49:53 UTC 2023 - Fridrich Strba diff --git a/ant.spec b/ant.spec index 02eda74..481fd7b 100644 --- a/ant.spec +++ b/ant.spec @@ -43,6 +43,8 @@ Patch3: reproducible-build-date.patch # PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest 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 BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -391,6 +393,7 @@ find -name \*.jar -print -delete %patch3 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/reproducible-propertyfile-task.patch b/reproducible-propertyfile-task.patch new file mode 100644 index 0000000..c3a6c20 --- /dev/null +++ b/reproducible-propertyfile-task.patch @@ -0,0 +1,21 @@ +--- apache-ant-1.10.14/src/main/org/apache/tools/ant/util/DateUtils.java 2023-09-11 14:41:39.980341631 +0200 ++++ apache-ant-1.10.14/src/main/org/apache/tools/ant/util/DateUtils.java 2023-09-11 14:46:43.779148231 +0200 +@@ -227,6 +227,10 @@ + */ + public static String getDateForHeader() { + Calendar cal = Calendar.getInstance(); ++ if (System.getenv("SOURCE_DATE_EPOCH") != null) { ++ cal.setTimeZone(TimeZone.getTimeZone("UTC")); ++ cal.setTime(new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")))); ++ } + TimeZone tz = cal.getTimeZone(); + int offset = tz.getOffset(cal.get(Calendar.ERA), + cal.get(Calendar.YEAR), +@@ -247,6 +251,7 @@ + } + tzMarker.append(minutes); + synchronized (DATE_HEADER_FORMAT_INT) { ++ DATE_HEADER_FORMAT_INT.setTimeZone(tz); + return DATE_HEADER_FORMAT_INT.format(cal.getTime()) + tzMarker.toString(); + } + }