[Reproducible-builds] Bug#793696: joe: please make the mtimes reproducible

Maria Valentina Marin marivalenm at gmail.com
Sun Jul 26 17:36:03 UTC 2015


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


-------------- next part --------------
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 <marivalenm at 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
-------------- 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/1c6c58b9/attachment.sig>


More information about the Reproducible-builds mailing list