[Reproducible-builds] Bug#793704: mimefilter: please make the mtimes reproducible

Maria Valentina Marin marivalenm at gmail.com
Sun Jul 26 17:41:32 UTC 2015


Source: mimefilter
Version: 1.7+nmu1
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 mimefilter 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/777486

Cheers,
akira

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

-------------- next part --------------
diff -Nru mimefilter-1.7+nmu1/debian/changelog mimefilter-1.7+nmu2/debian/changelog
--- mimefilter-1.7+nmu1/debian/changelog	2012-05-17 11:24:33.000000000 +0200
+++ mimefilter-1.7+nmu2/debian/changelog	2015-07-24 14:04:18.000000000 +0200
@@ -1,3 +1,10 @@
+mimefilter (1.7+nmu2) 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 14:02:41 +0200
+
 mimefilter (1.7+nmu1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru mimefilter-1.7+nmu1/debian/rules mimefilter-1.7+nmu2/debian/rules
--- mimefilter-1.7+nmu1/debian/rules	2012-05-17 11:24:33.000000000 +0200
+++ mimefilter-1.7+nmu2/debian/rules	2015-07-24 14:02:36.000000000 +0200
@@ -35,6 +35,8 @@
 DFILES	:=	debian/README debian/conffiles debian/copyright \
 		debian/preinst debian/postinst debian/prerm debian/postrm
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
+
 # WARNING: debian/rules SHOULD NOT be in $(DFILES), for Debian policy
 # (it's CVS registered), lest it will be deleted by clean.
 # Beside, it's automatically remade by make
@@ -99,6 +101,8 @@
 	dpkg-gencontrol -isp
 	chown -R root.root $(tmp)
 	chmod -R go=rX $(tmp)
+	find $(tmp) -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+		xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
 	dpkg --build $(tmp) ..
 
 checkdir = test -f debian/rules
-------------- 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/4ba2498a/attachment.sig>


More information about the Reproducible-builds mailing list