summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-arch/bzip2/ChangeLog9
-rw-r--r--app-arch/bzip2/bzip2-1.0.2-r4.ebuild78
-rw-r--r--app-arch/bzip2/files/1.0.2-NULL-ptr-check.patch27
-rw-r--r--app-arch/bzip2/files/1.0.2-makefile-CFLAGS.patch22
-rw-r--r--app-arch/bzip2/files/digest-bzip2-1.0.2-r41
5 files changed, 136 insertions, 1 deletions
diff --git a/app-arch/bzip2/ChangeLog b/app-arch/bzip2/ChangeLog
index 98a70d64d97d..91c2676feef5 100644
--- a/app-arch/bzip2/ChangeLog
+++ b/app-arch/bzip2/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-arch/bzip2
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.12 2004/08/15 07:00:16 lv Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.13 2004/12/26 21:48:30 vapier Exp $
+
+*bzip2-1.0.2-r4 (26 Dec 2004)
+
+ 26 Dec 2004; Mike Frysinger <vapier@gentoo.org>
+ +files/1.0.2-NULL-ptr-check.patch, +files/1.0.2-makefile-CFLAGS.patch,
+ +bzip2-1.0.2-r4.ebuild:
+ Add a NULL-ptr check fix by Mihai Limbasan #75305.
14 Aug 2004; Travis Tilley <lv@gentoo.org> bzip2-1.0.2-r3.ebuild:
added CONF_LIBDIR support for installing libbz2 to lib64/lib32
diff --git a/app-arch/bzip2/bzip2-1.0.2-r4.ebuild b/app-arch/bzip2/bzip2-1.0.2-r4.ebuild
new file mode 100644
index 000000000000..70f3b7eac7db
--- /dev/null
+++ b/app-arch/bzip2/bzip2-1.0.2-r4.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/bzip2-1.0.2-r4.ebuild,v 1.1 2004/12/26 21:48:30 vapier Exp $
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
+HOMEPAGE="http://sources.redhat.com/bzip2/"
+SRC_URI="ftp://sources.redhat.com/pub/bzip2/v102/${P}.tar.gz"
+
+LICENSE="BZIP2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="build static"
+
+DEPEND="virtual/libc"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${PV}-NULL-ptr-check.patch
+ epatch ${FILESDIR}/${PV}-makefile-CFLAGS.patch
+ sed -i -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' Makefile || die
+
+ use static && append-flags -static
+
+ # bzip2 will to run itself after it has built itself which we
+ # can't do if we are cross compiling. -solar
+ if [[ -x /bin/bzip2 ]] && [[ ${CTARGET} != ${CHOST} ]] ; then
+ sed -i -e 's:./bzip2 -:bzip2 -:g' Makefile || die
+ fi
+}
+
+src_compile() {
+ local makeopts="
+ CC=$(tc-getCC)
+ AR=$(tc-getAR)
+ RANLIB=$(tc-getRANLIB)
+ "
+ if ! use build ; then
+ emake ${makeopts} -f Makefile-libbz2_so all || die "Make failed libbz2"
+ fi
+ emake ${makeopts} all || die "Make failed"
+}
+
+src_install() {
+ if ! use build ; then
+ make PREFIX="${D}"/usr install || die
+ mv "${D}"/usr/bin "${D}"
+
+ # These are symlinks to bzip2 ...
+ for x in bunzip2 bzcat ; do
+ if [[ -f ${D}/bin/${x} ]] ; then
+ rm -f ${D}/bin/${x}
+ dosym bzip2 /bin/${x}
+ fi
+ done
+
+ [[ -z ${CONF_LIBDIR} ]] && CONF_LIBDIR="lib"
+ [[ ${CONF_LIBDIR} != "lib" ]] && mv ${D}/usr/lib ${D}/usr/${CONF_LIBDIR}
+ dolib.so ${S}/libbz2.so.${PV}
+ dosym libbz2.so.${PV} /usr/${CONF_LIBDIR}/libbz2.so.1.0
+ dosym libbz2.so.${PV} /usr/${CONF_LIBDIR}/libbz2.so
+ dosym libbz2.so.${PV} /usr/${CONF_LIBDIR}/libbz2.so.1
+
+ dodoc README CHANGES Y2K_INFO
+ docinto txt
+ dodoc *.txt
+ docinto ps
+ dodoc *.ps
+ dohtml manual_*.html
+ else
+ into /
+ dobin bzip2
+ dosym bzip2 /bin/bzcat
+ dosym bzip2 /bin/bunzip2
+ fi
+}
diff --git a/app-arch/bzip2/files/1.0.2-NULL-ptr-check.patch b/app-arch/bzip2/files/1.0.2-NULL-ptr-check.patch
new file mode 100644
index 000000000000..e35080f86db8
--- /dev/null
+++ b/app-arch/bzip2/files/1.0.2-NULL-ptr-check.patch
@@ -0,0 +1,27 @@
+Mihai Limbasan writes:
+BZ2_bzclose fails to perform a NULL pointer check before actually
+using the passed BZFILE * argument. The NULL check *is* performed but
+only after the argument is used for the first time, resulting in a
+potential NULL pointer dereference.
+
+http://bugs.gentoo.org/show_bug.cgi?id=75305
+
+Sent upstream but no feedback thus far :(
+diff -Naur bzip2-1.0.2-orig/bzlib.c bzip2-1.0.2/bzlib.c
+--- bzip2-1.0.2-orig/bzlib.c 2002-01-05 02:48:41.000000000 +0200
++++ bzip2-1.0.2/bzlib.c 2004-12-22 15:12:52.824593032 +0200
+@@ -1536,9 +1536,12 @@
+ void BZ_API(BZ2_bzclose) (BZFILE* b)
+ {
+ int bzerr;
+- FILE *fp = ((bzFile *)b)->handle;
+-
++ FILE *fp;
++
+ if (b==NULL) {return;}
++
++ fp = ((bzFile *)b)->handle;
++
+ if(((bzFile*)b)->writing){
+ BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
+ if(bzerr != BZ_OK){
diff --git a/app-arch/bzip2/files/1.0.2-makefile-CFLAGS.patch b/app-arch/bzip2/files/1.0.2-makefile-CFLAGS.patch
new file mode 100644
index 000000000000..bf7d430f9496
--- /dev/null
+++ b/app-arch/bzip2/files/1.0.2-makefile-CFLAGS.patch
@@ -0,0 +1,22 @@
+--- Makefile.orig 2004-12-26 16:30:06.354116536 -0500
++++ Makefile 2004-12-26 16:32:13.617769520 -0500
+@@ -9,7 +9,7 @@
+
+ # Suitably paranoid flags to avoid bugs in gcc-2.7
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
++CFLAGS+=-Wall -Winline -fno-strength-reduce $(BIGFILES)
+
+ # Where you want it installed when you do 'make install'
+ PREFIX=/usr
+--- Makefile-libbz2_so.orig 2004-12-26 16:32:23.972195408 -0500
++++ Makefile-libbz2_so 2004-12-26 16:32:34.835543928 -0500
+@@ -9,7 +9,7 @@
+ SHELL=/bin/sh
+ CC=gcc
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
++CFLAGS+=-fpic -fPIC -Wall -Winline -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
+
+ OBJS= blocksort.o \
+ huffman.o \
diff --git a/app-arch/bzip2/files/digest-bzip2-1.0.2-r4 b/app-arch/bzip2/files/digest-bzip2-1.0.2-r4
new file mode 100644
index 000000000000..5b1f375c39ee
--- /dev/null
+++ b/app-arch/bzip2/files/digest-bzip2-1.0.2-r4
@@ -0,0 +1 @@
+MD5 ee76864958d568677f03db8afad92beb bzip2-1.0.2.tar.gz 665198