Source: git
Version: 1:2.7.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps fileordering
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that git could not be built reproducibly.
Build timestamps are embedded into generated documentation files, gzip
headers of manpages and other files. It also generates unsorted md5sums
and tclIndex files.

The attached patch fixes those issues.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/diff/0014-remove-update-label-in-footer.diff b/debian/diff/0014-remove-update-label-in-footer.diff
new file mode 100644
index 0000000..5fab8f1
--- /dev/null
+++ b/debian/diff/0014-remove-update-label-in-footer.diff
@@ -0,0 +1,11 @@
+--- a/Documentation/Makefile
++++ b/Documentation/Makefile
+@@ -98,7 +98,7 @@
+ # DESTDIR =
+ 
+ ASCIIDOC = asciidoc
+-ASCIIDOC_EXTRA =
++ASCIIDOC_EXTRA = --attribute footer-style=none
+ ASCIIDOC_HTML = xhtml11
+ ASCIIDOC_DOCBOOK = docbook
+ ASCIIDOC_CONF = -f asciidoc.conf
diff --git a/debian/diff/0015-sort-tcl-files.diff b/debian/diff/0015-sort-tcl-files.diff
new file mode 100644
index 0000000..3bf3a20
--- /dev/null
+++ b/debian/diff/0015-sort-tcl-files.diff
@@ -0,0 +1,20 @@
+--- a/git-gui/Makefile
++++ b/git-gui/Makefile
+@@ -18,7 +18,7 @@
+ SCRIPT_SH = git-gui.sh
+ GITGUI_MAIN := git-gui
+ GITGUI_BUILT_INS = git-citool
+-ALL_LIBFILES = $(wildcard lib/*.tcl)
++ALL_LIBFILES = $(sort $(wildcard lib/*.tcl))
+ PRELOAD_FILES = lib/class.tcl
+ NONTCL_LIBFILES = \
+ 	lib/git-gui.ico \
+@@ -252,7 +252,7 @@
+ lib/tclIndex: $(ALL_LIBFILES) GIT-GUI-VARS
+ 	$(QUIET_INDEX)if echo \
+ 	  $(foreach p,$(PRELOAD_FILES),source $p\;) \
+-	  auto_mkindex lib '*.tcl' \
++	  auto_mkindex lib $(subst lib/,,$(ALL_LIBFILES)) \
+ 	| $(TCL_PATH) $(QUIET_2DEVNULL); then : ok; \
+ 	else \
+ 	 echo >&2 "    * $(TCL_PATH) failed; using unoptimized loading"; \
diff --git a/debian/implicit b/debian/implicit
index 269168f..6c27b60 100644
--- a/debian/implicit
+++ b/debian/implicit
@@ -33,7 +33,7 @@ deb-checkuid:
 	    debian/$*/usr/share/doc/$*/changelog'
 	@test -s debian/$*/usr/share/doc/$*/changelog || \
 	  sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog'
-	@gzip -9 debian/$*/usr/share/doc/$*/changelog*
+	@gzip -9n debian/$*/usr/share/doc/$*/changelog*
 %.deb-docs-docs: %.deb-docs-base
 	@for i in `cat debian/$*.docs 2>/dev/null || :`; do \
 	  if test -d $$i; then \
@@ -53,7 +53,7 @@ deb-checkuid:
 	@if test -r debian/$*.NEWS.Debian; then \
 	  sh -cx 'install -m0644 debian/$*.NEWS.Debian \
 	    debian/$*/usr/share/doc/$*/NEWS.Debian && \
-	      gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \
+	      gzip -9n debian/$*/usr/share/doc/$*/NEWS.Debian'; \
 	fi
 %.deb-docs-examples: %.deb-docs-docs
 	@rm -rf debian/$*/usr/share/doc/$*/examples
@@ -104,7 +104,7 @@ deb-checkuid:
 	: debian/$*/DEBIAN/md5sums
 	@rm -f debian/$*/DEBIAN/md5sums
 	@cd debian/$* && find * -path 'DEBIAN' -prune -o \
-	  -type f -exec md5sum {} >>DEBIAN/md5sums \;
+	  -type f -exec md5sum {} \; | LC_ALL=C sort >>DEBIAN/md5sums
 	@chmod 0644 debian/$*/DEBIAN/md5sums
 	@test -s debian/$*/DEBIAN/md5sums || \
 	  rm -f debian/$*/DEBIAN/md5sums
diff --git a/debian/rules b/debian/rules
index 61c735b..9378878 100755
--- a/debian/rules
+++ b/debian/rules
@@ -203,7 +203,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	done
 	rm -f '$(GIT)'-man/usr/share/man/man3/Git::SVN*.3pm
 	chmod 0644 '$(GIT)'-man/usr/share/man/man?/*.[0-9]*
-	gzip -9 '$(GIT)'-man/usr/share/man/man?/*.[0-9]*
+	gzip -9n '$(GIT)'-man/usr/share/man/man?/*.[0-9]*
 	# git-doc
 	rm -rf '$(GIT)'-doc
 	# don't include git-p4 man page
@@ -219,7 +219,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	  install -d -m0755 '$(GIT)'-$$i/usr/share/man/man1 && \
 	  install -m0644 '$(TMP)'/usr/share/man/man1/git-$$i* \
 	    '$(GIT)'-$$i/usr/share/man/man1/ && \
-	  gzip -9 '$(GIT)'-$$i/usr/share/man/man1/*.1 || exit 1; \
+	  gzip -9n '$(GIT)'-$$i/usr/share/man/man1/*.1 || exit 1; \
 	done
 	install -d -m0755 '$(GIT)'-svn/usr/share/perl5/Git
 	cp -R '$(TMP)'/usr/share/perl5/Git/SVN* \
@@ -229,7 +229,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	install -d -m0755 '$(GIT)'-svn/usr/share/man/man3
 	install -m 0644 '$(TMP)'/usr/share/man/man3/Git::SVN*.3pm \
 	  '$(GIT)'-svn/usr/share/man/man3/
-	gzip -9 '$(GIT)'-svn/usr/share/man/man3/*.3pm
+	gzip -9n '$(GIT)'-svn/usr/share/man/man3/*.3pm
 	# git-cvs
 	install -d -m0755 '$(GIT)'-cvs/usr/bin
 	install -m0755 '$(TMP)'/usr/bin/git-cvsserver '$(GIT)'-cvs/usr/bin/
@@ -241,7 +241,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	install -d -m0755 '$(GIT)'-arch/usr/share/man/man1
 	install -m0644 '$(TMP)'/usr/share/man/man1/git-archimport.1 \
 	  '$(GIT)'-arch/usr/share/man/man1/
-	gzip -9 '$(GIT)'-arch/usr/share/man/man1/*.1
+	gzip -9n '$(GIT)'-arch/usr/share/man/man1/*.1
 	# git-mediawiki
 	rm -rf '$(GIT)'-mediawiki
 	install -d -m0755 '$(GIT)'-mediawiki/usr/share/perl5/Git
@@ -260,7 +260,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	install -d -m0755 '$(GIT)'-email/usr/share/man/man1
 	install -m0644 '$(TMP)'/usr/share/man/man1/git-send-email.1 \
 	  '$(GIT)'-email/usr/share/man/man1/
-	gzip -9 '$(GIT)'-email/usr/share/man/man1/*.1
+	gzip -9n '$(GIT)'-email/usr/share/man/man1/*.1
 	# git-daemon-run
 	rm -rf '$(GIT)'-daemon-run
 	install -d -m0755 '$(GIT)'-daemon-run/etc/sv/git-daemon/log
@@ -313,7 +313,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	  install -m0644 '$(TMP)'/usr/share/man/man1/git-$$i* \
 	    '$(GIT)'-gui/usr/share/man/man1/; \
 	done
-	gzip -9 '$(GIT)'-gui/usr/share/man/man1/*.1
+	gzip -9n '$(GIT)'-gui/usr/share/man/man1/*.1
 	install -d -m0755 '$(GIT)'-gui/usr/share/git-gui
 	cp -a '$(TMP)'/usr/share/git-gui/lib '$(GIT)'-gui/usr/share/git-gui/
 	# gitk
@@ -324,7 +324,7 @@ install-indep: build-arch-stamp build-indep-stamp
 	install -d -m0755 '$(GIT)'k/usr/share/man/man1
 	install -m0644 '$(TMP)'/usr/share/man/man1/gitk.1 \
 	  '$(GIT)'k/usr/share/man/man1/
-	gzip -9 '$(GIT)'k/usr/share/man/man1/*.1
+	gzip -9n '$(GIT)'k/usr/share/man/man1/*.1
 	install -d -m0755 '$(GIT)'k/usr/share/gitk
 	cp -a '$(TMP)'/usr/share/gitk/lib '$(GIT)'k/usr/share/gitk/
 	# gitweb

Attachment: signature.asc
Description: PGP 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