Source: autogen
Version: 1:5.18.6~pre3-3
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: cpu locale timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that autogen could not be built reproducibly.

The attached patch fixes the following issues:
* run time of ./configure affects a preprocessor constant
* locale-dependant sort
* timezone-dependant date

Once applied, and after pdftex is fixed [2], autogen will be buildable
reproducibly in our current experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds
 [2]:
https://wiki.debian.org/ReproducibleBuilds/TimestampsInPDFGeneratedByLaTeX

Regards,
Valentin
diff -ru autogen-5.18.6~pre3.orig/autoopts/tpl/agman-cmd.tpl autogen-5.18.6~pre3/autoopts/tpl/agman-cmd.tpl
--- autogen-5.18.6~pre3.orig/autoopts/tpl/agman-cmd.tpl	2015-08-05 09:18:53.539284309 +0000
+++ autogen-5.18.6~pre3/autoopts/tpl/agman-cmd.tpl	2015-08-07 18:05:30.000000000 +0000
@@ -33,7 +33,7 @@
 (define head-line (lambda()
         (sprintf ".TH %s %s \"%s\" \"%s\" \"%s\"\n.\\\"\n"
                 (get "prog-name") man-sect
-        (shell "date '+%d %b %Y'") package-text section-name) ))
+        (shell "LC_ALL=C date -u '+%d %b %Y' -d @$SOURCE_DATE_EPOCH ") package-text section-name) ))
 
 (define man-page #t)
 (out-push-new)                              :+][+:
diff -ru autogen-5.18.6~pre3.orig/autoopts/tpl/agman-file.tpl autogen-5.18.6~pre3/autoopts/tpl/agman-file.tpl
--- autogen-5.18.6~pre3.orig/autoopts/tpl/agman-file.tpl	2015-08-05 09:18:53.539284309 +0000
+++ autogen-5.18.6~pre3/autoopts/tpl/agman-file.tpl	2015-08-07 18:05:30.000000000 +0000
@@ -31,7 +31,7 @@
 (define head-line (lambda()
         (sprintf ".TH %s %s \"%s\" \"%s\" \"%s\"\n.\\\"\n"
                 (get "prog-name") man-sect
-        (shell "date '+%d %b %Y'") package-text section-name) ))
+        (shell "LC_ALL=C date -u '+%d %b %Y' -d @$SOURCE_DATE_EPOCH ") package-text section-name) ))
 
 (define man-page #t)
 
diff -ru autogen-5.18.6~pre3.orig/configure.ac autogen-5.18.6~pre3/configure.ac
--- autogen-5.18.6~pre3.orig/configure.ac	2015-08-05 09:18:53.555284310 +0000
+++ autogen-5.18.6~pre3/configure.ac	2015-08-07 16:34:39.000000000 +0000
@@ -33,7 +33,6 @@
 AC_LIBTOOL_WIN32_DLL    m4_define(AC_PROVIDE_AC_LIBTOOL_WIN32_DLL)
 AC_PROG_LIBTOOL
 ifdef([AC_REVISION],AC_REVISION($Revision: 4.34 $),)dnl
-[config_start_time=`date +%s 2>/dev/null`]
 # ----------------------------------------------------------------------
 # Substitute VERSION vars here, so that they can be used by the Makefile
 # ----------------------------------------------------------------------
@@ -178,17 +177,11 @@
 fi
 M4_SRC=`cd $srcdir/config ; echo [a-z]*.m4`
 ENABLE_STATIC=${enable_static}
-config_end_time=`date +%s 2>/dev/null`
-time_delta=`expr ${config_end_time} - ${config_start_time} 2>/dev/null`
 
-if test -z "${time_delta}"
-then time_delta=10
-elif test ${time_delta} -lt 5
-then time_delta=5 ; fi
-
-AG_TIMEOUT=${time_delta}
+ag_timeout=10
+AG_TIMEOUT=${ag_timeout}
 ]
-AC_DEFINE_UNQUOTED(AG_DEFAULT_TIMEOUT, ${time_delta},
+AC_DEFINE_UNQUOTED(AG_DEFAULT_TIMEOUT, ${ag_timeout},
                    [define to suitable timeout limit for shell command])
 AC_SUBST(M4_SRC)
 AC_SUBST(AGnam)
diff -ru autogen-5.18.6~pre3.orig/debian/rules autogen-5.18.6~pre3/debian/rules
--- autogen-5.18.6~pre3.orig/debian/rules	2015-08-05 09:18:53.527284309 +0000
+++ autogen-5.18.6~pre3/debian/rules	2015-08-07 18:14:15.654037956 +0000
@@ -3,8 +3,10 @@
 export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed
 export DEB_CFLAGS_MAINT_APPEND := -Wall -Wno-format-contains-nul
 # Used by 10_libopts_tarball_perms.diff
+export LC_COLLATE=C
+export LC_ALL=C
 export BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
-DATECHLOG := $(shell date -d '$(BUILD_DATE)' +%Y-%m-%d)
+DATECHLOG := $(shell date -u -d '$(BUILD_DATE)' +%Y-%m-%d)
 
 override_dh_auto_configure:
 	dh_auto_configure --verbose -- \
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to