Source: apt-dater
Version: 1.0.2-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps
X-Debbugs-Cc: [email protected]
Hi,
There are two issues with the handling of SOURCE_DATE_EPOCH that
cause this package to remain reproducible:
* Missing LC_ALL=C (or LC_TIME, etc.) in src/Makefile.am
otherwise the formatted string is translated to the current
locale.
* Missing "shell" in the nested call to dpkg-parsechangelog, which
actually results in SOURCE_DATE_EPOCH being set to midnight of the
current day, then mangled by the *inverse* of the current timezone
offset relative to UTC. It's quite a fun chain if you follow it..
A patch for these two issues is attached.
You might also want to fix:
* Assignment of SOURCE_DATE_EPOCH in debian/rules overrides
environment, ie. prefer the the set-if-absent operaor.
- SOURCE_DATE_EPOCH := $(shell [..]
+ SOURCE_DATE_EPOCH ?= $(shell [..]
.. otherwise, an external value of SOURCE_DATE_EPOCH is not
honoured.
* As it happens It's actually not required that you set this line.
Debian's default toolchain will export it soon anyway, and our
experimental toolchain does it already.
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
--- a/debian/control 2015-08-28 14:49:42.917162383 +0100
--- b/debian/control 2015-08-28 15:07:49.757226351 +0100
@@ -3,6 +3,7 @@
Priority: optional
Maintainer: Patrick Matthäi <[email protected]>
Build-Depends: debhelper (>= 9),
+ dh-autoreconf,
libpopt-dev,
libglib2.0-dev,
libncursesw5-dev,
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000
+0100
--- b/debian/patches/reproducible-build.patch 2015-08-28 16:20:43.940164287
+0100
@@ -0,0 +1,11 @@
+--- apt-dater-1.0.2.orig/src/Makefile.am
++++ apt-dater-1.0.2/src/Makefile.am
+@@ -51,7 +51,7 @@ endif
+
+ apt_dater_LDADD = $(GLIB_LIBS) $(TCL_LIBS) $(LIBXML2_LIBS) $(GIO_LIBS)
+
+-AM_CFLAGS = -Wall -DPKGLIBDIR='"'$(pkglibdir)'"' -DSOURCE_DATE_UTC="\"$(shell
date -d @$(SOURCE_DATE_EPOCH) -u)\""
++AM_CFLAGS = -Wall -DPKGLIBDIR='"'$(pkglibdir)'"' -DSOURCE_DATE_UTC="\"$(shell
LC_ALL=C date -d \@$(SOURCE_DATE_EPOCH) -u)\""
+ if LINUX
+ AM_LDFLAGS = -Wl,--as-needed
+ else
--- a/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series 2015-08-28 15:00:13.010353347 +0100
@@ -0,0 +1 @@
+reproducible-build.patch
--- a/debian/rules 2015-08-28 14:49:42.917162383 +0100
--- b/debian/rules 2015-08-28 16:24:34.229943740 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
-SOURCE_DATE_EPOCH := $(shell date -d "$(dpkg-parsechangelog --count 1 -SDate)"
+%s)
+SOURCE_DATE_EPOCH := $(shell date -d "$(shell dpkg-parsechangelog --count 1
-SDate)" +%s)
DEB_CONFIGURE_EXTRA_FLAGS := \
--enable-tclfilter \
@@ -12,7 +12,7 @@
--enable-tmux
%:
- dh $@
+ dh $@ --with autoreconf
override_dh_auto_configure:
dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)