diff --git a/redis.changes b/redis.changes index 0d46b08..2a22b44 100644 --- a/redis.changes +++ b/redis.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 11 17:08:01 UTC 2018 - bwiedemann@suse.com + +- Add reproducible.patch to have fixed hostname and date (boo#1047218) + ------------------------------------------------------------------- Fri Jun 15 10:17:06 UTC 2018 - mrueckert@suse.de diff --git a/redis.spec b/redis.spec index c8e4edd..138fc97 100644 --- a/redis.spec +++ b/redis.spec @@ -39,6 +39,7 @@ Patch0: %{name}-initscript.patch Patch1: %{name}-conf.patch Patch2: %{name}-enable-bactrace-on-x86-ia64-and_arm32_only.patch Patch3: %{name}-disable_integration_logging.patch +Patch4: reproducible.patch BuildRequires: pkgconfig BuildRequires: procps BuildRequires: tcl @@ -64,8 +65,10 @@ different kind of sorting abilities. # We have no backtrace, so disable logging test %patch3 -p0 %endif +%patch4 -p1 %build +export HOST=OBS # for reproducible builds make %{?_smp_mflags} CFLAGS="%{optflags}" V=1 %install diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..858d2a7 --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,50 @@ +https://github.com/antirez/redis/pull/4390 + +From 8832af49fa1f4fdd8f9e152f013bb71b343d26dd Mon Sep 17 00:00:00 2001 +From: "Bernhard M. Wiedemann" +Date: Sun, 22 Oct 2017 05:20:38 +0200 +Subject: [PATCH 1/2] Use RELEASENOTES date instead of build date + +in order to make builds reproducible. +See https://reproducible-builds.org/ for why this is good. +--- + src/mkreleasehdr.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/mkreleasehdr.sh b/src/mkreleasehdr.sh +index 1ae95886b4a..c48156cf3dd 100755 +--- a/src/mkreleasehdr.sh ++++ b/src/mkreleasehdr.sh +@@ -1,7 +1,7 @@ + #!/bin/sh + GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1` + GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l` +-BUILD_ID=`uname -n`"-"`date +%s` ++BUILD_ID=`uname -n`"-"`date -r ../00-RELEASENOTES +%s` + test -f release.h || touch release.h + (cat release.h | grep SHA1 | grep $GIT_SHA1) && \ + (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already up-to-date + +From 96c1ddd8ad5b6f0f437011efef090e837a41f8e8 Mon Sep 17 00:00:00 2001 +From: "Bernhard M. Wiedemann" +Date: Wed, 11 Jul 2018 18:52:06 +0200 +Subject: [PATCH 2/2] Allow to override hostname + +to make builds reproducible. +--- + src/mkreleasehdr.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/mkreleasehdr.sh b/src/mkreleasehdr.sh +index c48156cf3dd..39cf37d3378 100755 +--- a/src/mkreleasehdr.sh ++++ b/src/mkreleasehdr.sh +@@ -1,7 +1,7 @@ + #!/bin/sh + GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1` + GIT_DIRTY=`git diff --no-ext-diff 2> /dev/null | wc -l` +-BUILD_ID=`uname -n`"-"`date -r ../00-RELEASENOTES +%s` ++BUILD_ID=${HOST:-`uname -n`}"-"`date -r ../00-RELEASENOTES +%s` + test -f release.h || touch release.h + (cat release.h | grep SHA1 | grep $GIT_SHA1) && \ + (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already up-to-date