Source: skytools3
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps fileordering

Hi!

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

The attached patch removes extra timestamps from the documentation generated
by Asciidoc and Epydoc and also ensure a stable file order when linking object
files into executables. 
Once applied, all binary packages can be built reproducibly in our
current experimental framework.

Thanks for considering the patch.
Best regards
Sascha

[1]: https://wiki.debian.org/ReproducibleBuilds
diff -Nru skytools3-3.2.6/debian/changelog skytools3-3.2.6/debian/changelog
--- skytools3-3.2.6/debian/changelog	2016-01-14 20:49:10.000000000 +0000
+++ skytools3-3.2.6/debian/changelog	2016-06-14 21:37:01.000000000 +0000
@@ -1,3 +1,10 @@
+skytools3 (3.2.6-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Make build reproducible.
+
+ -- Sascha Steinbiss <sas...@steinbiss.name>  Tue, 14 Jun 2016 21:36:51 +0000
+
 skytools3 (3.2.6-4) unstable; urgency=medium
 
   * Build for PostgreSQL 9.5.
diff -Nru skytools3-3.2.6/debian/patches/reproducible.patch skytools3-3.2.6/debian/patches/reproducible.patch
--- skytools3-3.2.6/debian/patches/reproducible.patch	1970-01-01 00:00:00.000000000 +0000
+++ skytools3-3.2.6/debian/patches/reproducible.patch	2016-06-15 12:50:15.000000000 +0000
@@ -0,0 +1,39 @@
+Description: make build reproducible
+ This patch makes the build reproducible by adjusting the build system to
+ use stable sorting order for file traversal as well as remove timestamps from
+ Asciidoc footers and HTML documentation created by Epydoc.
+Author: Sascha Steinbiss <sas...@steinbiss.name>
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -5,7 +5,7 @@
+ 
+ EPYDOC = epydoc
+ EPYARGS = --no-private --url="http://pgfoundry.org/projects/skytools/"; \
+-	--name="Skytools" --html --no-private -v
++	--name="Skytools" --html --no-private --no-include-build-time -v
+ 
+ TOPHTML = README.html INSTALL.html index.html
+ DOCHTML = \
+@@ -40,6 +40,7 @@
+ 
+ #AFLAGS = -a linkcss
+ #AFLAGS = -a stylesheet=extra.css
++AFLAGS += -s
+ 
+ all: $(FQMAN)
+ 
+--- a/lib/mk/amext-libusual.mk
++++ b/lib/mk/amext-libusual.mk
+@@ -17,10 +17,10 @@
+ _USUAL_DIR = $(call JoinPath,$(srcdir),$(USUAL_DIR))
+ 
+ # module names from sources (plus headers)
+-UsualMods = $(trace1)$(shell $(_USUAL_DIR)/find_modules.sh $(_USUAL_DIR) $(wildcard $(addprefix $(srcdir)/,$(1))))
++UsualMods = $(trace1)$(shell $(_USUAL_DIR)/find_modules.sh $(_USUAL_DIR) $(sort $(wildcard $(addprefix $(srcdir)/,$(1)))))
+ 
+ # full-path sources based on module list
+-UsualSrcsFull = $(trace1)$(wildcard $(addprefix $(_USUAL_DIR)/usual/,$(addsuffix *.[ch],$(1))))
++UsualSrcsFull = $(trace1)$(sort $(wildcard $(addprefix $(_USUAL_DIR)/usual/,$(addsuffix *.[ch],$(1)))))
+ 
+ # remove USUAL_DIR
+ UsualStrip = $(trace1)$(subst $(_USUAL_DIR)/,,$(1))
diff -Nru skytools3-3.2.6/debian/patches/series skytools3-3.2.6/debian/patches/series
--- skytools3-3.2.6/debian/patches/series	2016-01-14 20:49:10.000000000 +0000
+++ skytools3-3.2.6/debian/patches/series	2016-06-14 21:36:13.000000000 +0000
@@ -1,2 +1,3 @@
 tests-invalid-echo.patch
 tests-ticker-missing-installcheck.patch
+reproducible.patch
diff -Nru skytools3-3.2.6/debian/rules skytools3-3.2.6/debian/rules
--- skytools3-3.2.6/debian/rules	2016-01-14 20:49:10.000000000 +0000
+++ skytools3-3.2.6/debian/rules	2016-06-15 12:17:21.000000000 +0000
@@ -3,6 +3,8 @@
 SRCDIR      = $(CURDIR)
 PKGVERS     = $(shell dpkg-parsechangelog | awk -F '[:-]' '/^Version:/ { print substr($$2, 2) }')
 ORIG_EXCLUDE=--exclude-vcs --exclude=debian
+export LC_ALL=C
+export LANG=C
 
 include /usr/share/postgresql-common/pgxs_debian_control.mk
 
_______________________________________________
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to