Source: ocaml Version: 4.01.0-5 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: hostname X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org
Hi, While working on the "reproducible builds" effort [1], we have noticed that ocaml could not be built reproducibly. The attached patch removes user and groups from the build system. Once this patch--and the patch in #779037 is applied--ocaml can be built reproducibly in our toolchain. [1]: https://wiki.debian.org/ReproducibleBuilds Regards, -- ,''`. : :' : Chris Lamb `. `'` la...@debian.org / chris-lamb.co.uk `-
diff -urNad ocaml.orig/ocaml-4.01.0/debian/rules ocaml/ocaml-4.01.0/debian/rules --- ocaml.orig/ocaml-4.01.0/debian/rules 2015-02-24 00:24:10.791265556 +0000 +++ ocaml/ocaml-4.01.0/debian/rules 2015-02-24 00:38:39.254090440 +0000 @@ -38,6 +38,8 @@ TESTDIR := debian/test-build TESTRULES := debian/rules DEB_TEST_BUILD_PREFIX=$(CURDIR)/$(TESTDIR) +BUILD_DATE := $(shell dpkg-parsechangelog --show-field=Date) + ifeq (,$(DEB_TEST_BUILD_PREFIX)) ifneq (,$(findstring ocaml-source,$(ALL_PACKAGES))) TARBALL_TARGET = debian/$(SRCTARBALL) @@ -112,7 +114,11 @@ # Copy debian/patches cp -a debian/patches debian/$(DISTDIR)/debian-patches # Create the tarball and cleanup - tar -C debian -cf $@ $(DISTDIR) + cd debian && find $(DISTDIR) -not -type d -print0 | \ + LC_ALL=C sort --zero-terminated | \ + tar --create --null --files-from=- \ + --file=$(abspath $@) --mtime="$(BUILD_DATE)" \ + --owner=root --group=root --numeric-owner rm -Rf debian/$(DISTDIR) endif