summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Tse <liquidx@gentoo.org>2003-10-15 08:27:52 +0000
committerAlastair Tse <liquidx@gentoo.org>2003-10-15 08:27:52 +0000
commitfeb00db964a20e8fb6b296df4685cc183a587bf7 (patch)
treecd374b6b85f500b2d0ffbdb7c95f101f16c97e70 /app-arch
parentadd bzip2 support (diff)
downloadgentoo-2-feb00db964a20e8fb6b296df4685cc183a587bf7.tar.gz
gentoo-2-feb00db964a20e8fb6b296df4685cc183a587bf7.tar.bz2
gentoo-2-feb00db964a20e8fb6b296df4685cc183a587bf7.zip
add bzip2 support
Diffstat (limited to 'app-arch')
-rw-r--r--app-arch/rpm2targz/ChangeLog7
-rw-r--r--app-arch/rpm2targz/Manifest4
-rw-r--r--app-arch/rpm2targz/files/digest-rpm2targz-9.0-r21
-rw-r--r--app-arch/rpm2targz/files/rpm2targz-9.0-bzip2_rpm2targz.patch62
-rw-r--r--app-arch/rpm2targz/rpm2targz-9.0-r2.ebuild43
5 files changed, 114 insertions, 3 deletions
diff --git a/app-arch/rpm2targz/ChangeLog b/app-arch/rpm2targz/ChangeLog
index 72ab5d370361..abee1f8be9c4 100644
--- a/app-arch/rpm2targz/ChangeLog
+++ b/app-arch/rpm2targz/ChangeLog
@@ -1,7 +1,12 @@
# ChangeLog for app-arch/rpm2targz
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/rpm2targz/ChangeLog,v 1.20 2003/09/30 17:49:04 kumba Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/rpm2targz/ChangeLog,v 1.21 2003/10/15 08:27:47 liquidx Exp $
+*rpm2targz-9.0-r2 (15 Oct 2003)
+
+ 15 Oct 2003; Alastair Tse <liquidx@gentoo.org> rpm2targz-9.0-r2.ebuild,
+ files/rpm2targz-9.0-bzip2_rpm2targz.patch:
+ patch for bzip2 support for rpm2targz contributed by phceac@yahoo.com (#31164)
*rpm2targz-9.0-r1 (26 Jun 2003)
diff --git a/app-arch/rpm2targz/Manifest b/app-arch/rpm2targz/Manifest
index a611f9b9ca8b..59815ace68b2 100644
--- a/app-arch/rpm2targz/Manifest
+++ b/app-arch/rpm2targz/Manifest
@@ -1,8 +1,8 @@
-MD5 f70065bad12631d26abc019d4a67ffc4 ChangeLog 2819
+MD5 b6934fe68d5af29f23b1bd24183c5963 ChangeLog 3054
MD5 8f906ffe0aa837e5e26fe03af3043461 metadata.xml 219
MD5 df73a8cd1903693cb902a00f3f2dcab0 rpm2targz-8.0.ebuild 991
MD5 c61a8e8b9398f01ba8b5dba5a0ab10c7 rpm2targz-9.0-r1.ebuild 1065
-MD5 b55d4ec373b4b33ebc70b73ec9026b06 rpm2targz-9.0-r2.ebuild 1162
+MD5 285339d468bfb53d7d461af9341c500a rpm2targz-9.0-r2.ebuild 1163
MD5 c32983534d5230f5b4aaf29948365173 rpm2targz-9.0.ebuild 883
MD5 242377a7ef1b45e246460cbbf4bb6984 files/digest-rpm2targz-8.0 163
MD5 d0f2d521642a49ec038e441268ab6480 files/digest-rpm2targz-9.0 63
diff --git a/app-arch/rpm2targz/files/digest-rpm2targz-9.0-r2 b/app-arch/rpm2targz/files/digest-rpm2targz-9.0-r2
new file mode 100644
index 000000000000..154805e3f598
--- /dev/null
+++ b/app-arch/rpm2targz/files/digest-rpm2targz-9.0-r2
@@ -0,0 +1 @@
+MD5 7b8ba680dcbe7e1e4e349698400bcea6 rpm2targz-9.0.tar.gz 2639
diff --git a/app-arch/rpm2targz/files/rpm2targz-9.0-bzip2_rpm2targz.patch b/app-arch/rpm2targz/files/rpm2targz-9.0-bzip2_rpm2targz.patch
new file mode 100644
index 000000000000..4204d82a654e
--- /dev/null
+++ b/app-arch/rpm2targz/files/rpm2targz-9.0-bzip2_rpm2targz.patch
@@ -0,0 +1,62 @@
+--- rpm2targz 2003-10-15 00:46:48.000000000 +0200
++++ rpm2targz.new 2003-10-15 01:39:00.000000000 +0200
+@@ -21,6 +21,8 @@
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+
++# debug switch to allow to bypass use of rpm2cpio provided by the rpm package
++USERPM2CPIO=true
+ if [ "$TMPDIR" = "" ]; then
+ TMPDIR=/tmp
+ fi
+@@ -46,7 +48,7 @@
+ fi
+ for i in $* ; do
+ if [ ! "$1" = "$*" ]; then
+- echo -n "Processing file: $i"
++ echo "Processing file: $i"
+ fi
+ rm -rf $TMPDIR/rpm2targz$COOKIE # clear the way, just in case of mischief
+ mkdir $TMPDIR/rpm2targz$COOKIE
+@@ -68,7 +70,7 @@
+ fi
+
+ ofn=$TMPDIR/rpm2targz$COOKIE/`basename $i .rpm`.cpio
+- if which rpm2cpio 1> /dev/null 2> /dev/null ; then
++ if $USERPM2CPIO && which rpm2cpio 1> /dev/null 2> /dev/null ; then
+ rpm2cpio $i > $ofn 2> /dev/null
+ if [ ! $? = 0 ]; then
+ echo "... rpm2cpio failed. (maybe $i is not an RPM?)"
+@@ -76,7 +78,31 @@
+ continue
+ fi
+ else # less reliable than rpm2cpio...
+- dd ibs=`rpmoffset < $i` skip=1 if=$i 2> /dev/null | gzip -dc > $ofn
++ # get offset of start of payload
++ PAYLOADOFFSET=`rpmoffset < $i`
++ #identify compression
++ PAYLOADHEAD=`dd ibs=${PAYLOADOFFSET} skip=1 if=$i 2> /dev/null | dd bs=10 count=1 2> /dev/null`
++ if echo ${PAYLOADHEAD} | grep -e $'^\037\213' > /dev/null ; then
++ echo "found gzip magic bytes"
++ decomp="gzip"
++ elif echo ${PAYLOADHEAD} | grep -e "^BZh" > /dev/null ; then
++ echo "found bzip magic bytes"
++ decomp="bzip2"
++ else
++ echo " $i - no magic compression identifier found - skipping file"
++ ( cd $TMPDIR ; rm -rf rpm2targz$COOKIE )
++ continue
++ fi
++ echo -n " trying to decompress with ${decomp}..."
++ dd ibs=`rpmoffset < $i` skip=1 if=$i 2> /dev/null | ${decomp} -dc > $ofn 2> /dev/null
++ if [ $? = 0 ]; then
++ echo " OK"
++ else
++ echo " FAILED"
++ echo " $i failed to decompress - skipping file"
++ ( cd $TMPDIR ; rm -rf rpm2targz$COOKIE )
++ continue
++ fi
+ fi
+ DEST=$TMPDIR/rpm2targz$COOKIE
+ #if [ "$isSource" = "1" ]; then
diff --git a/app-arch/rpm2targz/rpm2targz-9.0-r2.ebuild b/app-arch/rpm2targz/rpm2targz-9.0-r2.ebuild
new file mode 100644
index 000000000000..f70f7610e2ed
--- /dev/null
+++ b/app-arch/rpm2targz/rpm2targz-9.0-r2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/rpm2targz/rpm2targz-9.0-r2.ebuild,v 1.1 2003/10/15 08:27:47 liquidx Exp $
+
+inherit eutils
+
+DESCRIPTION="Convert a .rpm file to a .tar.gz archive"
+HOMEPAGE="http://www.slackware.com/config/packages.php"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="ia64 x86 sparc ppc alpha hppa amd64 ~mips"
+
+# NOTE: rpm2targz autodetects rpm2cpio at runtime, and uses it if available,
+# so we don't explicitly set it as a dependency.
+DEPEND="virtual/glibc
+ sys-apps/cpio
+ sys-apps/file"
+
+RDEPEND="$DEPEND sys-apps/util-linux sys-apps/which"
+
+S=${WORKDIR}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ # makes rpm2targz extract in current dir
+ epatch ${FILESDIR}/${P}-gentoo.patch
+ # adds bzip2 detection (#23249)
+ epatch ${FILESDIR}/${P}-bzip2.patch
+ # adds bzip2 decompression to rpm2targz (#31164)
+ epatch ${FILESDIR}/${P}-bzip2_rpm2targz.patch
+}
+
+src_compile() {
+ ${CC:-gcc} ${CFLAGS} -o rpmoffset rpmoffset.c || die
+}
+
+src_install() {
+ dobin rpmoffset rpm2targz
+ dodoc rpm2targz.README
+}