summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Lichtblau2014-11-28 20:17:14 +0100
committerJaroslav Lichtblau2014-11-28 20:17:14 +0100
commit47797ff397b05ab3dff9ec3610b1f048d5f30c50 (patch)
treefd39c0f92da42413fcdba061a4a3e06b6e2d36cc
downloadaur-47797ff397b05ab3dff9ec3610b1f048d5f30c50.tar.gz
Initial PKGBUILD status as of 28.11.2014
-rw-r--r--.AURINFO12
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD19
-rwxr-xr-xpkgextract.sh43
4 files changed, 87 insertions, 0 deletions
diff --git a/.AURINFO b/.AURINFO
new file mode 100644
index 00000000000..f1a5874ab87
--- /dev/null
+++ b/.AURINFO
@@ -0,0 +1,12 @@
+pkgbase = pkgextract
+ pkgdesc = This script extracts rpm and deb archives
+ pkgver = 0.2
+ pkgrel = 3
+ url = http://www.archlinux.org
+ arch = any
+ license = unknown
+ depends = libarchive
+ source = pkgextract.sh
+
+pkgname = pkgextract
+
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..8ee915e4a62
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = pkgextract
+ pkgdesc = This script extracts rpm and deb archives
+ pkgver = 0.2
+ pkgrel = 3
+ url = http://www.archlinux.org
+ arch = any
+ license = unknown
+ depends = libarchive
+ source = pkgextract.sh
+ md5sums = 5726aa04ab52bdf1a1ea7c1954e20f85
+
+pkgname = pkgextract
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6a99ee037f0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,19 @@
+# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
+# Contributor: Baptiste Daroussin <baptiste.daroussin@gmail.com>
+
+pkgname=pkgextract
+pkgver=0.2
+pkgrel=3
+pkgdesc="This script extracts rpm and deb archives"
+arch=('any')
+url="http://www.archlinux.org"
+license=('unknown')
+depends=('libarchive')
+source=(pkgextract.sh)
+md5sums=('5726aa04ab52bdf1a1ea7c1954e20f85')
+
+package() {
+ cd "${srcdir}"
+
+ install -D -m755 "${srcdir}"/pkgextract.sh "${pkgdir}"/usr/bin/pkgextract.sh
+}
diff --git a/pkgextract.sh b/pkgextract.sh
new file mode 100755
index 00000000000..5504ae4022c
--- /dev/null
+++ b/pkgextract.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+extract_rpm ()
+{
+ RPM=$1
+ 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`
+
+ 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`
+ hdrsize=`expr 8 + 16 \* $il + $dl`
+ o=`expr $o + $hdrsize`
+ dd if=$pkg ibs=$o skip=1 2>/dev/null | bsdtar -xf -
+}
+extract_deb ()
+{
+ DEB=$1
+ bsdtar -xf ${DEB} data.tar.gz
+ bsdtar -xf data.tar.gz
+ rm data.tar.gz
+}
+pkg=$1
+if [ "$pkg" = "" -o ! -e "$pkg" ]; then
+ echo "no package supplied" 1>&2
+ exit 1
+fi
+ext=`echo $pkg | awk -F. '{ print $NF }'`
+case "$ext" in
+ rpm|RPM)
+ extract_rpm $pkg
+ ;;
+ deb|DEB)
+ extract_deb $pkg
+ ;;
+ *)
+ echo "Unknown package type: $pkg"
+ exit 1
+ esac