Source: console-cyrillic
Version: 0.9-16.2
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 console-cyrillic 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 console-cyrillic-0.9/debian/changelog 
console-cyrillic-0.9/debian/changelog
--- console-cyrillic-0.9/debian/changelog
+++ console-cyrillic-0.9/debian/changelog
@@ -1,3 +1,10 @@
+console-cyrillic (0.9-16.3) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <[email protected]>  Fri, 17 Jul 2015 16:29:06 +0200
+
 console-cyrillic (0.9-16.2) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u console-cyrillic-0.9/debian/rules console-cyrillic-0.9/debian/rules
--- console-cyrillic-0.9/debian/rules
+++ console-cyrillic-0.9/debian/rules
@@ -14,6 +14,8 @@
 
 kazakh=debian/binary/console-kazakh-0.2b
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 debian/binary.tar.gz.uu:
        $(checkdir)
        cd debian && tar cf - binary | gzip -9 | uuencode binary.tar.gz 
>binary.tar.gz.uu
@@ -140,6 +142,8 @@
        dpkg-gencontrol -isp
        chown -R root.root debian/tmp
        chmod -R go=rX,u=rwX debian/tmp
+       find debian/tmp -newermt '$(BUILD_DATE)' -print0 | \
+               xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
        dpkg --build debian/tmp ..
 
 binary-arch:   checkroot build

Reply via email to