From 1db3184ca08989bab7a7b7a8b0471af8cec43345f56aa1a8fbf5315d7773cea1 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 6 Aug 2018 12:05:25 +0000 Subject: [PATCH] Accepting request 622825 from home:bmwiedemann:branches:Base:System - Add mkversion.patch to have fixed timestamps (boo#1047218) - Add reproducible.patch to not add timestamps in .gz header https://sourceforge.net/p/x3270/code/merge-requests/1/ gzip -n also via git send-email https://sourceforge.net/p/x3270/code/merge-requests/2/ date=>SDE OBS-URL: https://build.opensuse.org/request/show/622825 OBS-URL: https://build.opensuse.org/package/show/Base:System/x3270?expand=0&rev=45 --- mkversion.patch | 36 ++++++++++++++++++++++++++++++++++++ reproducible.patch | 21 +++++++++++++++++++++ x3270.changes | 6 ++++++ x3270.spec | 8 ++++++++ 4 files changed, 71 insertions(+) create mode 100644 mkversion.patch create mode 100644 reproducible.patch diff --git a/mkversion.patch b/mkversion.patch new file mode 100644 index 0000000..390dac9 --- /dev/null +++ b/mkversion.patch @@ -0,0 +1,36 @@ +commit d2f9fa8d7f59c357449ab2b69141700cb5527135 +Author: Bernhard M. Wiedemann +Date: Sun Jun 18 19:49:43 2017 +0200 + + allow to override build date + + to allow reproducible builds of x3270 + + See https://reproducible-builds.org/ for why this is good + and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. + +diff --git a/Common/mkversion.sh b/Common/mkversion.sh +index f5cd712c..33100743 100755 +--- a/Common/mkversion.sh ++++ b/Common/mkversion.sh +@@ -40,15 +40,17 @@ export LANG LC_ALL + set -e + + . ${2-./version.txt} +-builddate=`date` +-sccsdate=`date +%Y/%m/%d` ++date="date -u" ++[ -n "$SOURCE_DATE_EPOCH" ] && date="$date -d@$SOURCE_DATE_EPOCH" ++builddate=`$date` ++sccsdate=`$date +%Y/%m/%d` + user=${LOGNAME-$USER} + + # Create an all numeric timestamp for rpqnames. + # rpq.c will return this string of numbers in bcd format + # It is OK to change the length (+ or -), but use + # decimal (0-9) digits only. Length must be even number of digits. +-rpq_timestamp=`date +%Y%m%d%H%M%S` ++rpq_timestamp=`$date +%Y%m%d%H%M%S` + + app=${1-x3270} + cat < +Date: Sun Jun 18 19:40:24 2017 +0200 + + Call gzip -n to make build fully reproducible + + See https://reproducible-builds.org/ for why that matters + +diff --git a/x3270/Makefile.obj.in b/x3270/Makefile.obj.in +index 716c7085..de2f8261 100644 +--- a/x3270/Makefile.obj.in ++++ b/x3270/Makefile.obj.in +@@ -82,7 +82,7 @@ x3270: $(OBJS1) $(DEP3270) $(DEP3270I) $(DEP32XX) $(DEP3270STUBS) + $(CC) -o $@ $(OBJS1) $(LDFLAGS) $(LD3270) $(LD3270I) $(LD32XX) $(LD3270STUBS) $(LIBS) + + %.pcf.gz: %.bdf +- bdftopcf $< | gzip >$@ ++ bdftopcf $< | gzip -n9 >$@ + + dryrun: dryrun.in + /bin/cp $< $@ diff --git a/x3270.changes b/x3270.changes index dbfeb83..26de48d 100644 --- a/x3270.changes +++ b/x3270.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jul 14 12:41:10 UTC 2018 - bwiedemann@suse.com + +- Add mkversion.patch to have fixed timestamps (boo#1047218) +- Add reproducible.patch to not add timestamps in .gz header + ------------------------------------------------------------------- Wed Dec 28 10:14:48 UTC 2016 - mpluskal@suse.com diff --git a/x3270.spec b/x3270.spec index 06e4ade..66e9da4 100644 --- a/x3270.spec +++ b/x3270.spec @@ -34,6 +34,8 @@ Patch100: usr_local_bin.patch Patch102: x026-offset.diff Patch105: x3270-missing-include.patch Patch106: x3270-missing-file.patch +Patch107: reproducible.patch +Patch108: mkversion.patch BuildRequires: bdftopcf BuildRequires: fdupes BuildRequires: fontpackages-devel @@ -105,6 +107,12 @@ x026 is a fun toy which emulates an x026 puncher. %patch102 %patch105 -p1 %patch106 -p1 +%patch107 -p1 +for d in x3270 c3270 s3270 tcl3270 pr3287 ; do +(cd $d +%patch108 -p2 +) +done %build export CFLAGS="%{optflags}"