Source: joe
Version: 3.7-2.4
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 joe 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/777726

Cheers,
akira

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


diff -u joe-3.7/debian/changelog joe-3.7/debian/changelog
--- joe-3.7/debian/changelog
+++ joe-3.7/debian/changelog
@@ -1,3 +1,11 @@
+joe (3.7-4) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marival...@gmail.com>  Thu, 23 Jul 2015 10:05:04 +0200
+
 joe (3.7-2.4) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u joe-3.7/debian/rules joe-3.7/debian/rules
--- joe-3.7/debian/rules
+++ joe-3.7/debian/rules
@@ -8,6 +8,8 @@
 CFLAGS += -O2
 endif
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 
-SDate)" +%s)
+
 build: config.status joe
 
 config.status: configure
@@ -59,6 +61,8 @@
        dpkg-gencontrol -P$(tmp) -isp
        chown -R root.root $(tmp)
        chmod -R go=rX,u+rw,a-s $(tmp)
+       find $(tmp) -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+               xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
        dpkg-deb --build $(tmp) ..
 
 checkroot: 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