Package: sahara
Version: 2015.1.0-4
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that sahara could not be built reproducibly.

The attached patch removes extra timestamps from the build system.
Once applied, sahara can be built reproducibly in our current
experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds
diff -urNp sahara-2015.1.0.old/debian/rules sahara-2015.1.0/debian/rules
--- sahara-2015.1.0.old/debian/rules	2015-05-30 11:53:19.000000000 -0300
+++ sahara-2015.1.0/debian/rules	2015-06-12 20:56:56.682825917 -0300
@@ -5,6 +5,10 @@ PYTHONS:=$(shell pyversions -vr)
 include /usr/share/openstack-pkg-tools/pkgos.make
 export OSLO_PACKAGE_VERSION=$(VERSION)
 
+LAST_CHANGE = $(shell dpkg-parsechangelog -S Date)
+BUILD_DATE  = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
+SPHINXOPTS := -D html_last_updated_fmt="$(BUILD_DATE)"
+
 %:
 	dh $@ --buildsystem=python_distutils --with python2,sphinxdoc,systemd
 
@@ -15,13 +19,13 @@ endif
 
 override_dh_sphinxdoc:
 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
-	PYTHONPATH=. sphinx-build -b html doc/source $(CURDIR)/debian/sahara-doc/usr/share/doc/sahara-doc/html
+	PYTHONPATH=. sphinx-build $(SPHINXOPTS) -b html doc/source $(CURDIR)/debian/sahara-doc/usr/share/doc/sahara-doc/html
 	dh_sphinxdoc -O--buildsystem=python_distutils
 endif
 
 override_dh_installman:
 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
-	PYTHONPATH=. sphinx-build -b man doc/source doc/build/man
+	PYTHONPATH=. sphinx-build $(SPHINXOPTS) -b man doc/source doc/build/man
 	dh_installman -O--buildsystem=python_distutils
 endif
 

Reply via email to