From ff67f8ed8f55ad2abec65749ea512b1c2b32ff26f39197d143a287525b8fe84a Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 6 May 2019 07:48:30 +0000 Subject: [PATCH] Accepting request 700402 from home:bmwiedemann:reproducible:test - Add reproducible.patch to allow to override mtime values stored in .zip (boo#1047218) - Add zip-3.0-fix-doc.patch for the --strip-extra param replace URL to conform to LICENSE OBS-URL: https://build.opensuse.org/request/show/700402 OBS-URL: https://build.opensuse.org/package/show/Archiving/zip?expand=0&rev=19 --- reproducible.patch | 37 +++++++++++++++++++++++++++++++++++++ zip-3.0-fix-doc.patch | 13 +++++++++++++ zip.changes | 7 +++++++ zip.spec | 6 +++++- 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 reproducible.patch create mode 100644 zip-3.0-fix-doc.patch diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..f0d202c --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,37 @@ +Author: Bernhard M. Wiedemann +Date: 2019-05-03 + +Override mtime with zip -X +and SOURCE_DATE_EPOCH +to allow for reproducible builds of .zip files + +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. + +Index: zip30/zipup.c +=================================================================== +--- zip30.orig/zipup.c ++++ zip30/zipup.c +@@ -414,6 +414,7 @@ struct zlist far *z; /* zip entry to + ush tempcext = 0; + char *tempextra = NULL; + char *tempcextra = NULL; ++ const char *source_date_epoch; + + + #ifdef WINDLL +@@ -674,6 +675,13 @@ struct zlist far *z; /* zip entry to + + } /* strcmp(z->name, "-") == 0 */ + ++ if (extra_fields == 0 && (source_date_epoch = getenv("SOURCE_DATE_EPOCH")) != NULL) { ++ time_t epoch = strtoull(source_date_epoch, NULL, 10); ++ if (epoch > 0) { ++ ulg epochtim = unix2dostime(&epoch); ++ if (z->tim > epochtim) z->tim = epochtim; ++ } ++ } + if (extra_fields == 2) { + unsigned len; + char *p; diff --git a/zip-3.0-fix-doc.patch b/zip-3.0-fix-doc.patch new file mode 100644 index 0000000..6669d5b --- /dev/null +++ b/zip-3.0-fix-doc.patch @@ -0,0 +1,13 @@ +Index: zip30/zip.txt +=================================================================== +--- zip30.orig/zip.txt ++++ zip30/zip.txt +@@ -1620,7 +1620,7 @@ OPTIONS + See -i for more on include and exclude. + + -X +- --no-extra ++ --strip-extra + Do not save extra file attributes (Extended Attributes on OS/2, + uid/gid and file times on Unix). The zip format uses extra + fields to include additional information for each entry. Some diff --git a/zip.changes b/zip.changes index 67321bb..1af134e 100644 --- a/zip.changes +++ b/zip.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri May 3 10:41:10 UTC 2019 - Bernhard Wiedemann + +- Add reproducible.patch to allow to override mtime values + stored in .zip (boo#1047218) +- Add zip-3.0-fix-doc.patch for the --strip-extra param + ------------------------------------------------------------------- Tue Nov 28 16:29:02 UTC 2017 - kstreitova@suse.com diff --git a/zip.spec b/zip.spec index ac80314..87bef84 100644 --- a/zip.spec +++ b/zip.spec @@ -23,7 +23,7 @@ Release: 0 Summary: File compression program License: BSD-3-Clause Group: Productivity/Archiving/Compression -Url: http://www.info-zip.org/ +Url: https://github.com/distropatches/zip/commits/opensuse Source: http://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz Patch2: zip-3.0-iso8859_2.patch Patch3: zip-3.0-add_options_to_help.patch @@ -34,6 +34,8 @@ Patch7: zip-notimestamp.patch Patch8: zip-3.0-nomutilation.patch # PATCH-FIX-UPSTREAM bsc#1068346 kstreitova@suse.com -- fix memory leaks Patch9: zip-3.0-fix-memory_leaks.patch +Patch10: reproducible.patch +Patch11: zip-3.0-fix-doc.patch Provides: crzip = %{version} Obsoletes: crzip < %{version} BuildRequires: libbz2-devel @@ -53,6 +55,8 @@ PKZIP(tm) 2.04g (Phil Katz ZIP) for MS-DOS systems. %patch7 %patch8 %patch9 +%patch10 -p1 +%patch11 -p1 %build make %{?_smp_mflags} -f unix/Makefile prefix=/usr CC="gcc %{optflags} -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" generic_gcc