summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-09-22 18:32:39 +0000
committerMike Frysinger <vapier@gentoo.org>2007-09-22 18:32:39 +0000
commit901158ce8337f3deabf20ce4ae20943f80f804d0 (patch)
tree6de4643bc4e67b9b9e0c820535699b7314a1434e /app-arch/bzip2
parentupdated desktop entry to match freedesktop spec (again) (diff)
downloadgentoo-2-901158ce8337f3deabf20ce4ae20943f80f804d0.tar.gz
gentoo-2-901158ce8337f3deabf20ce4ae20943f80f804d0.tar.bz2
gentoo-2-901158ce8337f3deabf20ce4ae20943f80f804d0.zip
Fix bashisms in bzgrep so it works with a POSIX shell #193365.
(Portage version: 2.1.3.9)
Diffstat (limited to 'app-arch/bzip2')
-rw-r--r--app-arch/bzip2/ChangeLog8
-rw-r--r--app-arch/bzip2/bzip2-1.0.4-r1.ebuild73
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch21
-rw-r--r--app-arch/bzip2/files/digest-bzip2-1.0.4-r13
4 files changed, 104 insertions, 1 deletions
diff --git a/app-arch/bzip2/ChangeLog b/app-arch/bzip2/ChangeLog
index fa418a9c0234..d57d0a24ff2f 100644
--- a/app-arch/bzip2/ChangeLog
+++ b/app-arch/bzip2/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-arch/bzip2
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.54 2007/04/18 14:37:31 eroyf Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.55 2007/09/22 18:32:38 vapier Exp $
+
+*bzip2-1.0.4-r1 (22 Sep 2007)
+
+ 22 Sep 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/bzip2-1.0.4-POSIX-shell.patch, +bzip2-1.0.4-r1.ebuild:
+ Fix bashisms in bzgrep so it works with a POSIX shell #193365.
18 Apr 2007; Alexander Færøy <eroyf@gentoo.org> bzip2-1.0.4.ebuild:
Stable on MIPS; bug #170457
diff --git a/app-arch/bzip2/bzip2-1.0.4-r1.ebuild b/app-arch/bzip2/bzip2-1.0.4-r1.ebuild
new file mode 100644
index 000000000000..30de467ed3f5
--- /dev/null
+++ b/app-arch/bzip2/bzip2-1.0.4-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/bzip2-1.0.4-r1.ebuild,v 1.1 2007/09/22 18:32:38 vapier Exp $
+
+inherit eutils multilib toolchain-funcs flag-o-matic
+
+DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
+HOMEPAGE="http://www.bzip.org/"
+SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
+
+LICENSE="BZIP2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="static"
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
+ epatch "${FILESDIR}"/${PN}-1.0.4-saneso.patch
+ epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
+ epatch "${FILESDIR}"/${PN}-1.0.3-shared-largefile-support.patch
+ epatch "${FILESDIR}"/${PN}-1.0.2-progress.patch
+ epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
+ epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
+ sed -i -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' Makefile || die "sed manpath"
+
+ # - Generate symlinks instead of hardlinks
+ # - pass custom variables to control libdir
+ sed -i \
+ -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
+ -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
+ Makefile || die "sed links"
+}
+
+src_compile() {
+ local makeopts="
+ CC=$(tc-getCC)
+ AR=$(tc-getAR)
+ RANLIB=$(tc-getRANLIB)
+ "
+ emake ${makeopts} -f Makefile-libbz2_so all || die "Make failed libbz2"
+ use static && append-flags -static
+ emake LDFLAGS="${LDFLAGS}" ${makeopts} all || die "Make failed"
+
+ if ! tc-is-cross-compiler ; then
+ make check || die "test failed"
+ fi
+}
+
+src_install() {
+ emake PREFIX="${D}"/usr LIBDIR=$(get_libdir) install || die
+
+ # move bzip2 binaries to /bin and use the shared libbz2.so
+ mkdir -p "${D}"/bin
+ mv "${D}"/usr/bin/* "${D}"/bin/
+ into /
+ if ! use static ; then
+ newbin bzip2-shared bzip2 || die "dobin shared"
+ fi
+ dolib.so "${S}"/libbz2.so.${PV} || die "dolib shared"
+ for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
+ dosym libbz2.so.${PV} /$(get_libdir)/${v}
+ done
+ gen_usr_ldscript libbz2.so
+
+ dodoc README* CHANGES bzip2.txt manual.*
+
+ dosym bzip2 /bin/bzcat
+ dosym bzip2 /bin/bunzip2
+}
diff --git a/app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch b/app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch
new file mode 100644
index 000000000000..b31cc061db6f
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch
@@ -0,0 +1,21 @@
+bzgrep uses !/bin/sh but then uses the bashism ${var//} so replace those
+with calls to sed so POSIX shells work
+
+http://bugs.gentoo.org/193365
+
+--- bzgrep
++++ bzgrep
+@@ -63,10 +63,9 @@
+ bzip2 -cdfq "$i" | $grep $opt "$pat"
+ r=$?
+ else
+- j=${i//\\/\\\\}
+- j=${j//|/\\|}
+- j=${j//&/\\&}
+- j=`printf "%s" "$j" | tr '\n' ' '`
++ # the backslashes here are doubled up as we have to escape each one for the
++ # shell and then escape each one for the sed expression
++ j=`printf "%s" "${i}" | sed -e 's:\\\\:\\\\\\\\:g' -e 's:[|]:\\\\|:g' -e 's:[&]:\\\\&:g' | tr '\n' ' '`
+ bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+ r=$?
+ fi
diff --git a/app-arch/bzip2/files/digest-bzip2-1.0.4-r1 b/app-arch/bzip2/files/digest-bzip2-1.0.4-r1
new file mode 100644
index 000000000000..a1b2965623ed
--- /dev/null
+++ b/app-arch/bzip2/files/digest-bzip2-1.0.4-r1
@@ -0,0 +1,3 @@
+MD5 fc310b254f6ba5fbb5da018f04533688 bzip2-1.0.4.tar.gz 841221
+RMD160 438365cb911ef84b3bd6643e0d39f6b7567f0447 bzip2-1.0.4.tar.gz 841221
+SHA256 f41c3898fbd53e68e0b052418960e538813cc98afcd72b2b604079d8de3e529c bzip2-1.0.4.tar.gz 841221