diff options
Diffstat (limited to 'extra/rpmextract')
-rw-r--r-- | extra/rpmextract/.footprint | 4 | ||||
-rw-r--r-- | extra/rpmextract/.md5sum | 2 | ||||
-rwxr-xr-x | extra/rpmextract/Pkgfile | 17 | ||||
-rw-r--r-- | extra/rpmextract/rpm2cpio | 26 | ||||
-rw-r--r-- | extra/rpmextract/rpmextract.sh | 6 |
5 files changed, 55 insertions, 0 deletions
diff --git a/extra/rpmextract/.footprint b/extra/rpmextract/.footprint new file mode 100644 index 000000000..7147e1abc --- /dev/null +++ b/extra/rpmextract/.footprint @@ -0,0 +1,4 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/rpm2cpio +-rwxr-xr-x root/root usr/bin/rpmextract.sh diff --git a/extra/rpmextract/.md5sum b/extra/rpmextract/.md5sum new file mode 100644 index 000000000..1828b4617 --- /dev/null +++ b/extra/rpmextract/.md5sum @@ -0,0 +1,2 @@ +57a4e99bedcefadc2f89006ce98d2e60 rpm2cpio +a7b527e4c210e66ef72532c606072e0d rpmextract.sh diff --git a/extra/rpmextract/Pkgfile b/extra/rpmextract/Pkgfile new file mode 100755 index 000000000..87811f9cc --- /dev/null +++ b/extra/rpmextract/Pkgfile @@ -0,0 +1,17 @@ +# Description: +# URL: http://checkgmail.sourceforge.net/ +# Maintainer: NutyX core team +# Packager: lesibel at free dot fr +# Depends on: libarchive + +name=rpmextract +version=1.0 +release=1 + +source=(rpmextract.sh rpm2cpio) + +build() { + install -d $PKG/usr/bin + install -m755 $SRC/rpmextract.sh $PKG/usr/bin/ + install -m755 $SRC/rpm2cpio $PKG/usr/bin/ +} diff --git a/extra/rpmextract/rpm2cpio b/extra/rpmextract/rpm2cpio new file mode 100644 index 000000000..a0eba2403 --- /dev/null +++ b/extra/rpmextract/rpm2cpio @@ -0,0 +1,26 @@ +#!/bin/sh + +pkg=$1 +if [ "$pkg" = "" -o ! -e "$pkg" ]; then + echo "no package supplied" 1>&2 + exit 1 +fi + +leadsize=96 +o=`expr $leadsize + 8` +set `od -j $o -N 8 -t u1 $pkg` +il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5` +dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9` +# echo "sig il: $il dl: $dl" + +sigsize=`expr 8 + 16 \* $il + $dl` +o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8` +set `od -j $o -N 8 -t u1 $pkg` +il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5` +dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9` +# echo "hdr il: $il dl: $dl" + +hdrsize=`expr 8 + 16 \* $il + $dl` +o=`expr $o + $hdrsize` + +dd if=$pkg ibs=$o skip=1 2>/dev/null diff --git a/extra/rpmextract/rpmextract.sh b/extra/rpmextract/rpmextract.sh new file mode 100644 index 000000000..47ad01dfe --- /dev/null +++ b/extra/rpmextract/rpmextract.sh @@ -0,0 +1,6 @@ +#!/bin/sh +if [ "$1" = "" -o ! -e "$1" ]; then + echo "no package supplied" 1>&2 + exit 1 +fi +rpm2cpio $1 | bsdtar -xf - |