Subject: [alpine-aports] [PATCH] testing/radare2: upgrade to 0.10.0

From: Valery Kartel <[email-masked]>
Date: Thu, 21 Jan 2016 18:49:13 +0200

need testing/capstone to build
---
 testing/radare2/APKBUILD                | 64 ++++++++++++++++++++-------------
 testing/radare2/anal_arm_cs_shift.patch |  7 ++++
 2 files changed, 47 insertions(+), 24 deletions(-)
 create mode 100644 testing/radare2/anal_arm_cs_shift.patch

diff --git a/testing/radare2/APKBUILD b/testing/radare2/APKBUILD
index 382f18a..a2f6039 100644
--- a/testing/radare2/APKBUILD
+++ b/testing/radare2/APKBUILD
@@ -1,38 +1,54 @@
+# Contributor: Valery Kartel <[email-masked]>
 # Contributor: stef <[email-masked]>
-# Maintainer:
+# Maintainer: Valery Kartel <[email-masked]>
 pkgname=radare2
-pkgver=0.9.8
+pkgver=0.10.0
 pkgrel=0
-pkgdesc="unix-like reverse-engineering framework and commandline tools"
+pkgdesc="An opensource, crossplatform reverse engineering framework"
 url="http://www.radare.org"
 arch="all"
-license="GPL3"
+license="LGPLv3"
 depends=""
 depends_dev=""
-makedepends="$depends_dev"
+makedepends="$depends_dev libzip-dev openssl-dev capstone-dev"
 install=""
-subpackages="$pkgname-dev"
-source="${pkgname}-${pkgver}.tar.gz::https://github.com/radare/radare2/archive/${pkgver}.tar.gz"
-_builddir="$srcdir/$pkgname-${pkgver}"
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://www.radare.org/get/$pkgname-$pkgver.tar.xz
+	anal_arm_cs_shift.patch"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
 prepare() {
-local i
-cd "$_builddir"
-for i in $source; do
-case $i in
-*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-esac
-done
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
 }
+
 build() {
-cd "$_builddir"
-./configure --prefix=/usr || exit 1
-make
+	cd "$_builddir"
+	./configure \
+		--prefix=/usr \
+		--with-syscapstone \
+		--with-openssl \
+		--with-syszip \
+	|| return 1
+	make || return 1
 }
+
 package() {
-cd "$_builddir"
-make DESTDIR="$pkgdir" install
-install -D -m644 man/* "$pkgdir/usr/share/man/man1/"
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install || return 1
+	find "$pkgdir" -name Makefile -delete
 }
-md5sums="f22ba519abc5fa38325cf75d900a9529  radare2-0.9.8.tar.gz"
-sha256sums="9bcc5d52c38b91a197eff193c2d49f99a7641ef7f9e64c63297bcecf5435fa2e  radare2-0.9.8.tar.gz"
-sha512sums="0846105724ee2566ddc2db203128f29bdfd900dba6c2c91d4743745f18ce5396bd1f4f6dba64e6792493a7ef1737fcc343e3f45d20190d53a8af837b4ce8d0b2  radare2-0.9.8.tar.gz"
+
+#TODO: build packages from R2PM package manager (src/radare2-*/binr/r2pm/d/*)
+
+md5sums="a134dde3dcfc040cb3bb93f8d04dec16  radare2-0.10.0.tar.xz
+664640d326fe15894891b98b629e0513  anal_arm_cs_shift.patch"
+sha256sums="77c2f0b97f1e094cd15c46776d6ee21a985b8328e5732e3a6f69c81e4850c9b6  radare2-0.10.0.tar.xz
+e45f8104bb4b3be17a2eda3028cf51fcfd99f346261ba6eddf6d90d160224a09  anal_arm_cs_shift.patch"
+sha512sums="e0c0382f0f0c6e78db07f947ddfa81c40e90346123aa458f7b4c1190cb39489f9ce0736c5f620531dd643214b5fbd31e23604f67feee497bbc07612f4a71af4a  radare2-0.10.0.tar.xz
+ab016177a1173ad647a0028f398c9daa8ef3f71fcc4c6c2cedd8ee9a60873dd68a5c825722b2d5916408c965a89a5a3099f5582a09457c9183c9dd14b20ee880  anal_arm_cs_shift.patch"
diff --git a/testing/radare2/anal_arm_cs_shift.patch b/testing/radare2/anal_arm_cs_shift.patch
new file mode 100644
index 0000000..727a37a
--- /dev/null
+++ b/testing/radare2/anal_arm_cs_shift.patch
@@ -0,0 +1,7 @@
+--- old/libr/anal/p/anal_arm_cs.c
++++ new/libr/anal/p/anal_arm_cs.c
+@@ -25,3 +25,3 @@
+ #define ISMEM(x) insn->detail->arm.operands[x].type == ARM_OP_MEM
+-#define LSHIFT(x) insn->detail->arm.operands[x].mem.lshift
++#define LSHIFT(x) insn->detail->arm.operands[x].shift.value
+ #define LSHIFT2(x) insn->detail->arm.operands[x].shift.value
-- 
2.7.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---