[Reproducible-builds] Bug#792974: liblockfile: please make the build reproducible

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


Source: liblockfile
Version: 1.09-6
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 liblockfile 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 -Nru liblockfile-1.09/debian/changelog liblockfile-1.09/debian/changelog
--- liblockfile-1.09/debian/changelog	2013-06-02 11:46:21.000000000 +0200
+++ liblockfile-1.09/debian/changelog	2015-07-14 17:12:57.000000000 +0200
@@ -1,3 +1,10 @@
+liblockfile (1.09-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marivalenm at gmail.com>  Tue, 14 Jul 2015 17:12:23 +0200
+
 liblockfile (1.09-6) unstable; urgency=low
 
   * Merge 1.09-5ubuntu1
diff -Nru liblockfile-1.09/debian/rules liblockfile-1.09/debian/rules
--- liblockfile-1.09/debian/rules	2012-06-13 13:26:39.000000000 +0200
+++ liblockfile-1.09/debian/rules	2015-07-14 17:12:20.000000000 +0200
@@ -20,6 +20,8 @@
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 build-arch:	config.status
 	$(checkdir)
 	make
@@ -68,6 +70,8 @@
 	$(do_md5sums)
 	dpkg-shlibdeps liblockfile.so
 	dpkg-gencontrol -pliblockfile1 -P$(tmp) -isp
+	find $(tmp) -newermt '$(BUILD_DATE)' -print0 | \
+		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg --build $(tmp) ..
 	#
 	#	Build liblockfile-bin
@@ -97,6 +101,8 @@
 	$(do_md5sums)
 	dpkg-shlibdeps dotlockfile
 	dpkg-gencontrol -pliblockfile-bin -P$(tmp) -isp
+	find $(tmp) -newermt '$(BUILD_DATE)' -print0 | \
+		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg --build $(tmp) ..
 	#
 	#	Build liblockfile-dev
@@ -132,6 +138,8 @@
 		$(tmp)/usr/share/doc/liblockfile-dev/copyright
 	$(do_md5sums)
 	dpkg-gencontrol -pliblockfile-dev -P$(tmp) -isp
+	find $(tmp) -newermt '$(BUILD_DATE)' -print0 | \
+		xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
 	dpkg --build $(tmp) ..
 
 


More information about the Reproducible-builds mailing list