[Glibc-bsd-commits] r5981 - trunk/freebsd-utils/debian

stevenc-guest at alioth.debian.org stevenc-guest at alioth.debian.org
Mon Apr 4 11:19:37 UTC 2016


Author: stevenc-guest
Date: 2016-04-04 11:19:37 +0000 (Mon, 04 Apr 2016)
New Revision: 5981

Modified:
   trunk/freebsd-utils/debian/changelog
   trunk/freebsd-utils/debian/rules
Log:
Make get-orig-source tarball reproducible


Modified: trunk/freebsd-utils/debian/changelog
===================================================================
--- trunk/freebsd-utils/debian/changelog	2016-04-04 10:55:13 UTC (rev 5980)
+++ trunk/freebsd-utils/debian/changelog	2016-04-04 11:19:37 UTC (rev 5981)
@@ -2,6 +2,7 @@
 
   * New upstream snapshot of 10.3-RC3
   * Use XZ to compress orig source tarball
+  * Make get-orig-source tarball reproducible
 
  -- Steven Chamberlain <steven at pyro.eu.org>  Mon, 04 Apr 2016 11:16:07 +0100
 

Modified: trunk/freebsd-utils/debian/rules
===================================================================
--- trunk/freebsd-utils/debian/rules	2016-04-04 10:55:13 UTC (rev 5980)
+++ trunk/freebsd-utils/debian/rules	2016-04-04 11:19:37 UTC (rev 5981)
@@ -45,6 +45,7 @@
 SOURCE = freebsd-utils
 ORIGDIR = $(SOURCE)-$(tar_version)
 TARNAME = $(SOURCE)_$(tar_version).orig.tar.xz
+SOURCE_DATE_EPOCH ?= $(shell date -d "$$(dpkg-parsechangelog -SDate)" +%s)
 
 PATH := /usr/lib/freebsd:$(PATH)
 DESTDIR = $(CURDIR)/debian/tmp
@@ -151,7 +152,16 @@
 	; do \
 	    svn export --ignore-keywords -r $(svn_revision) $(SVN)/$$i $(ORIGDIR)/src/$$i || exit ; \
 	done
-	tar --numeric-owner --owner 0 --group 0 -cJf ../$(TARNAME) $(ORIGDIR)
+	# Clamp timestamps to be no newer than last changelog entry, see
+	# https://wiki.debian.org/ReproducibleBuilds/TimestampsInTarball
+	find $(ORIGDIR) -newermt "@$(SOURCE_DATE_EPOCH)" -print0 \
+	 | xargs -0r touch --no-dereference --date="@$(SOURCE_DATE_EPOCH)"
+	# Create tarball with files sorted in a stable order, see
+	# https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs
+	find $(ORIGDIR) -print0 | LC_ALL=C sort -z \
+	 | tar --null --no-recursion --files-from - \
+	    --numeric-owner --owner 0 --group 0 \
+	    -cJf ../$(TARNAME)
 	rm -rf $(ORIGDIR)
 
 build-arch: build-deb build-udeb




More information about the Glibc-bsd-commits mailing list