zip: add patches (#18994)

* zip: add patches

* Add .patch suffix

* Simplify build targets
This commit is contained in:
Adam J. Stewart 2020-10-13 02:47:25 -05:00 committed by GitHub
parent cfd69da839
commit 021cad1521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 254 additions and 9 deletions

View File

@ -0,0 +1,27 @@
From: A Costa <agcosta@gis.net>
Subject: manpage typo: transfering -> transferring
Bug-Debian: http://bugs.debian.org/301914
X-Debian-version: 2.31-2
--- a/man/zip.1
+++ b/man/zip.1
@@ -2756,7 +2756,7 @@
.I zip
handles some of the conversion internally.
When using Kermit to transfer zip files from VMS to MSDOS, type "set
-file type block" on VMS. When transfering from MSDOS to VMS, type
+file type block" on VMS. When transferring from MSDOS to VMS, type
"set file type fixed" on VMS. In both cases, type "set file type
binary" on MSDOS.
.LP
--- a/zip.txt
+++ b/zip.txt
@@ -1957,7 +1957,7 @@
be converted using Rahul Dhesi's BILF program. This version of zip
handles some of the conversion internally. When using Kermit to trans-
fer zip files from VMS to MSDOS, type "set file type block" on VMS.
- When transfering from MSDOS to VMS, type "set file type fixed" on VMS.
+ When transferring from MSDOS to VMS, type "set file type fixed" on VMS.
In both cases, type "set file type binary" on MSDOS.
Under some older VMS versions, zip may hang for file specifications

View File

@ -0,0 +1,27 @@
From: A Costa <agcosta@gis.net>
Subject: manpage typo: priviliges -> privileges
Bug-Debian: http://bugs.debian.org/309877
X-Debian-version: 2.31-3
--- a/man/zip.1
+++ b/man/zip.1
@@ -2403,7 +2403,7 @@
.TP
.PD
.B \-\-use\-privileges
-[WIN32] Use priviliges (if granted) to obtain all aspects of WinNT security.
+[WIN32] Use privileges (if granted) to obtain all aspects of WinNT security.
.TP
.PD 0
.B \-@
--- a/zip.txt
+++ b/zip.txt
@@ -1696,7 +1696,7 @@
-!
--use-privileges
- [WIN32] Use priviliges (if granted) to obtain all aspects of
+ [WIN32] Use privileges (if granted) to obtain all aspects of
WinNT security.
-@

View File

@ -0,0 +1,47 @@
From: Lior Kaplan <webmaster@guides.co.il>
Subject: put manpages in section 1, not in section 1L
Bug-Debian: http://bugs.debian.org/308045
X-Debian-version: 2.31-3
--- a/man/zip.1
+++ b/man/zip.1
@@ -13,7 +13,7 @@
.\" 30 August 2007, 27 April 2008, 25 May 2008, 27 May 2008 by EG,
.\" 7 June 2008 by SMS and EG; 12 June 2008 by EG)
.\"
-.TH ZIP 1L "16 June 2008 (v3.0)" Info-ZIP
+.TH ZIP 1 "16 June 2008 (v3.0)" Info-ZIP
.SH NAME
zip \- package and compress (archive) files
.SH SYNOPSIS
@@ -53,14 +53,14 @@
and is compatible with PKZIP (Phil Katz's ZIP for MSDOS systems).
.LP
A companion program
-.RI ( unzip (1L))
+.RI ( unzip (1))
unpacks
.I zip
archives.
The
.I zip
and
-.IR unzip (1L)
+.IR unzip (1)
programs can work with archives produced by PKZIP (supporting
most PKZIP features up to PKZIP version 4.6),
and PKZIP and PKUNZIP can work with archives produced by
@@ -2661,10 +2661,10 @@
[VMS] see ZIPOPT
.SH "SEE ALSO"
compress(1),
-shar(1L),
+shar(1),
tar(1),
-unzip(1L),
-gzip(1L)
+unzip(1),
+gzip(1)
.SH DIAGNOSTICS
The exit status (or error level) approximates the exit codes defined by PKWARE
and takes on the following values, except under VMS:

View File

@ -0,0 +1,15 @@
From: Santiago Vila <sanvila@debian.org>
Subject: Do not set unwanted CFLAGS, as it breaks DEB_BUILD_OPTIONS
X-Debian-version: 2.32-1
--- a/unix/configure
+++ b/unix/configure
@@ -98,7 +98,7 @@
_EOF_
$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
if test $? -eq 0; then
- CFLAGS_OPT='-O3'
+ # CFLAGS_OPT='-O3'
echo " GNU C ($CFLAGS_OPT)"
# Special Mac OS X shared library "ld" option?
if test ` uname -s 2> /dev/null ` = 'Darwin'; then

View File

@ -0,0 +1,26 @@
From: Santiago Vila <sanvila@debian.org>
Subject: manpage typo: preceeding -> preceding
X-Debian-version: 3.0-2
--- a/man/zip.1
+++ b/man/zip.1
@@ -502,7 +502,7 @@
where the option starts with --, has a multicharacter name, can
include a trailing dash to negate the option (if the option
supports it), and can have a value (option argument) specified by
-preceeding it with = (no spaces). Values can also follow the
+preceding it with = (no spaces). Values can also follow the
argument. So
.IP
\fC--before-date=mmddyyyy\fP
--- a/zip.txt
+++ b/zip.txt
@@ -376,7 +376,7 @@
where the option starts with --, has a multicharacter name, can include
a trailing dash to negate the option (if the option supports it), and
- can have a value (option argument) specified by preceeding it with =
+ can have a value (option argument) specified by preceding it with =
(no spaces). Values can also follow the argument. So
--before-date=mmddyyyy

View File

@ -0,0 +1,21 @@
From: Kees Cook <kees@debian.org>
Subject: put stack markings in i386 assembly to avoid executable stack
Bug-Debian: http://bugs.debian.org/528280
X-Debian-version: 3.0-2
--- a/crc_i386.S
+++ b/crc_i386.S
@@ -302,3 +302,5 @@
#endif /* i386 || _i386 || _I386 || __i386 */
#endif /* !USE_ZLIB && !CRC_TABLE_ONLY */
+.section .note.GNU-stack, "", @progbits
+.previous
--- a/match.S
+++ b/match.S
@@ -405,3 +405,5 @@
#endif /* i386 || _I386 || _i386 || __i386 */
#endif /* !USE_ZLIB */
+.section .note.GNU-stack, "", @progbits
+.previous

View File

@ -0,0 +1,16 @@
From: Christian Spieler
Subject: zipnote.c: Close in_file instead of undefined file x
Bug-Debian: http://bugs.debian.org/628594
X-Debian-version: 3.0-4
--- a/zipnote.c
+++ b/zipnote.c
@@ -661,7 +661,7 @@
if ((r = zipcopy(z)) != ZE_OK)
ziperr(r, "was copying an entry");
}
- fclose(x);
+ fclose(in_file);
/* Write central directory and end of central directory with new comments */
if ((c = zftello(y)) == (zoff_t)-1) /* get start of central */

View File

@ -0,0 +1,25 @@
From: Santiago Vila <sanvila@debian.org>
Subject: Use format specifier %s to print strings, not the string itself
Bug-Debian: http://bugs.debian.org/673476
X-Debian-version: 3.0-5
--- a/zip.c
+++ b/zip.c
@@ -1028,7 +1028,7 @@
for (i = 0; i < sizeof(text)/sizeof(char *); i++)
{
- printf(text[i]);
+ printf("%s", text[i]);
putchar('\n');
}
#ifdef DOS
@@ -1225,7 +1225,7 @@
CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE);
for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++)
{
- printf(cryptnote[i]);
+ printf("%s", cryptnote[i]);
putchar('\n');
}
++i; /* crypt support means there IS at least one compilation option */

