Source: luakit
Version: 2012.09.13-r1-4
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps
X-Debbugs-Cc: [email protected]

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that luakit 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.

Cheers,
akira

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


diff -Nru luakit-2012.09.13-r1/debian/changelog 
luakit-2012.09.13-r1/debian/changelog
--- luakit-2012.09.13-r1/debian/changelog       2015-05-26 03:46:14.000000000 
+0200
+++ luakit-2012.09.13-r1/debian/changelog       2015-07-14 21:45:24.000000000 
+0200
@@ -1,3 +1,9 @@
+luakit (2012.09.13-r1-5) UNRELEASED; urgency=medium
+
+  * Fix mtimes before building binary packages to produce reproducible output 
+
+ -- akira <[email protected]>  Tue, 14 Jul 2015 21:45:01 +0200
+
 luakit (2012.09.13-r1-4) unstable; urgency=medium
 
   * Patch from Chris Lamb to make the build reproducible.
diff -Nru luakit-2012.09.13-r1/debian/rules luakit-2012.09.13-r1/debian/rules
--- luakit-2012.09.13-r1/debian/rules   2015-05-26 03:45:48.000000000 +0200
+++ luakit-2012.09.13-r1/debian/rules   2015-07-14 21:43:50.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)
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 STRIP=strip
 
 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
@@ -81,6 +83,8 @@
        chmod a-x debian/$(package)/usr/share/luakit/lib/lousy/*.lua
        chown -R root:root debian/$(package)
        chmod -R go=rX debian/$(package)
+       find debian/luakit -newermt '$(BUILD_DATE)' -print0 | \
+               xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 
        dpkg --build debian/$(package) ..
 

Reply via email to