# ChangeLog for app-arch/gzip
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/gzip/ChangeLog,v 1.70 2006/11/11 09:36:40 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/gzip/ChangeLog,v 1.71 2006/12/07 13:56:37 vapier Exp $
+
+*gzip-1.3.7 (07 Dec 2006)
+
+ 07 Dec 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/gzip-1.3.7-CVE-2006-4334-8.2.patch,
+ +files/gzip-1.3.7-asm-execstack.patch,
+ +files/gzip-1.3.7-install-symlinks.patch, +gzip-1.3.7.ebuild:
+ Version bump.
11 Nov 2006; Mike Frysinger <vapier@gentoo.org> gzip-1.3.5-r9.ebuild,
gzip-1.3.5-r10.ebuild:
MD5 17f0be7717f949fc0acd0ef316982cd6 files/gzip-1.3.5-znew-tempfile-2.patch 1931
RMD160 cdfe696be4d6c5c67ad259a2f0958ec67be670b3 files/gzip-1.3.5-znew-tempfile-2.patch 1931
SHA256 98cb432fc65ce9e7cbb479c47ca6119d423651254dfa491042b6dd2a7fb6585c files/gzip-1.3.5-znew-tempfile-2.patch 1931
+AUX gzip-1.3.7-CVE-2006-4334-8.2.patch 4976 RMD160 94f2ab1a844ed40b2198afe3d0af18113c3d8570 SHA1 c9c77493b5c9213d32bb4c10da5fe4efcb782eac SHA256 9dc0a72d02db8dc9b9a660e012426428723ff651ac9099d297df526e2246a18a
+MD5 5645011cab1a3b02b95b6ec3e3ba043b files/gzip-1.3.7-CVE-2006-4334-8.2.patch 4976
+RMD160 94f2ab1a844ed40b2198afe3d0af18113c3d8570 files/gzip-1.3.7-CVE-2006-4334-8.2.patch 4976
+SHA256 9dc0a72d02db8dc9b9a660e012426428723ff651ac9099d297df526e2246a18a files/gzip-1.3.7-CVE-2006-4334-8.2.patch 4976
+AUX gzip-1.3.7-asm-execstack.patch 327 RMD160 6009ebd5a42f5df84bdd25d1b9edc29be8523d7a SHA1 c64c9571db0837ab5789aa9eb604de22fc1f59df SHA256 37337c436e83c0dc5eae7004be958716e2c278b8134e629d2a3b979b91685dc8
+MD5 89fd0b77720071c8f5d11299114cdf18 files/gzip-1.3.7-asm-execstack.patch 327
+RMD160 6009ebd5a42f5df84bdd25d1b9edc29be8523d7a files/gzip-1.3.7-asm-execstack.patch 327
+SHA256 37337c436e83c0dc5eae7004be958716e2c278b8134e629d2a3b979b91685dc8 files/gzip-1.3.7-asm-execstack.patch 327
+AUX gzip-1.3.7-install-symlinks.patch 855 RMD160 2694bb5a6f045c6bba63f7d59d541523ec011f17 SHA1 4bf57548d9a58be9bb9993f5cbf250e946cf2eb1 SHA256 7f4e7ad98881f75f6e4a4af293aefcf7552e570702aaf0826c50a2c39f0cd4cb
+MD5 7d848b6c4a53b11bc00761e3956fa941 files/gzip-1.3.7-install-symlinks.patch 855
+RMD160 2694bb5a6f045c6bba63f7d59d541523ec011f17 files/gzip-1.3.7-install-symlinks.patch 855
+SHA256 7f4e7ad98881f75f6e4a4af293aefcf7552e570702aaf0826c50a2c39f0cd4cb files/gzip-1.3.7-install-symlinks.patch 855
DIST gzip-1.3.5.tar.gz 331550 RMD160 5011f20441f31838c34b981c325107dd85737ff9 SHA1 843272609b9bff1bdf2770a28d498d6519901e73 SHA256 631820e566353eafc4bdc0d9d8221c26c7ef6b5d10a254783dbe9bcac88caa07
+DIST gzip-1.3.7.tar.gz 543619 RMD160 71e48e6d6b6f98f426fef2e965e4a24d7018be60 SHA1 4a5b81509c6a1844f5131d46b7c0e18eb5021e00 SHA256 1e18a88d7188e59bdabe48a19c06ddd2ff3bfd20d9bc3360df27f7be722bac5a
EBUILD gzip-1.3.5-r10.ebuild 2294 RMD160 0b3defcaf0074ac2b5fa267a053ff09096c9bf3b SHA1 1550cfeb77ee422a0ff53b549800223f7b3b20d4 SHA256 156570acad172ec81c3b5a6333d4450f7f181816b5c532a7611835b029450363
MD5 cc4c34723038148c3a048ea6f0c4ff86 gzip-1.3.5-r10.ebuild 2294
RMD160 0b3defcaf0074ac2b5fa267a053ff09096c9bf3b gzip-1.3.5-r10.ebuild 2294
MD5 03d21f1c5a0bea864f6db4a263ffc609 gzip-1.3.5-r9.ebuild 2280
RMD160 a71fde2c6d45d22b897224af39985645bc499db5 gzip-1.3.5-r9.ebuild 2280
SHA256 debadee1017304826e0e6ea1e14a9d37bf14c9f79d9982cf6b67a52b9be9d864 gzip-1.3.5-r9.ebuild 2280
-MISC ChangeLog 11301 RMD160 2b26ec294e554c8e8a942adace7403507e240556 SHA1 c8580afaec1e19192b530c94375145866113de3c SHA256 dff45ccd7d9004015aede1fc68a28edcd75a9d6808c0ecca6dfe1386f42c1964
-MD5 81e9591400fc9b5fc65742adf6da5020 ChangeLog 11301
-RMD160 2b26ec294e554c8e8a942adace7403507e240556 ChangeLog 11301
-SHA256 dff45ccd7d9004015aede1fc68a28edcd75a9d6808c0ecca6dfe1386f42c1964 ChangeLog 11301
+EBUILD gzip-1.3.7.ebuild 1477 RMD160 e18abbd12ec0c13c4d8d667a5ba1bc65146c489d SHA1 367b161dcb03424638e2e8c9baf2b55ac330e541 SHA256 4d8a7c1cfb611a76dabaa40455ef014b1d66208039e400fbe904d091dad30019
+MD5 a088c3cb93d54122ad5cc970f1f464dc gzip-1.3.7.ebuild 1477
+RMD160 e18abbd12ec0c13c4d8d667a5ba1bc65146c489d gzip-1.3.7.ebuild 1477
+SHA256 4d8a7c1cfb611a76dabaa40455ef014b1d66208039e400fbe904d091dad30019 gzip-1.3.7.ebuild 1477
+MISC ChangeLog 11545 RMD160 adb4258126e97b1ecb2f232cdca495dec51272cb SHA1 c2da76faa9f1dc10c2f92cb38b5acf47cdbb7495 SHA256 297e9354be898f0a9ce356abb4771763560db1dede546a7aab0068ade2a83407
+MD5 0371c6c5a87a4e79c6453db7a53b0c93 ChangeLog 11545
+RMD160 adb4258126e97b1ecb2f232cdca495dec51272cb ChangeLog 11545
+SHA256 297e9354be898f0a9ce356abb4771763560db1dede546a7aab0068ade2a83407 ChangeLog 11545
MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92
MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 metadata.xml 164
MD5 b88cd4d307670111059400e1132d179f files/digest-gzip-1.3.5-r9 232
RMD160 9ce0351305c191b5400cf658faf4b282dad18b42 files/digest-gzip-1.3.5-r9 232
SHA256 0bfcc4dcd48430f1951f1452812e9809725069fb910d5234a32d8788ba84fa96 files/digest-gzip-1.3.5-r9 232
+MD5 ae71f2aacfbb111ee11dc952e5599493 files/digest-gzip-1.3.7 232
+RMD160 4f51ca8f96b802309cd0ee581c84fd9678b0523a files/digest-gzip-1.3.7 232
+SHA256 c3e7b5534001d9a5867f317b7f7c56b625f8c8696800fb8d9b8282741f1c2fc4 files/digest-gzip-1.3.7 232
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
-iD8DBQFFVZmxamhnQswr0vIRApifAKCVQadncWUy70/B30Oi875cQVZBywCffkK5
-14hyK7GxDjpIBdW3rWa0S4A=
-=7524
+iD8DBQFFeB2zamhnQswr0vIRAoLyAJ9ItC5gF/XhveGR6HewZv2lKyFNrQCbBWzS
+fwSR6GpyCtdhlED8WgdrPgs=
+=6AGf
-----END PGP SIGNATURE-----
--- /dev/null
+MD5 d6c7f79bc445fbd12136662623de7edf gzip-1.3.7.tar.gz 543619
+RMD160 71e48e6d6b6f98f426fef2e965e4a24d7018be60 gzip-1.3.7.tar.gz 543619
+SHA256 1e18a88d7188e59bdabe48a19c06ddd2ff3bfd20d9bc3360df27f7be722bac5a gzip-1.3.7.tar.gz 543619
--- /dev/null
+http://bugs.gentoo.org/145511
+
+--- gzip-1.3.5/gzip.h
++++ gzip-1.3.5/gzip.h
+@@ -198,6 +198,8 @@
+ extern int to_stdout; /* output to stdout (-c) */
+ extern int save_orig_name; /* set if original name must be saved */
+
++#define MIN(a,b) ((a) <= (b) ? (a) : (b))
++
+ #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0))
+ #define try_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(1))
+
+--- gzip-1.3.5/unlzh.c
++++ gzip-1.3.5/unlzh.c
+@@ -149,13 +149,17 @@
+ unsigned i, k, len, ch, jutbits, avail, nextcode, mask;
+
+ for (i = 1; i <= 16; i++) count[i] = 0;
+- for (i = 0; i < (unsigned)nchar; i++) count[bitlen[i]]++;
++ for (i = 0; i < (unsigned)nchar; i++) {
++ if (bitlen[i] > 16)
++ gzip_error("Bad table (case a)\n");
++ else count[bitlen[i]]++;
++ }
+
+ start[1] = 0;
+ for (i = 1; i <= 16; i++)
+ start[i + 1] = start[i] + (count[i] << (16 - i));
+- if ((start[17] & 0xffff) != 0)
+- gzip_error ("Bad table\n");
++ if ((start[17] & 0xffff) != 0 || tablebits > 16) /* 16 for weight below */
++ gzip_error ("Bad table (case b)\n");
+
+ jutbits = 16 - tablebits;
+ for (i = 1; i <= (unsigned)tablebits; i++) {
+@@ -169,8 +173,8 @@
+
+ i = start[tablebits + 1] >> jutbits;
+ if (i != 0) {
+- k = 1 << tablebits;
+- while (i != k) table[i++] = 0;
++ k = MIN(1 << tablebits, DIST_BUFSIZE);
++ while (i < k) table[i++] = 0;
+ }
+
+ avail = nchar;
+@@ -179,6 +183,7 @@
+ if ((len = bitlen[ch]) == 0) continue;
+ nextcode = start[len] + weight[len];
+ if (len <= (unsigned)tablebits) {
++ nextcode = MIN(nextcode, DIST_BUFSIZE);
+ for (i = start[len]; i < nextcode; i++) table[i] = ch;
+ } else {
+ k = start[len];
+@@ -218,7 +223,7 @@
+ for (i = 0; i < 256; i++) pt_table[i] = c;
+ } else {
+ i = 0;
+- while (i < n) {
++ while (i < MIN(n,NPT)) {
+ c = bitbuf >> (BITBUFSIZ - 3);
+ if (c == 7) {
+ mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3);
+@@ -228,7 +233,7 @@
+ pt_len[i++] = c;
+ if (i == i_special) {
+ c = getbits(2);
+- while (--c >= 0) pt_len[i++] = 0;
++ while (--c >= 0 && i < NPT) pt_len[i++] = 0;
+ }
+ }
+ while (i < nn) pt_len[i++] = 0;
+@@ -248,7 +253,7 @@
+ for (i = 0; i < 4096; i++) c_table[i] = c;
+ } else {
+ i = 0;
+- while (i < n) {
++ while (i < MIN(n,NC)) {
+ c = pt_table[bitbuf >> (BITBUFSIZ - 8)];
+ if (c >= NT) {
+ mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
+@@ -256,14 +261,14 @@
+ if (bitbuf & mask) c = right[c];
+ else c = left [c];
+ mask >>= 1;
+- } while (c >= NT);
++ } while (c >= NT && (mask || c != left[c]));
+ }
+ fillbuf((int) pt_len[c]);
+ if (c <= 2) {
+ if (c == 0) c = 1;
+ else if (c == 1) c = getbits(4) + 3;
+ else c = getbits(CBIT) + 20;
+- while (--c >= 0) c_len[i++] = 0;
++ while (--c >= 0 && i < NC) c_len[i++] = 0;
+ } else c_len[i++] = c - 2;
+ }
+ while (i < NC) c_len[i++] = 0;
+@@ -292,7 +297,7 @@
+ if (bitbuf & mask) j = right[j];
+ else j = left [j];
+ mask >>= 1;
+- } while (j >= NC);
++ } while (j >= NC && (mask || j != left[j]));
+ }
+ fillbuf((int) c_len[j]);
+ return j;
+@@ -309,7 +314,7 @@
+ if (bitbuf & mask) j = right[j];
+ else j = left [j];
+ mask >>= 1;
+- } while (j >= NP);
++ } while (j >= NP && (mask || j != left[j]));
+ }
+ fillbuf((int) pt_len[j]);
+ if (j != 0) j = ((unsigned) 1 << (j - 1)) + getbits((int) (j - 1));
+@@ -356,7 +361,7 @@
+ while (--j >= 0) {
+ buffer[r] = buffer[i];
+ i = (i + 1) & (DICSIZ - 1);
+- if (++r == count) return r;
++ if (++r >= count) return r;
+ }
+ for ( ; ; ) {
+ c = decode_c();
+@@ -366,14 +371,14 @@
+ }
+ if (c <= UCHAR_MAX) {
+ buffer[r] = c;
+- if (++r == count) return r;
++ if (++r >= count) return r;
+ } else {
+ j = c - (UCHAR_MAX + 1 - THRESHOLD);
+ i = (r - decode_p() - 1) & (DICSIZ - 1);
+ while (--j >= 0) {
+ buffer[r] = buffer[i];
+ i = (i + 1) & (DICSIZ - 1);
+- if (++r == count) return r;
++ if (++r >= count) return r;
+ }
+ }
+ }
+--- gzip-1.3.5/unpack.c
++++ gzip-1.3.5/unpack.c
+@@ -13,7 +13,6 @@
+ #include "gzip.h"
+ #include "crypt.h"
+
+-#define MIN(a,b) ((a) <= (b) ? (a) : (b))
+ /* The arguments must not have side effects. */
+
+ #define MAX_BITLEN 25
+@@ -133,7 +132,7 @@
+ /* Remember where the literals of this length start in literal[] : */
+ lit_base[len] = base;
+ /* And read the literals: */
+- for (n = leaves[len]; n > 0; n--) {
++ for (n = leaves[len]; n > 0 && base < LITERALS; n--) {
+ literal[base++] = (uch)get_byte();
+ }
+ }
+@@ -169,7 +168,7 @@
+ prefixp = &prefix_len[1<<peek_bits];
+ for (len = 1; len <= peek_bits; len++) {
+ int prefixes = leaves[len] << (peek_bits-len); /* may be 0 */
+- while (prefixes--) *--prefixp = (uch)len;
++ while (prefixes-- && prefixp > prefix_len) *--prefixp = (uch)len;
+ }
+ /* The length of all other codes is unknown: */
+ while (prefixp > prefix_len) *--prefixp = 0;
--- /dev/null
+Ripped from Fedora.
+Include stack markings in the asm code so the final binary
+isn't assumed to require executable markings.
+--- gzip-1.3.7/lib/match.c
++++ gzip-1.3.7/lib/match.c
+@@ -54,6 +54,9 @@
+ .globl _match_init
+ .globl _longest_match
+
++ .section .note.GNU-stack, "", @progbits
++ .previous
++
+ .text
+
+ _match_init:
--- /dev/null
+--- gzip-1.3.7/Makefile.in
++++ gzip-1.3.7/Makefile.in
+@@ -916,15 +916,19 @@
+ transform='$(transform)'; \
+ test "X$$prog" = "X$$prog_ext" || \
+ transform="$$transform"';s/$$/$(EXEEXT)/'; \
+- source=$(DESTDIR)$(bindir)/`echo "$$prog"|sed "$$transform"`; \
++ sourcebase=`echo "$$prog"|sed "$$transform"`; \
++ source=$(DESTDIR)$(bindir)/$$sourcebase; \
+ for alias in $$aliases; do \
+ dest=$(DESTDIR)$(bindir)/`echo "$$alias"|sed "$$transform"`; \
+ (set -x; \
+ rm -f "$$dest" && \
+ case $@ in \
+ install-exec-hook) \
+- for ln in ln "$(LN_S)"; do \
+- $$ln "$$source" "$$dest" && break; \
++ for ln in "$(LN_S)"; do \
++ case $$ln in \
++ ln) $$ln "$$source" "$$dest" && break;; \
++ *) $$ln "$$sourcebase" "$$dest" && break;; \
++ esac; \
+ done;; \
+ esac \
+ ) || exit; \
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/gzip/gzip-1.3.7.ebuild,v 1.1 2006/12/07 13:56:37 vapier Exp $
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Standard GNU compressor"
+HOMEPAGE="http://www.gnu.org/software/gzip/gzip.html"
+SRC_URI="ftp://alpha.gnu.org/gnu/gzip/${P}.tar.gz
+ mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="nls static pic"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+PROVIDE="virtual/gzip"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ #epatch "${FILESDIR}"/${PN}-1.3.7-CVE-2006-4334-8.2.patch
+ epatch "${FILESDIR}"/${PN}-1.3.5-znew-tempfile-2.patch
+ epatch "${FILESDIR}"/${PN}-1.3.7-asm-execstack.patch
+ #epatch "${FILESDIR}"/${PN}-1.3.5-rsync.patch
+ epatch "${FILESDIR}"/${PN}-1.3.5-alpha.patch
+ epatch "${FILESDIR}"/${PN}-1.3.7-install-symlinks.patch
+}
+
+src_compile() {
+ use static && append-flags -static
+ # avoid text relocation in gzip
+ use pic && export DEFS="NO_ASM"
+ econf $(use_enable nls) || die
+ emake || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc ChangeLog NEWS README THANKS TODO
+ docinto txt
+ dodoc algorithm.doc gzip.doc
+
+ # keep most things in /usr, just the fun stuff in /
+ dodir /bin
+ mv "${D}"/usr/bin/{gunzip,gzip,zcat} "${D}"/bin/ || die
+ dosym /bin/gunzip /usr/bin/gunzip || die
+}