[Reproducible-builds] Bug#793720: sgmltools-lite: please make the mtimes reproducible

Maria Valentina Marin marivalenm at gmail.com
Sun Jul 26 17:51:18 UTC 2015


Source: sgmltools-lite
Version: 3.0.3.0.cvs.20010909-17
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that sgmltools-lite 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/777011

Cheers,
akira

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

-------------- next part --------------
diff -u sgmltools-lite-3.0.3.0.cvs.20010909/debian/rules sgmltools-lite-3.0.3.0.cvs.20010909/debian/rules
--- sgmltools-lite-3.0.3.0.cvs.20010909/debian/rules
+++ sgmltools-lite-3.0.3.0.cvs.20010909/debian/rules
@@ -9,6 +9,8 @@
 PKGMANDIR=$(PKGDIR)/usr/share/man/$(PKG)
 DBIMAGEDIR=usr/share/sgml/docbook/stylesheet/dsssl/modular/images/
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
+
 configure: configure-stamp
 configure-stamp:
 	sh debian/common/checkdir.sh
@@ -141,6 +143,8 @@
 	dpkg-gencontrol -isp -P$(PKGDIR)
 	(cd $(PKGDIR) >/dev/null && find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum >DEBIAN/md5sums)
 	if [ -z $(PKGDIR)/DEBIAN/md5sums ]; then rm -f $(PKGDIR)/DEBIAN/md5sums; else chmod 644 $(PKGDIR)/DEBIAN/md5sums; chown 0.0 $(PKGDIR)/DEBIAN/md5sums; fi
+	find $(PKGDIR) -newermt "@$$SOURCE_DATE_EPOCH" -print0 | \
+		xargs -0r touch --no-dereference --date="@$$SOURCE_DATE_EPOCH"
 
 	dpkg --build $(PKGDIR) ../
 
diff -u sgmltools-lite-3.0.3.0.cvs.20010909/debian/changelog sgmltools-lite-3.0.3.0.cvs.20010909/debian/changelog
--- sgmltools-lite-3.0.3.0.cvs.20010909/debian/changelog
+++ sgmltools-lite-3.0.3.0.cvs.20010909/debian/changelog
@@ -1,3 +1,10 @@
+sgmltools-lite (3.0.3.0.cvs.20010909-18) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix mtimes before building binary packages to produce reproducible output 
+
+ -- akira <marivalenm at gmail.com>  Sun, 26 Jul 2015 09:43:37 +0200
+
 sgmltools-lite (3.0.3.0.cvs.20010909-17) unstable; urgency=low
 
   * QA upload.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150726/c7ecddc6/attachment.sig>


More information about the Reproducible-builds mailing list