Source: lpe
Version: 1.2.7-2
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

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

The attached patch sets the mtimes of all files which are modified
during the built to the date of the last changelog entry in order to
produce files with reproducible metadata. Please also consider this
other bug from the reproducible builds team:
https://bugs.debian.org/778197

Cheers,
akira

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

diff -Nru lpe-1.2.7/debian/changelog lpe-1.2.7/debian/changelog
--- lpe-1.2.7/debian/changelog  2014-12-24 20:37:25.000000000 +0100
+++ lpe-1.2.7/debian/changelog  2015-07-24 11:23:27.000000000 +0200
@@ -1,3 +1,10 @@
+lpe (1.2.7-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marival...@gmail.com>  Fri, 24 Jul 2015 11:23:16 +0200
+
 lpe (1.2.7-2) unstable; urgency=medium
 
   * Fix an off-by-1 buffer overflow. (closes: #773818)
diff -Nru lpe-1.2.7/debian/rules lpe-1.2.7/debian/rules
--- lpe-1.2.7/debian/rules      2014-06-23 21:41:06.000000000 +0200
+++ lpe-1.2.7/debian/rules      2015-07-24 11:23:13.000000000 +0200
@@ -13,6 +13,8 @@
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 
-SDate)" +%s)
+
 default: build
 
 config: config-stamp
@@ -97,6 +99,8 @@
        cd ${PKGDIR} >/dev/null ;\
         find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > 
DEBIAN/md5sums
 ## Build the binary package
+       find ${PKGDIR} -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+               xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
        dpkg --build ${PKGDIR} ..
 
 binary-indep:

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
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