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

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 <marival...@gmail.com>  Fri, 24 Jul 2015 13:01:18 +0200
+
 markdown (1.0.1-7) unstable; urgency=low
 
   * Add a Homepage field.

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