summaryrefslogtreecommitdiffstats
path: root/extra/rpmextract
diff options
context:
space:
mode:
authorsibel <lesibel at free dot fr>2010-07-08 12:31:28 +0200
committersibel <lesibel at free dot fr>2010-07-08 12:31:28 +0200
commitaa7ce7edc786cab902e70e5e2d008422b877d998 (patch)
treea6a9dba2a0bcad11969119d2e3d6b53a3de13b4a /extra/rpmextract
parente9a02cfb305833d8f3686cb6403b12311224fff0 (diff)
downloadnutyx-pakxe-aa7ce7edc786cab902e70e5e2d008422b877d998.tar.gz
nutyx-pakxe-aa7ce7edc786cab902e70e5e2d008422b877d998.tar.bz2
nutyx-pakxe-aa7ce7edc786cab902e70e5e2d008422b877d998.tar.xz
nutyx-pakxe-aa7ce7edc786cab902e70e5e2d008422b877d998.zip
Ajout de rpmextract#1.0-1
Diffstat (limited to 'extra/rpmextract')
-rw-r--r--extra/rpmextract/.footprint4
-rw-r--r--extra/rpmextract/.md5sum2
-rwxr-xr-xextra/rpmextract/Pkgfile17
-rw-r--r--extra/rpmextract/rpm2cpio26
-rw-r--r--extra/rpmextract/rpmextract.sh6
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 -