Source: mimefilter
Version: 1.7+nmu1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@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

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 <marival...@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

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to