Source: trscripts
Version: 1.16
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 trscripts 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/776927

Cheers,
akira

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

diff -Nru trscripts-1.16/debian/changelog trscripts-1.16+nmu1/debian/changelog
--- trscripts-1.16/debian/changelog     2009-05-02 12:56:35.000000000 +0200
+++ trscripts-1.16+nmu1/debian/changelog        2015-07-26 19:19:58.000000000 
+0200
@@ -1,3 +1,10 @@
+trscripts (1.16+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marival...@gmail.com>  Sun, 26 Jul 2015 19:19:40 +0200
+
 trscripts (1.16) unstable; urgency=low
 
   * Use question mark as DEFAULT_CHAR
diff -Nru trscripts-1.16/debian/rules trscripts-1.16+nmu1/debian/rules
--- trscripts-1.16/debian/rules 2009-05-02 12:51:28.000000000 +0200
+++ trscripts-1.16+nmu1/debian/rules    2015-07-26 19:19:38.000000000 +0200
@@ -22,6 +22,8 @@
 
 package=trscripts
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 
-SDate)" +%s)
+
 build:
        $(checkdir)
        $(MAKE)
@@ -57,6 +59,8 @@
        dpkg-gencontrol -isp
        chown -R root.root debian/tmp
        chmod -R go=rX,u=rwX debian/tmp
+       find debian/tmp -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+               xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
        dpkg --build debian/tmp ..
 
 define checkdir

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