From 5d69569e0d821d613d343f3bea17ef43b8256bc5 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Wed, 12 Aug 2015 14:11:12 +0200 Subject: [PATCH] Reproducible ocaml-source package (Closes: #779086) Patch from Chris Lamb. --- debian/rules | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.30.2