From 37a0c5dacbd0f5aa98ea7390de81c4f99e843a98 Mon Sep 17 00:00:00 2001 From: Carlos Maddela Date: Mon, 19 Dec 2016 09:45:38 +1100 Subject: [PATCH] Make builds reproducible. Use the Debian changelog details to derive a build number and date, so that we can make reproducible binaries. --- .../patches/14-make-builds-reproducible.patch | 32 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 33 insertions(+) create mode 100644 debian/patches/14-make-builds-reproducible.patch diff --git a/debian/patches/14-make-builds-reproducible.patch b/debian/patches/14-make-builds-reproducible.patch new file mode 100644 index 0000000..772a827 --- /dev/null +++ b/debian/patches/14-make-builds-reproducible.patch @@ -0,0 +1,32 @@ +From: Carlos Maddela +Date: Mon, 19 Dec 2016 09:39:49 +1100 +Subject: Make builds reproducible. + +Description: Make builds reproducible. + Use the Debian changelog details to derive a build number and date, + so that we can make reproducible binaries. +Author: Carlos Maddela +Origin: vendor +Forwarded: not-needed +Last-Update: 2016-12-19 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- + scripts/time-stamper.bash | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/time-stamper.bash b/scripts/time-stamper.bash +index fd28794..60fe91a 100755 +--- a/scripts/time-stamper.bash ++++ b/scripts/time-stamper.bash +@@ -1,7 +1,7 @@ + #!/usr/bin/env bash + +-build=$(grep BUILD $1 | cut -d\ -f3) +-build=$((build+1)) ++# Use Debian changelog details to derive build number and date. ++build=$(dpkg-parsechangelog -S Version | sed 's/.*-\([0-9]\+\).*/\1/') + echo "#define BUILD $build" >$1 +-date=$(date +"%d.%m.%y (%A, %H:%M)") ++date=$(date --date="$(dpkg-parsechangelog -S Date)" +"%d.%m.%y (%A, %H:%M)") + echo "#define BDATE \"$date\"" >>$1 diff --git a/debian/patches/series b/debian/patches/series index e96cd1f..9d16cd7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,3 +10,4 @@ 11-no-cruft.patch 12-fix-spelling-of-up-to.patch 13-fix-missing-language-field-in-po-files.patch +14-make-builds-reproducible.patch