[Reproducible-builds] Bug#793699: mailfront: please make the mtimes reproducible

Maria Valentina Marin marivalenm at gmail.com
Sun Jul 26 17:38:25 UTC 2015


Source: mailfront
Version: 1.16-1
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 mailfront 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/777431

Cheers,
akira

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

-------------- next part --------------
diff -u mailfront-1.16/debian/changelog mailfront-1.16/debian/changelog
--- mailfront-1.16/debian/changelog
+++ mailfront-1.16/debian/changelog
@@ -1,3 +1,10 @@
+mailfront (1.16-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marivalenm at gmail.com>  Fri, 24 Jul 2015 12:13:18 +0200
+
 mailfront (1.16-1) unstable; urgency=low
 
   * new upstream version.
diff -u mailfront-1.16/debian/rules mailfront-1.16/debian/rules
--- mailfront-1.16/debian/rules
+++ mailfront-1.16/debian/rules
@@ -10,6 +10,8 @@
 
 DIR =$(shell pwd)/debian/mailfront
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
+
 patch: deb-checkdir patch-stamp
 patch-stamp:
 	for i in `ls -1 debian/diff/*.diff || :`; do \
@@ -89,6 +91,8 @@
 binary-arch: deb-checkdir deb-checkuid install-stamp mailfront.deb
 	dpkg-shlibdeps '$(DIR)'/usr/sbin/*
 	dpkg-gencontrol -isp -pmailfront -P'$(DIR)'
+	find '$(DIR)' -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+		xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
 	dpkg -b '$(DIR)' ..
 
 .PHONY: patch configure build clean install binary-indep binary-arch binary
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150726/31cc8422/attachment.sig>


More information about the Reproducible-builds mailing list