Source: bcron
Version: 0.10-3
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 bcron 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 bcron-0.10/debian/changelog bcron-0.10/debian/changelog
--- bcron-0.10/debian/changelog
+++ bcron-0.10/debian/changelog
@@ -1,3 +1,10 @@
+bcron (0.10-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marival...@gmail.com>  Thu, 16 Jul 2015 20:45:09 +0200
+
 bcron (0.10-3) unstable; urgency=medium
 
   * debian/control: Revert bcron-run: Provides:, Replaces:, Conflicts:
diff -u bcron-0.10/debian/rules bcron-0.10/debian/rules
--- bcron-0.10/debian/rules
+++ bcron-0.10/debian/rules
@@ -26,6 +26,8 @@
        done
        touch patch-stamp
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 build: deb-checkdir build-arch-stamp build-indep-stamp
 
 build-arch: deb-checkdir build-arch-stamp
@@ -111,10 +113,14 @@
        test '$(CC)' != 'gcc' || \
          dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/*
        dpkg-gencontrol -isp -pbcron -P'$(DIR)'
+       find '$(DIR)' -newermt '$(BUILD_DATE)' -print0 | \
+               xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
        dpkg -b '$(DIR)' ..
 
 binary-indep: deb-checkdir deb-checkuid install-indep bcron-run.deb
        dpkg-gencontrol -isp -pbcron-run -P'$(DIR)'-run
+       find '$(DIR)'-run -newermt '$(BUILD_DATE)' -print0 | \
+               xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
        dpkg -b '$(DIR)'-run ..
 
 binary: binary-indep binary-arch
_______________________________________________
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