Source: openstack-doc-tools
Version: 0.16.1-2
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 Debian's “reproducible builds” effort [1], we have
noticed that openstack-doc-tools doesn't build reproducibly.
It embeds the current date into the manpage.

The attached patch fixes this by using the last changelog date
as a timestamp that will be embedded.

Regards,
 Reiner

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

diff --git a/debian/rules b/debian/rules
index 8485e5a..52723b4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,9 @@ include /usr/share/openstack-pkg-tools/pkgos.make
 
 export OSLO_PACKAGE_VERSION=$(VERSION)
 
+export LAST_CHANGE=$(shell dpkg-parsechangelog -S Date)
+export BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
+
 %:
 	dh $@ --buildsystem=python_distutils --with python2,sphinxdoc
 
@@ -18,12 +21,12 @@ override_dh_clean:
 
 override_dh_sphinxdoc:
 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
-	sphinx-build -b html doc/source $(CURDIR)/debian/python-openstack-doc-tools/usr/share/doc/python-openstack-doc-tools/html
+	sphinx-build -D today="$(BUILD_DATE)" -b html doc/source $(CURDIR)/debian/python-openstack-doc-tools/usr/share/doc/python-openstack-doc-tools/html
 	dh_sphinxdoc -O--buildsystem=python_distutils
 endif
 
 override_dh_installman:
 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
-	sphinx-build -b man doc/source doc/build/man
+	sphinx-build -D today="$(BUILD_DATE)" -b man doc/source doc/build/man
 	dh_installman -O--buildsystem=python_distutils
 endif

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