diff --git a/ant-antlr.changes b/ant-antlr.changes
index 0003ef0..bb66eec 100644
--- a/ant-antlr.changes
+++ b/ant-antlr.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Mon May 8 20:05:59 UTC 2017 - bwiedemann@suse.com
+
+- Version bump to 1.9.9:
+ * Read WHATSNEW file for full changelist
+
+-------------------------------------------------------------------
+Mon May 8 07:43:51 UTC 2017 - bwiedemann@suse.de
+
+- Add reproducible.patch to allow reproducible builds of ant itself
+ and packages built with ant like jcodings
+
-------------------------------------------------------------------
Mon Feb 20 10:12:01 UTC 2017 - tchvatal@suse.com
diff --git a/ant-antlr.spec b/ant-antlr.spec
index 1677120..a07002f 100644
--- a/ant-antlr.spec
+++ b/ant-antlr.spec
@@ -36,7 +36,7 @@
%global major_version 1.9
Name: ant-antlr
-Version: 1.9.6
+Version: 1.9.9
Release: 0
Summary: Antlr Task for ant
License: Apache-2.0
@@ -51,6 +51,8 @@ Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
#PATCH-FIX-SLE: fix building with old gcj by working around bugs
Patch2: apache-ant-old-gcj-build.patch
+#PATCH-FIX-UPSTREAM -- https://bz.apache.org/bugzilla/show_bug.cgi?id=61079
+Patch3: reproducible.patch
%if %{with bootstrap}
BuildRequires: java-1_5_0-gcj-compat-devel
#!BuildIgnore: java-1_6_0-openjdk java-1_6_0-openjdk-devel
@@ -73,6 +75,9 @@ BuildRequires: junit
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
%endif
+%if 0%{?suse_version} > 1320
+BuildRequires: strip-nondeterminism
+%endif
%if %{with bootstrap}
Requires: java-devel >= 1.5.0
Requires: javapackages-tools
@@ -409,6 +414,7 @@ find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
# Fix class-path-in-manifest rpmlint warning
%patch1
+%patch3 -p1
# clean jar files
%{_bindir}/find . -name "*.jar" | %{_bindir}/xargs -t rm
@@ -463,6 +469,7 @@ export BOOTJAVAC_OPTS="-C -Wno-deprecated"
sh -x ./build.sh --noconfig jars
%endif
+%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
diff --git a/ant-junit.changes b/ant-junit.changes
index 0003ef0..bb66eec 100644
--- a/ant-junit.changes
+++ b/ant-junit.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Mon May 8 20:05:59 UTC 2017 - bwiedemann@suse.com
+
+- Version bump to 1.9.9:
+ * Read WHATSNEW file for full changelist
+
+-------------------------------------------------------------------
+Mon May 8 07:43:51 UTC 2017 - bwiedemann@suse.de
+
+- Add reproducible.patch to allow reproducible builds of ant itself
+ and packages built with ant like jcodings
+
-------------------------------------------------------------------
Mon Feb 20 10:12:01 UTC 2017 - tchvatal@suse.com
diff --git a/ant-junit.spec b/ant-junit.spec
index 04ceea9..f58f925 100644
--- a/ant-junit.spec
+++ b/ant-junit.spec
@@ -36,7 +36,7 @@
%global major_version 1.9
Name: ant-junit
-Version: 1.9.6
+Version: 1.9.9
Release: 0
Summary: Optional junit tasks for ant
License: Apache-2.0
@@ -51,6 +51,8 @@ Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
#PATCH-FIX-SLE: fix building with old gcj by working around bugs
Patch2: apache-ant-old-gcj-build.patch
+#PATCH-FIX-UPSTREAM -- https://bz.apache.org/bugzilla/show_bug.cgi?id=61079
+Patch3: reproducible.patch
%if %{with bootstrap}
BuildRequires: java-1_5_0-gcj-compat-devel
#!BuildIgnore: java-1_6_0-openjdk java-1_6_0-openjdk-devel
@@ -73,6 +75,9 @@ BuildRequires: junit
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
%endif
+%if 0%{?suse_version} > 1320
+BuildRequires: strip-nondeterminism
+%endif
%if %{with bootstrap}
Requires: java-devel >= 1.5.0
Requires: javapackages-tools
@@ -409,6 +414,7 @@ find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
# Fix class-path-in-manifest rpmlint warning
%patch1
+%patch3 -p1
# clean jar files
%{_bindir}/find . -name "*.jar" | %{_bindir}/xargs -t rm
@@ -463,6 +469,7 @@ export BOOTJAVAC_OPTS="-C -Wno-deprecated"
sh -x ./build.sh --noconfig jars
%endif
+%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
diff --git a/ant.changes b/ant.changes
index 0003ef0..bb66eec 100644
--- a/ant.changes
+++ b/ant.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Mon May 8 20:05:59 UTC 2017 - bwiedemann@suse.com
+
+- Version bump to 1.9.9:
+ * Read WHATSNEW file for full changelist
+
+-------------------------------------------------------------------
+Mon May 8 07:43:51 UTC 2017 - bwiedemann@suse.de
+
+- Add reproducible.patch to allow reproducible builds of ant itself
+ and packages built with ant like jcodings
+
-------------------------------------------------------------------
Mon Feb 20 10:12:01 UTC 2017 - tchvatal@suse.com
diff --git a/ant.spec b/ant.spec
index 2aa020f..f136daa 100644
--- a/ant.spec
+++ b/ant.spec
@@ -35,7 +35,7 @@
%global major_version 1.9
Name: ant
-Version: 1.9.6
+Version: 1.9.9
Release: 0
Summary: Java-based build tool
License: Apache-2.0
@@ -50,6 +50,8 @@ Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
#PATCH-FIX-SLE: fix building with old gcj by working around bugs
Patch2: apache-ant-old-gcj-build.patch
+#PATCH-FIX-UPSTREAM -- https://bz.apache.org/bugzilla/show_bug.cgi?id=61079
+Patch3: reproducible.patch
%if %{with bootstrap}
BuildRequires: java-1_5_0-gcj-compat-devel
#!BuildIgnore: java-1_6_0-openjdk java-1_6_0-openjdk-devel
@@ -72,6 +74,9 @@ BuildRequires: junit
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
%endif
+%if 0%{?suse_version} > 1320
+BuildRequires: strip-nondeterminism
+%endif
%if %{with bootstrap}
Requires: java-devel >= 1.5.0
Requires: javapackages-tools
@@ -408,6 +413,7 @@ find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
# Fix class-path-in-manifest rpmlint warning
%patch1
+%patch3 -p1
# clean jar files
%{_bindir}/find . -name "*.jar" | %{_bindir}/xargs -t rm
@@ -462,6 +468,7 @@ export BOOTJAVAC_OPTS="-C -Wno-deprecated"
sh -x ./build.sh --noconfig jars
%endif
+%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
diff --git a/apache-ant-1.9.6-src.tar.bz2 b/apache-ant-1.9.6-src.tar.bz2
deleted file mode 100644
index 64bb4f7..0000000
--- a/apache-ant-1.9.6-src.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2ad98dd3a4805452e546e0f5b682360370ae11692a2157fff8ec6d177c957123
-size 3808558
diff --git a/apache-ant-1.9.6-src.tar.bz2.asc b/apache-ant-1.9.6-src.tar.bz2.asc
deleted file mode 100644
index 85fec1a..0000000
--- a/apache-ant-1.9.6-src.tar.bz2.asc
+++ /dev/null
@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1
-
-iEYEABECAAYFAlWQ0NgACgkQohFa4V9ri3IODACdFpgbfaQV8W1WqECEJjwd/W4O
-kqAAmwb7sak1nWioHVp3n8U2/vA89mEi
-=bOy8
------END PGP SIGNATURE-----
diff --git a/apache-ant-1.9.9-src.tar.bz2 b/apache-ant-1.9.9-src.tar.bz2
new file mode 100644
index 0000000..970bc68
--- /dev/null
+++ b/apache-ant-1.9.9-src.tar.bz2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69aa251ffb9f31312c21d67db197843e0b03b3c8cc3e0af6e6e92d98eb0f2ead
+size 3832876
diff --git a/apache-ant-1.9.9-src.tar.bz2.asc b/apache-ant-1.9.9-src.tar.bz2.asc
new file mode 100644
index 0000000..ec60063
--- /dev/null
+++ b/apache-ant-1.9.9-src.tar.bz2.asc
@@ -0,0 +1,7 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1
+
+iEYEABECAAYFAliTeuMACgkQohFa4V9ri3JKrwCfeUXDKRaGVSVPi8pJJdDnh+mz
+UkUAn0TPQC0YCk45FrYkWw42dwzkWcIh
+=veU8
+-----END PGP SIGNATURE-----
diff --git a/reproducible.patch b/reproducible.patch
new file mode 100644
index 0000000..3339385
--- /dev/null
+++ b/reproducible.patch
@@ -0,0 +1,141 @@
+commit 7c6c749c952153170e82b791d97086e99fe2a3cb
+Author: Stefan Bodewig
Since Ant 1.9.10 the magic
++ property ant.tstamp.now
can be used to specify a fixed
++ date value in order to create reproducible builds. Its value must be
++ a number and is interpreted as seconds since the epoch (midnight
++ 1970-01-01).
ant.tstamp.now |
++ number, seconds since the epoch (midnight 1970-01-01) | ++The value to use as current time and date for <tstamp> | ++
+diff --git a/src/main/org/apache/tools/ant/MagicNames.java b/src/main/org/apache/tools/ant/MagicNames.java +index bc39a2578..67ab8a810 100644 +--- a/src/main/org/apache/tools/ant/MagicNames.java ++++ b/src/main/org/apache/tools/ant/MagicNames.java +@@ -289,5 +289,18 @@ public final class MagicNames { + * Value {@value} + */ + public static final String HTTP_AGENT_PROPERTY = "ant.http.agent"; ++ ++ /** ++ * Magic property that can be set to contain a value for tstamp's ++ * "now" in order to make builds that use the task create ++ * reproducible results. ++ * ++ *
The value is expected to be a number representing the date ++ * as seconds since the epoch.
++ * ++ * Value: {@value} ++ * @since Ant 1.9.10 ++ */ ++ public static final String TSTAMP_NOW = "ant.tstamp.now"; + } + +diff --git a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java +index 805427aba..a6a35d7b4 100644 +--- a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java ++++ b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java +@@ -32,6 +32,7 @@ import java.util.Vector; + + import org.apache.tools.ant.BuildException; + import org.apache.tools.ant.Location; ++import org.apache.tools.ant.MagicNames; + import org.apache.tools.ant.Project; + import org.apache.tools.ant.Task; + import org.apache.tools.ant.types.EnumeratedAttribute; +@@ -68,7 +69,7 @@ public class Tstamp extends Task { + */ + public void execute() throws BuildException { + try { +- Date d = new Date(); ++ Date d = getNow(); + + Enumeration i = customFormats.elements(); + while (i.hasMoreElements()) { +@@ -110,6 +111,22 @@ public class Tstamp extends Task { + } + + /** ++ * Return the {@link Date} instance to use as base for DSTAMP, TSTAMP and TODAY. ++ */ ++ protected Date getNow() { ++ String magicNow = getProject().getProperty(MagicNames.TSTAMP_NOW); ++ if (magicNow != null && magicNow.length() > 0) { ++ try { ++ return new Date(1000 * Long.parseLong(magicNow)); ++ } catch (NumberFormatException ex) { ++ log("magic property " + MagicNames.TSTAMP_NOW + " ignored as " ++ + magicNow + " is not a valid number"); ++ } ++ } ++ return new Date(); ++ } ++ ++ /** + * This nested element that allows a property to be set + * to the current date and time in a given format. + * The date/time patterns are as defined in the +diff --git a/src/tests/antunit/taskdefs/tstamp-test.xml b/src/tests/antunit/taskdefs/tstamp-test.xml +new file mode 100644 +index 000000000..c9bebf866 +--- /dev/null ++++ b/src/tests/antunit/taskdefs/tstamp-test.xml +@@ -0,0 +1,27 @@ ++ ++ ++