Accepting request 622155 from home:bmwiedemann:branches:server:database

Add reproducible.patch to have fixed hostname and date (boo#1047218)

OBS-URL: https://build.opensuse.org/request/show/622155
OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=115
This commit is contained in:
Lars Vogdt 2018-07-24 20:21:02 +00:00 committed by Git OBS Bridge
parent 529ee26e96
commit e3855be043
3 changed files with 58 additions and 0 deletions

View File

@ -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

View File

@ -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

50
reproducible.patch Normal file
View File

@ -0,0 +1,50 @@
https://github.com/antirez/redis/pull/4390
From 8832af49fa1f4fdd8f9e152f013bb71b343d26dd Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
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" <bwiedemann@suse.de>
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