From: Stephane Glondu Date: Wed, 12 Aug 2015 12:11:12 +0000 (+0200) Subject: Reproducible ocaml-source package (Closes: #779086) X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~137 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5d69569e0d821d613d343f3bea17ef43b8256bc5;p=ocaml.git Reproducible ocaml-source package (Closes: #779086) Patch from Chris Lamb. --- diff --git a/debian/rules b/debian/rules index 095e1921..b29587ae 100755 --- a/debian/rules +++ b/debian/rules @@ -38,6 +38,8 @@ SRCTARBALL = $(PACKAGE)-source-$(OCAML_ABI).tar 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) @@ -110,7 +112,11 @@ $(TARBALL_TARGET): $(UPSTREAM_TARBALL) # 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