Source: socklog
Version: 2.1.0-8
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 socklog 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. Please also consider this
other bug from the reproducible builds team:
https://bugs.debian.org/777419

Cheers,
akira

[1]: https://wiki.debian.org/ReproducibleBuilds

diff -u socklog-2.1.0/debian/changelog socklog-2.1.0/debian/changelog
--- socklog-2.1.0/debian/changelog
+++ socklog-2.1.0/debian/changelog
@@ -1,3 +1,10 @@
+socklog (2.1.0-8.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output
+
+ -- akira <marival...@gmail.com>  Sun, 26 Jul 2015 10:21:24 +0200
+
 socklog (2.1.0-8) unstable; urgency=low
 
   * debian/diff/socklog-conf-update-service.diff: new; refer to
diff -u socklog-2.1.0/debian/rules socklog-2.1.0/debian/rules
--- socklog-2.1.0/debian/rules
+++ socklog-2.1.0/debian/rules
@@ -15,6 +15,8 @@
 
 DIR =$(shell pwd)/debian/socklog
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 
-SDate)" +%s)
+
 build: deb-checkdir build-arch-stamp build-indep-stamp
 
 build-arch: deb-checkdir build-arch-stamp
@@ -91,10 +93,14 @@
        test '$(CC)' != 'gcc' || \
          dpkg-shlibdeps '$(DIR)'/usr/bin/* '$(DIR)'/usr/sbin/*
        dpkg-gencontrol -isp -psocklog -P'$(DIR)' 
+       find '$(DIR)' -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+               xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
        dpkg -b '$(DIR)' ..
 
 binary-indep: deb-checkdir deb-checkuid install-indep socklog-run.deb
        dpkg-gencontrol -isp -psocklog-run -P'$(DIR)'-run
+       find '$(DIR)'-run -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+               xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
        dpkg -b '$(DIR)'-run ..
 
 binary: binary-indep binary-arch

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