diff --git a/ant-antlr.changes b/ant-antlr.changes index e380e8c..745e6af 100644 --- a/ant-antlr.changes +++ b/ant-antlr.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Oct 21 08:08:23 UTC 2018 - antoine.belvire@opensuse.org + +- Add reproducible-build-manifest.patch: Use less detailed version + string for manifest's "Created-by" field (boo#1110024). + ------------------------------------------------------------------- Wed Oct 17 19:40:22 UTC 2018 - Fridrich Strba diff --git a/ant-antlr.spec b/ant-antlr.spec index 561846c..242ed1e 100644 --- a/ant-antlr.spec +++ b/ant-antlr.spec @@ -42,6 +42,8 @@ Patch5: apache-ant-bootstrap.patch #PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates Patch6: reproducible-build-date.patch Patch7: ant-python3.patch +# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest +Patch8: reproducible-build-manifest.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -342,6 +344,7 @@ find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT// %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant-junit.changes b/ant-junit.changes index e380e8c..745e6af 100644 --- a/ant-junit.changes +++ b/ant-junit.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Oct 21 08:08:23 UTC 2018 - antoine.belvire@opensuse.org + +- Add reproducible-build-manifest.patch: Use less detailed version + string for manifest's "Created-by" field (boo#1110024). + ------------------------------------------------------------------- Wed Oct 17 19:40:22 UTC 2018 - Fridrich Strba diff --git a/ant-junit.spec b/ant-junit.spec index 98e9cd8..29062ed 100644 --- a/ant-junit.spec +++ b/ant-junit.spec @@ -42,6 +42,8 @@ Patch5: apache-ant-bootstrap.patch #PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates Patch6: reproducible-build-date.patch Patch7: ant-python3.patch +# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest +Patch8: reproducible-build-manifest.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -342,6 +344,7 @@ find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT// %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/ant.changes b/ant.changes index e380e8c..745e6af 100644 --- a/ant.changes +++ b/ant.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Oct 21 08:08:23 UTC 2018 - antoine.belvire@opensuse.org + +- Add reproducible-build-manifest.patch: Use less detailed version + string for manifest's "Created-by" field (boo#1110024). + ------------------------------------------------------------------- Wed Oct 17 19:40:22 UTC 2018 - Fridrich Strba diff --git a/ant.spec b/ant.spec index 98d4dd1..071456b 100644 --- a/ant.spec +++ b/ant.spec @@ -41,6 +41,8 @@ Patch5: apache-ant-bootstrap.patch #PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates Patch6: reproducible-build-date.patch Patch7: ant-python3.patch +# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest +Patch8: reproducible-build-manifest.patch BuildRequires: antlr-bootstrap BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -341,6 +343,7 @@ find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT// %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # clean jar files find . -name "*.jar" -print -delete diff --git a/reproducible-build-manifest.patch b/reproducible-build-manifest.patch new file mode 100644 index 0000000..5f02a6c --- /dev/null +++ b/reproducible-build-manifest.patch @@ -0,0 +1,32 @@ +Use Java major version for manifest's Created-by + +No need of detailed version such java.vm.version. Java's jar command +uses java.version when it fills the manifest's "Created-by" field, +let's make ant do the same. + +Using a detailed version makes that every Java release triggers a +new publication for ant-based applications, only because a line in +manifest has changed - not because the binary or dependencies have +changed. Using a less detailed version reduces these publications. + +Using a less detailed version also prevents more subtle problems +such as in boo#1110024: noarch packages differ depending on the +builder architecture, when Java vm version contains an architecture +information (which is the case for openSUSE, though it's probably +not relevant). + +-- +--- a/src/main/org/apache/tools/ant/taskdefs/Manifest.java ++++ b/src/main/org/apache/tools/ant/taskdefs/Manifest.java +@@ -816,10 +816,7 @@ public class Manifest { + try { + insr = new InputStreamReader(in, "UTF-8"); + Manifest defaultManifest = new Manifest(insr); +- String version = System.getProperty("java.runtime.version"); +- if (version == null) { +- version = System.getProperty("java.vm.version"); +- } ++ String version = System.getProperty("java.version"); + Attribute createdBy = new Attribute("Created-By", + version + " (" + + System.getProperty("java.vm.vendor") + ")");