From d54774ae100d9be778d56fbf49b937696e5a09b6410bfa8b3e9b270ceeff06a0 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 15 Dec 2006 17:09:13 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gzip?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + gzip-1.3.9.tar.gz | 3 + gzip-rsyncable.diff | 282 ++++++++++++++++++++++++++++++++++++++++++++ gzip.changes | 273 ++++++++++++++++++++++++++++++++++++++++++ gzip.spec | 254 +++++++++++++++++++++++++++++++++++++++ non-exec-stack.diff | 7 ++ ready | 0 tempfile.diff | 44 +++++++ zgrep.diff | 42 +++++++ zmore.diff | 46 ++++++++ 11 files changed, 975 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 gzip-1.3.9.tar.gz create mode 100644 gzip-rsyncable.diff create mode 100644 gzip.changes create mode 100644 gzip.spec create mode 100644 non-exec-stack.diff create mode 100644 ready create mode 100644 tempfile.diff create mode 100644 zgrep.diff create mode 100644 zmore.diff diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/gzip-1.3.9.tar.gz b/gzip-1.3.9.tar.gz new file mode 100644 index 0000000..b8225a0 --- /dev/null +++ b/gzip-1.3.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6fdbe5ce21f5e4ce219375c29e842da517e61a56900a678cf258b4fdd603e72 +size 420737 diff --git a/gzip-rsyncable.diff b/gzip-rsyncable.diff new file mode 100644 index 0000000..6204ccf --- /dev/null +++ b/gzip-rsyncable.diff @@ -0,0 +1,282 @@ +NOTE: this patch is for _gzip_! + +This is pending for actual inclusion in gzip. It is currently being +tried out in the default gzip for Debian Sarge, and may go into the +upstream gzip at somepoint in the not-too-distant future. + +================================================================================ +--- gzip-1.3.6/deflate.c ++++ gzip-1.3.6/deflate.c +@@ -135,6 +135,14 @@ + #endif + /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + ++#ifndef RSYNC_WIN ++# define RSYNC_WIN 4096 ++#endif ++/* Size of rsync window, must be < MAX_DIST */ ++ ++#define RSYNC_SUM_MATCH(sum) ((sum) % RSYNC_WIN == 0) ++/* Whether window sum matches magic value */ ++ + /* =========================================================================== + * Local data used by the "longest match" routines. + */ +@@ -216,6 +224,8 @@ + unsigned near good_match; + /* Use a faster search when the previous match is longer than this */ + ++local ulg rsync_sum; /* rolling sum of rsync window */ ++local ulg rsync_chunk_end; /* next rsync sequence point */ + + /* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to +@@ -314,6 +324,10 @@ + #endif + /* prev will be initialized on the fly */ + ++ /* rsync params */ ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ rsync_sum = 0; ++ + /* Set the default configuration parameters: + */ + max_lazy_match = configuration_table[pack_level].max_lazy; +@@ -550,6 +564,8 @@ + memcpy((char*)window, (char*)window+WSIZE, (unsigned)WSIZE); + match_start -= WSIZE; + strstart -= WSIZE; /* we now have strstart >= MAX_DIST: */ ++ if (rsync_chunk_end != 0xFFFFFFFFUL) ++ rsync_chunk_end -= WSIZE; + + block_start -= (long) WSIZE; + +@@ -577,13 +593,46 @@ + } + } + ++local void rsync_roll(start, num) ++ unsigned start; ++ unsigned num; ++{ ++ unsigned i; ++ ++ if (start < RSYNC_WIN) { ++ /* before window fills. */ ++ for (i = start; i < RSYNC_WIN; i++) { ++ if (i == start + num) return; ++ rsync_sum += (ulg)window[i]; ++ } ++ num -= (RSYNC_WIN - start); ++ start = RSYNC_WIN; ++ } ++ ++ /* buffer after window full */ ++ for (i = start; i < start+num; i++) { ++ /* New character in */ ++ rsync_sum += (ulg)window[i]; ++ /* Old character out */ ++ rsync_sum -= (ulg)window[i - RSYNC_WIN]; ++ if (rsync_chunk_end == 0xFFFFFFFFUL && RSYNC_SUM_MATCH(rsync_sum)) ++ rsync_chunk_end = i; ++ } ++} ++ ++/* =========================================================================== ++ * Set rsync_chunk_end if window sum matches magic value. ++ */ ++#define RSYNC_ROLL(s, n) \ ++ do { if (rsync) rsync_roll((s), (n)); } while(0) ++ + /* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ + #define FLUSH_BLOCK(eof) \ + flush_block(block_start >= 0L ? (char*)&window[(unsigned)block_start] : \ +- (char*)NULL, (long)strstart - block_start, (eof)) ++ (char*)NULL, (long)strstart - block_start, flush-1, (eof)) + + /* =========================================================================== + * Processes a new input file and return its compressed length. This +@@ -594,7 +643,7 @@ + local off_t deflate_fast() + { + IPos hash_head; /* head of the hash chain */ +- int flush; /* set if current block must be flushed */ ++ int flush; /* set if current block must be flushed, 2=>and padded */ + unsigned match_length = 0; /* length of best match */ + + prev_length = MIN_MATCH-1; +@@ -623,6 +672,7 @@ + + lookahead -= match_length; + ++ RSYNC_ROLL(strstart, match_length); + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +@@ -651,9 +701,14 @@ + /* No match, output a literal byte */ + Tracevv((stderr,"%c",window[strstart])); + flush = ct_tally (0, window[strstart]); ++ RSYNC_ROLL(strstart, 1); + lookahead--; + strstart++; + } ++ if (rsync && strstart > rsync_chunk_end) { ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ } + if (flush) FLUSH_BLOCK(0), block_start = strstart; + + /* Make sure that we always have enough lookahead, except +@@ -726,6 +781,7 @@ + */ + lookahead -= prev_length-1; + prev_length -= 2; ++ RSYNC_ROLL(strstart, prev_length+1); + do { + strstart++; + INSERT_STRING(strstart, hash_head); +@@ -738,24 +794,39 @@ + match_available = 0; + match_length = MIN_MATCH-1; + strstart++; +- if (flush) FLUSH_BLOCK(0), block_start = strstart; + ++ if (rsync && strstart > rsync_chunk_end) { ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ } ++ if (flush) FLUSH_BLOCK(0), block_start = strstart; + } else if (match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c",window[strstart-1])); +- if (ct_tally (0, window[strstart-1])) { +- FLUSH_BLOCK(0), block_start = strstart; +- } ++ flush = ct_tally (0, window[strstart-1]); ++ if (rsync && strstart > rsync_chunk_end) { ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ } ++ if (flush) FLUSH_BLOCK(0), block_start = strstart; ++ RSYNC_ROLL(strstart, 1); + strstart++; + lookahead--; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ ++ if (rsync && strstart > rsync_chunk_end) { ++ /* Reset huffman tree */ ++ rsync_chunk_end = 0xFFFFFFFFUL; ++ flush = 2; ++ FLUSH_BLOCK(0), block_start = strstart; ++ } + match_available = 1; ++ RSYNC_ROLL(strstart, 1); + strstart++; + lookahead--; + } +--- gzip-1.3.6/doc/gzip.texi ++++ gzip-1.3.6/doc/gzip.texi +@@ -328,6 +328,14 @@ + into the directory and compress all the files it finds there (or + decompress them in the case of @code{gunzip}). + ++@item --rsyncable ++While compressing, synchronize the output occasionally based on the ++input. This increases size by less than 1 percent most cases, but ++means that the @code{rsync} program can take advantage of similarities ++in the uncompressed input when syncronizing two files compressed with ++this flag. @code{gunzip} cannot tell the difference between a ++compressed file created with this option, and one created without it. ++ + @item --suffix @var{suf} + @itemx -S @var{suf} + Use suffix @samp{@var{suf}} instead of @samp{.gz}. Any suffix can be +--- gzip-1.3.6/gzip.c ++++ gzip-1.3.6/gzip.c +@@ -218,6 +218,7 @@ + unsigned insize; /* valid bytes in inbuf */ + unsigned inptr; /* index of next byte to be processed in inbuf */ + unsigned outcnt; /* bytes in output buffer */ ++int rsync = 0; /* make ryncable chunks */ + + struct option longopts[] = + { +@@ -247,6 +248,7 @@ + {"best", 0, 0, '9'}, /* compress better */ + {"lzw", 0, 0, 'Z'}, /* make output compatible with old compress */ + {"bits", 1, 0, 'b'}, /* max number of bits per code (implies -Z) */ ++ {"rsyncable", 0, 0, 'R'}, /* make rsync-friendly archive */ + { 0, 0, 0, 0 } + }; + +--- gzip-1.3.6/gzip.h ++++ gzip-1.3.6/gzip.h +@@ -155,6 +155,7 @@ + extern unsigned insize; /* valid bytes in inbuf */ + extern unsigned inptr; /* index of next byte to be processed in inbuf */ + extern unsigned outcnt; /* bytes in output buffer */ ++extern int rsync; /* deflate into rsyncable chunks */ + + extern off_t bytes_in; /* number of input bytes */ + extern off_t bytes_out; /* number of output bytes */ +@@ -303,7 +304,7 @@ + /* in trees.c */ + void ct_init OF((ush *attr, int *method)); + int ct_tally OF((int dist, int lc)); +-off_t flush_block OF((char *buf, ulg stored_len, int eof)); ++off_t flush_block OF((char *buf, ulg stored_len, int pad, int eof)); + + /* in bits.c */ + void bi_init OF((file_t zipfile)); +--- gzip-1.3.6/trees.c ++++ gzip-1.3.6/trees.c +@@ -59,12 +59,13 @@ + * void ct_tally (int dist, int lc); + * Save the match info and tally the frequency counts. + * +- * off_t flush_block (char *buf, ulg stored_len, int eof) ++ * off_t flush_block (char *buf, ulg stored_len, int pad, int eof) + * Determine the best encoding for the current block: dynamic trees, + * static trees or store, and output the encoded block to the zip +- * file. Returns the total compressed length for the file so far. +- * +- */ ++ * file. If pad is set, pads the block to the next ++ * byte. Returns the total compressed length for the file so ++ * far. ++ * */ + + #include + #include +@@ -860,9 +861,10 @@ + * trees or store, and output the encoded block to the zip file. This function + * returns the total compressed length for the file so far. + */ +-off_t flush_block(buf, stored_len, eof) ++off_t flush_block(buf, stored_len, pad, eof) + char *buf; /* input block, or NULL if too old */ + ulg stored_len; /* length of input block */ ++ int pad; /* pad output to byte boundary */ + int eof; /* true if this is the last block for a file */ + { + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ +@@ -955,6 +957,10 @@ + Assert (input_len == bytes_in, "bad input size"); + bi_windup(); + compressed_len += 7; /* align on byte boundary */ ++ } else if (pad && (compressed_len % 8) != 0) { ++ send_bits((STORED_BLOCK<<1)+eof, 3); /* send block type */ ++ compressed_len = (compressed_len + 3 + 7) & ~7L; ++ copy_block(buf, 0, 1); /* with header */ + } + + return compressed_len >> 3; diff --git a/gzip.changes b/gzip.changes new file mode 100644 index 0000000..5f0fc2d --- /dev/null +++ b/gzip.changes @@ -0,0 +1,273 @@ +------------------------------------------------------------------- +Fri Dec 15 11:48:41 CET 2006 - schwab@suse.de + +- Update to gzip 1.3.9. + * No major changes; only porting fixes. + +------------------------------------------------------------------- +Tue Dec 12 10:10:38 CET 2006 - schwab@suse.de + +- Update to gzip 1.3.8. + * Fix some gzip problems: + - A security fix from Debian 1.3.5-5 was inadvertently omitted. + - The assembler is now invoked with --noexecstack if supported, + so that gzip can better resist stack-smashing attacks. + +------------------------------------------------------------------- +Thu Dec 7 11:19:36 CET 2006 - schwab@suse.de + +- Update to gzip 1.3.7. + * Fix some gzip problems: + - Refuse to compress setuid or setgid files, or files with the sticky bit. + - Fix more race conditions in setting file permissions and owner, + removing output files, following symbolic links, and dealing with + special files. + - Remove most of the code working around ENAMETOOLONG deficiencies. + Systems with those deficiencies are long-dead, and the workarounds + had race conditions on modern hosts. + - Catch CPU time and file size limit signals, too. + - Check for read errors when closing files. + - Fix a core dump caused by a stray abort mistakenly introduced in 1.3.6. + * Fix some gzexe problems: + - Improve resistance to denial-of-service attacks. + - Fix some quoting and escaping bugs. + - Do not assume /tmp is sticky (though it should be!). + - Do not assume the working directory can be written. + - Rely on PATH in the generated executable, as the man page says. + - Don't assume IFS is sane. + - Exit with signal's status, if signaled. + +------------------------------------------------------------------- +Mon Dec 4 13:08:18 CET 2006 - schwab@suse.de + +- Update to gzip 1.3.6. + * Fix some race conditions in setting file time stamps, permissions, and owner. + * Fix some race conditions in signal handling. + * When gzip exits due to a signal, it exits with the signal's status, not 1. + * gzip now restores file time stamps to the resolution supported by the + time-setting primitives of the operating system, typically 1 microsecond. + Formerly it restored them only to the nearest second. + * gzip -r no longer attempts to reset the last-access times of directories + it reads, as this messes up when other processes are reading the directories. + * The options --version and --help now work on all gzip-installed executables, + and now use a format similar to other GNU programs. + * The manual is now distributed under the terms of the GNU Free + Documentation License without invariant sections or cover texts. + * Port to current versions of Autoconf, Automake, and Gnulib. + +------------------------------------------------------------------- +Wed Sep 13 11:11:47 CEST 2006 - schwab@suse.de + +- Verify hash tables when unpacking [#202365]. + +------------------------------------------------------------------- +Mon Mar 13 17:53:27 CET 2006 - schwab@suse.de + +- Add rsyncable patch [#155442]. + +------------------------------------------------------------------- +Wed Jan 25 21:30:22 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Fri Nov 11 11:56:29 CET 2005 - pth@suse.de + +- Don't obsolete compress. + +------------------------------------------------------------------- +Mon Oct 31 18:15:55 CET 2005 - dmueller@suse.de + +- build with non-executable stack + +------------------------------------------------------------------- +Tue Jul 26 14:56:47 CEST 2005 - schwab@suse.de + +- Ignore directory part on saved file name [#79292]. + +------------------------------------------------------------------- +Tue Apr 19 14:59:23 CEST 2005 - kukuk@suse.de + +- Remove uncompress symlink [#78331] + +------------------------------------------------------------------- +Thu Mar 24 13:33:56 CET 2005 - werner@suse.de + +- Add support for bzip2 and simply pager options to zmore + +------------------------------------------------------------------- +Mon May 3 13:59:40 CEST 2004 - schwab@suse.de + +- Fix quoting issues in zgrep [#39329]. + +------------------------------------------------------------------- +Fri Feb 27 17:44:02 CET 2004 - schwab@suse.de + +- Add %defattr. + +------------------------------------------------------------------- +Tue Dec 2 10:12:06 CET 2003 - pthomas@suse.de + +- Remove the patch for tail syntax as it's wrong and unnecessary. + +------------------------------------------------------------------- +Thu Sep 18 15:18:43 CEST 2003 - mmj@suse.de + +- Fix tail syntax in gzexe [#31229] + +------------------------------------------------------------------- +Thu Aug 28 16:00:22 CEST 2003 - kukuk@suse.de + +- Make sure we have no hardlinks from /bin to /usr/bin [Bug #29522] + +------------------------------------------------------------------- +Tue Jun 17 13:47:17 CEST 2003 - pthomas@suse.de + +- Update to 1.3.5 + - gzip now removes any output symlink before writing output file. + - zgrep etc. scripts now port to POSIX 1003.1-2001 hosts. + - zforce no longer assumes 14-byte file name length limit. + - zless is now implemented using less and LESSOPEN, not zmore and PAGER. + - assembly-language speedups reenabled; were mistakenly disabled in 1.3. + - Less output is lost when decompressing a truncated file. + - zgrep now supports --, -H, -h, -L, -l, -C, -d, -m and their long + equivalents. + +------------------------------------------------------------------- +Wed Jun 4 18:20:32 CEST 2003 - jh@suse.de + +- Enable profile feedback + +------------------------------------------------------------------- +Thu Apr 24 12:20:23 CEST 2003 - ro@suse.de + +- fix install_info --delete call and move from preun to postun + +------------------------------------------------------------------- +Tue Apr 15 17:31:41 CEST 2003 - coolo@suse.de + +- use BuildRoot + +------------------------------------------------------------------- +Sat Feb 8 10:58:53 CET 2003 - kukuk@suse.de + +- Readded prereq for install-info, else we cannot install info + pages +- Add dir entry to info page + +------------------------------------------------------------------- +Sat Feb 8 01:43:07 CET 2003 - ro@suse.de + +- removed prereq for texinfo to avoid prereq-cycle + +------------------------------------------------------------------- +Fri Feb 7 02:24:31 CET 2003 - ro@suse.de + +- added install_info macros + +------------------------------------------------------------------- +Wed Jan 29 15:13:10 CET 2003 - kukuk@suse.de + +- Remove mimencode requires, it is optional + +------------------------------------------------------------------- +Tue Dec 17 15:25:56 CET 2002 - werner@suse.de + +- The `:' line of zgrep will be removed by configure +- zgrep requzires mimencode from metamail + +------------------------------------------------------------------- +Tue Sep 17 17:34:28 CEST 2002 - ro@suse.de + +- removed bogus self-provides + +------------------------------------------------------------------- +Thu Mar 14 18:26:33 CET 2002 - kukuk@suse.de + +- Add uncompress compat link + +------------------------------------------------------------------- +Wed Feb 6 11:15:08 CET 2002 - coolo@suse.de + +- use %suse_update_config + +------------------------------------------------------------------- +Thu Jan 24 11:35:18 CET 2002 - okir@suse.de + +- fixed tempfile race in zdiff (current code used bash noclobber + which is inherently racey) + +------------------------------------------------------------------- +Wed Jun 6 16:28:07 CEST 2001 - werner@suse.de + +- Make zgrep knowing about bzip2 + +------------------------------------------------------------------- +Tue Apr 3 18:42:46 CEST 2001 - uli@suse.de + +- fixed for gcc >2.96 + +------------------------------------------------------------------- +Tue Mar 27 03:07:13 CEST 2001 - bk@suse.de + +- use i686 insn scheduling on i386 and strip binaries(performance) +- make tmpfiles in gzexe secure and improve znew tempdir creation +- remove unnessary expr use and fix gzip output checking in zforce +- add simple tests if gzip/gunzip work + +------------------------------------------------------------------- +Mon Nov 27 18:17:05 CET 2000 - aj@suse.de + +- Update to gzip 1.3. + +------------------------------------------------------------------- +Wed Aug 23 16:41:25 CEST 2000 - werner@suse.de + +- Security changes for the znew script + +------------------------------------------------------------------- +Mon May 1 18:50:20 CEST 2000 - kukuk@suse.de + +- LSB-FHS requires /bin/gunzip and /bin/zcat to /bin/gzip + +------------------------------------------------------------------- +Tue Apr 18 10:42:52 CEST 2000 - kukuk@suse.de + +- Add /bin/zcat (required by FHS 2.1) + +------------------------------------------------------------------- +Fri Feb 25 12:29:21 CET 2000 - schwab@suse.de + +- cleanup spec file, get rid of Makefile.Linux +- define _GNU_SOURCE for basename declaration +- /usr/man -> /usr/share/man +- add gzip.info to file list + +------------------------------------------------------------------- +Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de + +- ran old prepare_spec on spec file to switch to new prepare_spec. + +------------------------------------------------------------------- +Fri Mar 6 18:47:20 MET 1998 - florian@suse.de + +- fixed security bug posted on Dez 27 to bugtraq + +------------------------------------------------------------------- +Thu Jan 8 17:24:05 MET 1998 - bs@suse.de + +- fixed "double" /bin/gzip & /usr/bin/gzip + +---------------------------------------------------------------------------- +Thu Apr 24 10:15:54 CEST 1997 - bs@suse.de + + +- added symlink /bin/gunzip + +---------------------------------------------------------------------------- +Sun Apr 13 23:04:29 MEST 1997 - florian@suse.de + + +- add bug-fixes from gnu.utils.bugs + + diff --git a/gzip.spec b/gzip.spec new file mode 100644 index 0000000..c001287 --- /dev/null +++ b/gzip.spec @@ -0,0 +1,254 @@ +# +# spec file for package gzip (Version 1.3.9) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +Name: gzip +%define do_profiling 0 +URL: http://www.gzip.org/ +License: GNU General Public License (GPL) +Group: Productivity/Archiving/Compression +Autoreqprov: on +PreReq: %{install_info_prereq} +Version: 1.3.9 +Release: 1 +Summary: GNU Zip Compression Utilities +Source: %{name}-%{version}.tar.gz +Patch: zgrep.diff +Patch1: tempfile.diff +Patch2: zmore.diff +Patch3: non-exec-stack.diff +Patch4: http://rsync.samba.org/ftp/unpacked/rsync/patches/gzip-rsyncable.diff +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +Gzip reduces the size of the named files using Lempel-Ziv coding LZ77. +Whenever possible, each file is replaced by one with the extension .gz, +while keeping the same ownership modes and access and modification +times. + + + +Authors: +-------- + Jean-loup Gailly + +%prep +%{suse_update_config -f} +%setup -q +%patch +%patch1 +%patch2 +%patch3 +%patch4 -p1 + +%build +CFLAGS="$RPM_OPT_FLAGS -fomit-frame-pointer \ +%ifarch %{ix86} +-mcpu=pentiumpro \ +%endif +-W -Wall -Wno-unused-parameter -Wstrict-prototypes -Wpointer-arith" +./configure CFLAGS="$CFLAGS" \ + --prefix=%{_prefix} --infodir=%{_infodir} --mandir=%{_mandir} +%if %{do_profiling} + make CFLAGS="$CFLAGS -fprofile-arcs" + for i in 1 2 3 4 5 6 7 8 9 + do + for f in build-aux/texinfo.tex /bin/bash; do + basef=${f##*/} + time ./gzip -$i < $f > $basef.gz + ./gzip --test $basef.gz + ./gzip -d < $basef.gz > $basef.test$i + cmp $f $basef.test$i + done + done + make clean + make CFLAGS="$CFLAGS -fbranch-probabilities" +%else + make +%endif +for i in 1 2 3 4 5 6 7 8 9 +do + for f in build-aux/texinfo.tex /bin/bash; do + basef=${f##*/} + time ./gzip -$i < $f > $basef.gz + ./gzip --test $basef.gz + ./gzip -d < $basef.gz > $basef.test$i + cmp $f $basef.test$i + done +done + +%install +make DESTDIR=$RPM_BUILD_ROOT install +mkdir -p $RPM_BUILD_ROOT/bin +mv $RPM_BUILD_ROOT/usr/bin/gzip $RPM_BUILD_ROOT/bin/ +ln -f $RPM_BUILD_ROOT/bin/gzip $RPM_BUILD_ROOT/bin/zcat +ln -f $RPM_BUILD_ROOT/bin/gzip $RPM_BUILD_ROOT/bin/gunzip +ln -sf /bin/gzip $RPM_BUILD_ROOT/usr/bin/gzip +ln -sf /bin/gunzip $RPM_BUILD_ROOT/usr/bin/gunzip +ln -sf /bin/zcat $RPM_BUILD_ROOT/usr/bin/zcat +ln -sf zmore $RPM_BUILD_ROOT/usr/bin/zless +ln -sf zmore.1 $RPM_BUILD_ROOT%{_mandir}/man1/zless.1 + +%files +%defattr(-, root, root) +/bin/* +/usr/bin/* +%doc %{_infodir}/*.gz +%doc %{_mandir}/man*/*.gz + +%post +%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz + +%postun +%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz + +%changelog -n gzip +* Fri Dec 15 2006 - schwab@suse.de +- Update to gzip 1.3.9. + * No major changes; only porting fixes. +* Tue Dec 12 2006 - schwab@suse.de +- Update to gzip 1.3.8. + * Fix some gzip problems: + - A security fix from Debian 1.3.5-5 was inadvertently omitted. + - The assembler is now invoked with --noexecstack if supported, + so that gzip can better resist stack-smashing attacks. +* Thu Dec 07 2006 - schwab@suse.de +- Update to gzip 1.3.7. + * Fix some gzip problems: + - Refuse to compress setuid or setgid files, or files with the sticky bit. + - Fix more race conditions in setting file permissions and owner, + removing output files, following symbolic links, and dealing with + special files. + - Remove most of the code working around ENAMETOOLONG deficiencies. + Systems with those deficiencies are long-dead, and the workarounds + had race conditions on modern hosts. + - Catch CPU time and file size limit signals, too. + - Check for read errors when closing files. + - Fix a core dump caused by a stray abort mistakenly introduced in 1.3.6. + * Fix some gzexe problems: + - Improve resistance to denial-of-service attacks. + - Fix some quoting and escaping bugs. + - Do not assume /tmp is sticky (though it should be!). + - Do not assume the working directory can be written. + - Rely on PATH in the generated executable, as the man page says. + - Don't assume IFS is sane. + - Exit with signal's status, if signaled. +* Mon Dec 04 2006 - schwab@suse.de +- Update to gzip 1.3.6. + * Fix some race conditions in setting file time stamps, permissions, and owner. + * Fix some race conditions in signal handling. + * When gzip exits due to a signal, it exits with the signal's status, not 1. + * gzip now restores file time stamps to the resolution supported by the + time-setting primitives of the operating system, typically 1 microsecond. + Formerly it restored them only to the nearest second. + * gzip -r no longer attempts to reset the last-access times of directories + it reads, as this messes up when other processes are reading the directories. + * The options --version and --help now work on all gzip-installed executables, + and now use a format similar to other GNU programs. + * The manual is now distributed under the terms of the GNU Free + Documentation License without invariant sections or cover texts. + * Port to current versions of Autoconf, Automake, and Gnulib. +* Wed Sep 13 2006 - schwab@suse.de +- Verify hash tables when unpacking [#202365]. +* Mon Mar 13 2006 - schwab@suse.de +- Add rsyncable patch [#155442]. +* Wed Jan 25 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Fri Nov 11 2005 - pth@suse.de +- Don't obsolete compress. +* Mon Oct 31 2005 - dmueller@suse.de +- build with non-executable stack +* Tue Jul 26 2005 - schwab@suse.de +- Ignore directory part on saved file name [#79292]. +* Tue Apr 19 2005 - kukuk@suse.de +- Remove uncompress symlink [#78331] +* Thu Mar 24 2005 - werner@suse.de +- Add support for bzip2 and simply pager options to zmore +* Mon May 03 2004 - schwab@suse.de +- Fix quoting issues in zgrep [#39329]. +* Fri Feb 27 2004 - schwab@suse.de +- Add %%defattr. +* Tue Dec 02 2003 - pthomas@suse.de +- Remove the patch for tail syntax as it's wrong and unnecessary. +* Thu Sep 18 2003 - mmj@suse.de +- Fix tail syntax in gzexe [#31229] +* Thu Aug 28 2003 - kukuk@suse.de +- Make sure we have no hardlinks from /bin to /usr/bin [Bug #29522] +* Tue Jun 17 2003 - pthomas@suse.de +- Update to 1.3.5 + - gzip now removes any output symlink before writing output file. + - zgrep etc. scripts now port to POSIX 1003.1-2001 hosts. + - zforce no longer assumes 14-byte file name length limit. + - zless is now implemented using less and LESSOPEN, not zmore and PAGER. + - assembly-language speedups reenabled; were mistakenly disabled in 1.3. + - Less output is lost when decompressing a truncated file. + - zgrep now supports --, -H, -h, -L, -l, -C, -d, -m and their long + equivalents. +* Wed Jun 04 2003 - jh@suse.de +- Enable profile feedback +* Thu Apr 24 2003 - ro@suse.de +- fix install_info --delete call and move from preun to postun +* Tue Apr 15 2003 - coolo@suse.de +- use BuildRoot +* Sat Feb 08 2003 - kukuk@suse.de +- Readded prereq for install-info, else we cannot install info + pages +- Add dir entry to info page +* Sat Feb 08 2003 - ro@suse.de +- removed prereq for texinfo to avoid prereq-cycle +* Fri Feb 07 2003 - ro@suse.de +- added install_info macros +* Wed Jan 29 2003 - kukuk@suse.de +- Remove mimencode requires, it is optional +* Tue Dec 17 2002 - werner@suse.de +- The `:' line of zgrep will be removed by configure +- zgrep requzires mimencode from metamail +* Tue Sep 17 2002 - ro@suse.de +- removed bogus self-provides +* Thu Mar 14 2002 - kukuk@suse.de +- Add uncompress compat link +* Wed Feb 06 2002 - coolo@suse.de +- use %%suse_update_config +* Thu Jan 24 2002 - okir@suse.de +- fixed tempfile race in zdiff (current code used bash noclobber + which is inherently racey) +* Wed Jun 06 2001 - werner@suse.de +- Make zgrep knowing about bzip2 +* Tue Apr 03 2001 - uli@suse.de +- fixed for gcc >2.96 +* Tue Mar 27 2001 - bk@suse.de +- use i686 insn scheduling on i386 and strip binaries(performance) +- make tmpfiles in gzexe secure and improve znew tempdir creation +- remove unnessary expr use and fix gzip output checking in zforce +- add simple tests if gzip/gunzip work +* Mon Nov 27 2000 - aj@suse.de +- Update to gzip 1.3. +* Wed Aug 23 2000 - werner@suse.de +- Security changes for the znew script +* Mon May 01 2000 - kukuk@suse.de +- LSB-FHS requires /bin/gunzip and /bin/zcat to /bin/gzip +* Tue Apr 18 2000 - kukuk@suse.de +- Add /bin/zcat (required by FHS 2.1) +* Fri Feb 25 2000 - schwab@suse.de +- cleanup spec file, get rid of Makefile.Linux +- define _GNU_SOURCE for basename declaration +- /usr/man -> /usr/share/man +- add gzip.info to file list +* Mon Sep 13 1999 - bs@suse.de +- ran old prepare_spec on spec file to switch to new prepare_spec. +* Fri Mar 06 1998 - florian@suse.de +- fixed security bug posted on Dez 27 to bugtraq +* Thu Jan 08 1998 - bs@suse.de +- fixed "double" /bin/gzip & /usr/bin/gzip +* Thu Apr 24 1997 - bs@suse.de +- added symlink /bin/gunzip +* Sun Apr 13 1997 - florian@suse.de +- add bug-fixes from gnu.utils.bugs diff --git a/non-exec-stack.diff b/non-exec-stack.diff new file mode 100644 index 0000000..40923fc --- /dev/null +++ b/non-exec-stack.diff @@ -0,0 +1,7 @@ +--- lib/match.c ++++ lib/match.c +@@ -770,3 +770,4 @@ + # endif /* __ia64__ */ + #endif /* mc68000 || mc68020 */ + #endif /* i386 || _I386 */ ++ .section .note.GNU-stack,"",@progbits diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4 diff --git a/tempfile.diff b/tempfile.diff new file mode 100644 index 0000000..e09d723 --- /dev/null +++ b/tempfile.diff @@ -0,0 +1,44 @@ +--- zdiff.in ++++ zdiff.in +@@ -59,12 +59,12 @@ + case "$2" in + *[-.]gz* | *[-.][zZ] | *.t[ga]z) + F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'` +- set -C +- trap 'rm -f /tmp/"$F".$$; exit 2' HUP INT PIPE TERM 0 +- gzip -cdfq -- "$2" > /tmp/"$F".$$ || exit +- gzip -cdfq -- "$1" | $comp $OPTIONS - /tmp/"$F".$$ ++ TF=`/bin/mktemp -t "$F".XXXXXXXX` || exit 1 ++ trap 'rm -f "$TF"; exit 2' HUP INT PIPE TERM 0 ++ gzip -cdfq -- "$2" > "$TF" || exit ++ gzip -cdfq -- "$1" | $comp $OPTIONS - "$TF" + STAT="$?" +- /bin/rm -f /tmp/"$F".$$ || STAT=2 ++ /bin/rm -f "$TF" || STAT=2 + trap - HUP INT PIPE TERM 0 + exit $STAT;; + +--- znew.in ++++ znew.in +@@ -56,8 +56,9 @@ + # block is the disk block size (best guess, need not be exact) + + warn="(does not preserve modes and timestamp)" +-tmp=/tmp/zfoo.$$ +-set -C ++dtmp=`mktemp -d -t znew.XXXXXXXX` || exit ++trap 'rm -rf $dtmp' HUP INT PIPE TERM 0 ++tmp=$dtmp/znew + echo hi > $tmp || exit + if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then + cpmod=${CPMOD-cpmod} +@@ -73,7 +74,8 @@ + # check if GZIP env. variable uses -S or --suffix + gzip -q $tmp + ext=`echo $tmp* | sed "s|$tmp||"` +-rm -f $tmp* ++rm -f $dtmp ++trap - HUP INT PIPE TERM 0 + if test -z "$ext"; then + echo znew: error determining gzip extension + exit 1 diff --git a/zgrep.diff b/zgrep.diff new file mode 100644 index 0000000..762bf62 --- /dev/null +++ b/zgrep.diff @@ -0,0 +1,42 @@ +--- zgrep.in ++++ zgrep.in +@@ -102,13 +102,36 @@ + fi + + if test $# -eq 0; then +- gzip -cdfq | $grep $opt "$pat" +- exit $? ++ if type -p dd > /dev/null 2>&1 && ++ type -p mimencode > /dev/null 2>&1 && ++ type -p file > /dev/null 2>&1 ++ then ++ uncompress=gzip ++ x=`dd bs=20 count=1 2> /dev/null | mimencode -b` ++ case `echo -n $x | mimencode -u -b | file -b -` in ++ bzip2*) ++ uncompress=bzip2 ++ ;; ++ esac ++ (echo -n $x | mimencode -u -b; cat -) | $uncompress -cdfq | $grep $opt "$pat" ++ exit $? ++ else ++ gzip -cdfq | $grep $opt "$pat" ++ exit $? ++ fi + fi + + res=0 + for i do +- gzip -cdfq -- "$i" | ++ case $i in ++ *.bz2) ++ uncompress=bzip2 ++ ;; ++ *) ++ uncompress=gzip ++ ;; ++ esac ++ $uncompress -cdfq "$i" | + if test $files_with_matches -eq 1; then + $grep $opt "$pat" > /dev/null && printf '%s\n' "$i" + elif test $files_without_matches -eq 1; then diff --git a/zmore.diff b/zmore.diff new file mode 100644 index 0000000..27ac465 --- /dev/null +++ b/zmore.diff @@ -0,0 +1,46 @@ +--- zmore.in ++++ zmore.in +@@ -52,11 +52,33 @@ + trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15 + fi + ++opt= ++pager () ++{ ++ eval ${PAGER-more} \$opt ++ cat > /dev/null ++} ++ ++while :; do ++ case $1 in ++ --) ++ shift ++ break ++ ;; ++ [-+]*) ++ opt="$opt $1" ++ shift ++ ;; ++ *) ++ break ++ ;; ++ esac ++done + if test $# = 0; then + if test -t 0; then + echo "$usage" + else +- gzip -cdfq | eval ${PAGER-more} ++ gzip -cdfq | pager + fi + else + FIRST=1 +@@ -80,7 +102,7 @@ + fi + if test "$ANS" != 's'; then + echo "------> $FILE <------" +- gzip -cdfq -- "$FILE" | eval ${PAGER-more} ++ gzip -cdfq -- "$FILE" | pager + fi + if test -t 1; then + FIRST=0