View File

@ -0,0 +1,16 @@
From: Santiago Vila <sanvila@debian.org>
Subject: unix/configure: Take linking flags from the environment
Bug-Debian: http://bugs.debian.org/673476
X-Debian-version: 3.0-5
--- a/unix/configure
+++ b/unix/configure
@@ -18,7 +18,7 @@
CC=${1-cc}
CFLAGS=${2-"-I. -DUNIX"}
-LFLAGS1=''
+LFLAGS1=${LDFLAGS}
LFLAGS2=''
LN="ln -s"

View File

@ -0,0 +1,15 @@
From: Santiago Vila <sanvila@debian.org>
Subject: Remove (optional) build date to make the build reproducible
Bug-Debian: http://bugs.debian.org/779042
--- a/unix/unix.c
+++ b/unix/unix.c
@@ -1020,7 +1020,7 @@
/* Define the compile date string */
-#ifdef __DATE__
+#if 0
# define COMPILE_DATE " on " __DATE__
#else
# define COMPILE_DATE ""

View File

@ -3,25 +3,35 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Zip(MakefilePackage):
"""Zip is a compression and file packaging/archive utility."""
homepage = 'http://www.info-zip.org/Zip.html'
url = 'http://downloads.sourceforge.net/infozip/zip30.tar.gz'
homepage = 'https://www.info-zip.org/Zip.html'
url = 'https://downloads.sourceforge.net/infozip/zip30.tar.gz'
version('3.0', sha256='f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369')
depends_on('bzip2')
# Upstream is unmaintained, get patches from:
# https://deb.debian.org/debian/pool/main/z/zip/zip_3.0-11.debian.tar.xz
patch('01-typo-it-is-transferring-not-transfering.patch')
patch('02-typo-it-is-privileges-not-priviliges.patch')
patch('03-manpages-in-section-1-not-in-section-1l.patch')
patch('04-do-not-set-unwanted-cflags.patch')
patch('05-typo-it-is-preceding-not-preceeding.patch')
patch('06-stack-markings-to-avoid-executable-stack.patch')
patch('07-fclose-in-file-not-fclose-x.patch')
patch('08-hardening-build-fix-1.patch')
patch('09-hardening-build-fix-2.patch')
patch('10-remove-build-date.patch')
def url_for_version(self, version):
return 'http://downloads.sourceforge.net/infozip/zip{0}.tar.gz'.format(version.joined)
make_args = ['-f', 'unix/Makefile']
build_targets = make_args + ['generic']
def build(self, spec, prefix):
make('-f', 'unix/Makefile', 'CC=' + spack_cc, 'generic')
@property
def install_targets(self):
return self.make_args + ['prefix={0}'.format(self.prefix), 'install']
def install(self, spec, prefix):
make('-f', 'unix/Makefile', 'prefix=' + prefix, 'install')