Source: cgoban
Version: 1.9.14-17
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 cgoban 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. Once applied, cgoban can be
built reproducibly in our current experimental framework.


Cheers,
akira

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



diff -Nru cgoban-1.9.14/debian/changelog cgoban-1.9.14/debian/changelog
--- cgoban-1.9.14/debian/changelog      2012-05-06 20:31:51.000000000 +0200
+++ cgoban-1.9.14/debian/changelog      2015-07-14 11:33:04.000000000 +0200
@@ -1,3 +1,11 @@
+cgoban (1.9.14-17.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible
+    output
+
+ -- akira <marival...@gmail.com>  Tue, 14 Jul 2015 11:32:08 +0200
+
 cgoban (1.9.14-17) unstable; urgency=low
 
   * Fixed crash on maximization, closes: #387209.
diff -Nru cgoban-1.9.14/debian/rules cgoban-1.9.14/debian/rules
--- cgoban-1.9.14/debian/rules  2012-05-06 20:31:30.000000000 +0200
+++ cgoban-1.9.14/debian/rules  2015-07-14 14:34:19.000000000 +0200
@@ -3,6 +3,8 @@
 testdir  = test -f src/goBoard.c && test -f debian/rules
 testroot = test x`whoami` = xroot
 
+BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
+
 # FOR AUTOCONF 2.52 AND NEWER ONLY
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
        CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
@@ -72,6 +74,8 @@
        dpkg-shlibdeps debian/cgoban/usr/games/cgoban
        dpkg-gencontrol -isp -pcgoban -Pdebian/cgoban
        chmod -R u+w,go=u-w debian/cgoban
+       find debian/cgoban -newermt '$(BUILD_DATE)' -print0 | \
+               xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
        dpkg --build debian/cgoban ..
 
 .PHONY: clean binary binary-arch binary-indep
_______________________________________________
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