[Reproducible-builds] Bug#793701: markdown: please make the mtimes reproducible

Maria Valentina Marin marivalenm at gmail.com
Sun Jul 26 17:39:45 UTC 2015


Source: markdown
Version: 1.0.1-7
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 markdown 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.

Cheers,
akira

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

-------------- next part --------------
diff -u markdown-1.0.1/debian/rules markdown-1.0.1/debian/rules
--- markdown-1.0.1/debian/rules
+++ markdown-1.0.1/debian/rules
@@ -2,6 +2,8 @@
 
 binary: binary-indep
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
+
 binary-arch:
 
 binary-indep:
@@ -26,6 +28,8 @@
 
 	install -d debian/tmp/DEBIAN
 	dpkg-gencontrol -isp
+	find debian/tmp -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+		xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
 	dpkg-deb --build debian/tmp ..
 
 build: build-indep
diff -u markdown-1.0.1/debian/changelog markdown-1.0.1/debian/changelog
--- markdown-1.0.1/debian/changelog
+++ markdown-1.0.1/debian/changelog
@@ -1,3 +1,10 @@
+markdown (1.0.1-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marivalenm at gmail.com>  Fri, 24 Jul 2015 13:01:18 +0200
+
 markdown (1.0.1-7) unstable; urgency=low
 
   * Add a Homepage field.
-------------- 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/0de4eb28/attachment.sig>


More information about the Reproducible-builds mailing list