[Reproducible-builds] Bug#788000: libranlip: please make the build reproducible
Dhole
dhole at openmailbox.org
Sun Jun 7 16:06:11 UTC 2015
Source: libranlip
Version: 1.0-4.1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
Hi!
While working on the “reproducible builds” effort [1], we have noticed
that libranlip could not be built reproducibly.
The attached patch removes extra timestamps from the gzip files and
sets the files mtime to a known value (last debian package changelog
date) before calling `dpkg --build` to generate the binary packages.
Once applied, libranlip can be built reproducibly in our current
experimental framework.
[1]: https://wiki.debian.org/ReproducibleBuilds
--
Dhole
-------------- next part --------------
diff --git a/libranlip-1.0/Makefile.in b/libranlip-1.0/Makefile.in
index df35f5d..8225ad4 100644
--- a/libranlip-1.0/Makefile.in
+++ b/libranlip-1.0/Makefile.in
@@ -409,7 +409,7 @@ am__remove_distdir = \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
-GZIP_ENV = --best
+GZIP_ENV = --best -n
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
diff --git a/libranlip-1.0/debian/rules b/libranlip-1.0/debian/rules
index 6ca7323..9f389e3 100755
--- a/libranlip-1.0/debian/rules
+++ b/libranlip-1.0/debian/rules
@@ -3,6 +3,7 @@
# Copyright (c) 2005 Juan Esteban Monsalve Tobon <esteban at v7w.com>
STRIP = strip --remove-section=.comment --remove-section=.note
+BUILD_DATE=$(shell dpkg-parsechangelog --show-field Date)
build:
$(checkdir)
@@ -54,7 +55,7 @@ binary-arch: checkroot build
cp -p debian/changelog debian/libranlip1c2/usr/share/doc/libranlip1c2/changelog.Debian
cp -p docs/ranlip.ps debian/libranlip1c2/usr/share/doc/libranlip1c2/
cp -p examples/ranliptest* examples/makefile debian/libranlip1c2/usr/share/doc/libranlip1c2/examples
- cd debian/libranlip1c2/usr/share/doc/libranlip1c2 && gzip -9 changelog.Debian ranlip.ps examples/*
+ cd debian/libranlip1c2/usr/share/doc/libranlip1c2 && gzip -9n changelog.Debian ranlip.ps examples/*
ln -s libranlip1c2 debian/libranlip-dev/usr/share/doc/libranlip-dev
@@ -64,6 +65,8 @@ binary-arch: checkroot build
chown -R root.root debian/libranlip1c2
chmod -x debian/libranlip1c2/usr/lib/ranlip/*
chmod -R go=rX debian/libranlip1c2
+ find debian/libranlip1c2 -depth -newermt '$(BUILD_DATE)' -print0 | \
+ xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
dpkg --build debian/libranlip1c2 ..
dpkg-gencontrol -isp -plibranlip-dev -Pdebian/libranlip-dev
@@ -71,6 +74,8 @@ binary-arch: checkroot build
chown -R root.root debian/libranlip-dev
chmod -x debian/libranlip-dev/usr/lib/ranlip/libranlip.a debian/libranlip-dev/usr/lib/ranlip/libranlip.la
chmod -R go=rX debian/libranlip-dev
+ find debian/libranlip-dev -depth -newermt '$(BUILD_DATE)' -print0 | \
+ xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
dpkg --build debian/libranlip-dev ..
define checkdir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150607/ba3ef078/attachment.sig>
More information about the Reproducible-builds
mailing list