Source: runit
Version: 2.1.2-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 runit 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 runit-2.1.2/debian/changelog runit-2.1.2/debian/changelog
--- runit-2.1.2/debian/changelog
+++ runit-2.1.2/debian/changelog
@@ -1,3 +1,10 @@
+runit (2.1.2-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output 
+
+ -- akira <marival...@gmail.com>  Wed, 15 Jul 2015 17:10:54 +0200
+
 runit (2.1.2-3) unstable; urgency=medium
 
   * workaround #766187 by copying from sysvinit-2.88dsf:
diff -u runit-2.1.2/debian/rules runit-2.1.2/debian/rules
--- runit-2.1.2/debian/rules
+++ runit-2.1.2/debian/rules
@@ -12,6 +12,8 @@
 CPPFLAGS =$(shell DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
   dpkg-buildflags --get CPPFLAGS)
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 DEB_HOST_GNU_TYPE =$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE =$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
@@ -144,6 +146,8 @@
        test '$(CC)' != 'gcc' || \
          dpkg-shlibdeps '$(DIR)'/usr/sbin/* '$(DIR)'/usr/bin/*
        dpkg-gencontrol -isp -prunit -P'$(DIR)'
+       find '$(DIR)' -newermt '$(BUILD_DATE)' -print0 | \
+               xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
        dpkg -b '$(DIR)' ..
 
 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