[Reproducible-builds] Bug#792996: bcron : please make the build reproducible

Maria Valentina Marin marivalenm at gmail.com
Mon Jul 20 11:50:11 UTC 2015


Source: bcron
Version: 0.10-3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Hi!

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



-------------- next part --------------
diff -u bcron-0.10/debian/changelog bcron-0.10/debian/changelog
--- bcron-0.10/debian/changelog
+++ bcron-0.10/debian/changelog
@@ -1,3 +1,10 @@
+bcron (0.10-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marivalenm at gmail.com>  Thu, 16 Jul 2015 20:45:09 +0200
+
 bcron (0.10-3) unstable; urgency=medium
 
   * debian/control: Revert bcron-run: Provides:, Replaces:, Conflicts:
diff -u bcron-0.10/debian/rules bcron-0.10/debian/rules
--- bcron-0.10/debian/rules
+++ bcron-0.10/debian/rules
@@ -26,6 +26,8 @@
 	done
 	touch patch-stamp
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 build: deb-checkdir build-arch-stamp build-indep-stamp
 
 build-arch: deb-checkdir build-arch-stamp
@@ -111,10 +113,14 @@
 	test '$(CC)' != 'gcc' || \
 	  dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/*
 	dpkg-gencontrol -isp -pbcron -P'$(DIR)'
+	find '$(DIR)' -newermt '$(BUILD_DATE)' -print0 | \
+		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg -b '$(DIR)' ..
 
 binary-indep: deb-checkdir deb-checkuid install-indep bcron-run.deb
 	dpkg-gencontrol -isp -pbcron-run -P'$(DIR)'-run
+	find '$(DIR)'-run -newermt '$(BUILD_DATE)' -print0 | \
+		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg -b '$(DIR)'-run ..
 
 binary: binary-indep binary-arch


More information about the Reproducible-builds mailing list