Source: fakeroot
Version: 1.20.2-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps fileordering
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

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

The attached patch removes build time from the output package by setting
the mtime of all files to the time of the last changelog entry. Once
applied, fakeroot can be built reproducibly in our current experimental
framework.

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

Regards,
Val
diff -ru fakeroot-1.20.2.old/debian/rules fakeroot-1.20.2/debian/rules
--- fakeroot-1.20.2.old/debian/rules	2014-10-05 15:16:07.000000000 +0000
+++ fakeroot-1.20.2/debian/rules	2015-08-17 13:26:00.484760799 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/make -f
 
+BUILD_DATE = $(shell dpkg-parsechangelog -SDate)
 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
@@ -150,6 +151,7 @@
 	chown root:root debian/fakeroot/DEBIAN/control debian/libfakeroot/DEBIAN/control
 	cd debian/fakeroot && find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums
 	cd debian/libfakeroot && find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums
+	find debian/ -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg-deb --build debian/fakeroot ..
 	dpkg-deb --build debian/libfakeroot ..
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to