Source: ratfor
Version: 1.0-15
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 ratfor 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/778204

Cheers,
akira

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

diff -u ratfor-1.0/debian/changelog ratfor-1.0/debian/changelog
--- ratfor-1.0/debian/changelog
+++ ratfor-1.0/debian/changelog
@@ -1,3 +1,10 @@
+ratfor (1.0-15.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marival...@gmail.com>  Sat, 25 Jul 2015 14:06:22 +0200
+
 ratfor (1.0-15) unstable; urgency=low
   * Fix bashism in debian/rules (closes: bug#535417)
  -- Alan Bain <af...@debian.org>  Thu, 30 Jul 2009 21:13:02 +0100
diff -u ratfor-1.0/debian/rules ratfor-1.0/debian/rules
--- ratfor-1.0/debian/rules
+++ ratfor-1.0/debian/rules
@@ -23,7 +23,7 @@
    INSTALL_PROGRAM += -s
 endif
 
-
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 
-SDate)" +%s)
 
 build:  
        $(checkdir)
@@ -77,6 +77,8 @@
        dh_md5sums --tmpdir=debian/tmp
        chown -R root.root debian/tmp                                           
        chmod -R go-ws 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