Source: markdown
Version: 1.0.1-7
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps
X-Debbugs-Cc: [email protected]

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 <[email protected]>  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

Reply via email to