updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / radare-hg / PKGBUILD
blobef25af8910ec5cf1d35f26de699dfd8b93db8ff0
1 # Contributor: Jens Pranaitis <jens@jenux.homelinux.org>
2 # Contributor: Shino <shino@jenux.homelinux.org>
3 # Contributor: phara0h <jan@das-labor.org>
5 pkgname="radare-hg"
6 pkgver=1292
7 pkgrel=1
8 pkgdesc="A collection of tools with the aim to create a complete, portable, multi-architecture, unix-like toolchain for reverse engineering."
9 arch=('i686' 'x86_64')
10 url="http://radare.org"
11 license=('GPL2')
12 depends=('bash' 'perl' 'python2' 'vala')
13 makedepends=('mercurial')
14 optdeps=('vte: GUI support')
15 provides=("radare")
16 conflicts=("radare")
17 source=()
18 md5sums=()
20 _hgroot="http://hg.youterm.com"
21 _hgrepo="radare"
23 build() {
24         cd ${srcdir}
26   if [ -d ${_hgrepo}-build ]; then
27     msg "Removing old build-dir"
28     rm -rf ${_hgrepo}-build
29   fi
31         hg clone ${_hgrepo} ${_hgrepo}-build
32         cd ${_hgrepo}-build
33         
34         #Python2 patches
35         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./gui/wscript_build
36         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/arch/arm/aasm/wscript_build
37         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/javasm/wscript_build
38         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/plug/hack/wscript_build
39         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/plug/io/wscript_build
40         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/rabin/wscript_build
41         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/radiff/wscript_build
42         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/rahash/wscript_build
43         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/rasc/wscript_build
44         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/rasm/wscript_build
45         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/rsc/wscript_build
46         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./src/wscript_build
47         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./vala/grava/wscript_build
48         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./vala/wscript_build
49         sed -i -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" ./wscript
51         msg "Configuring..."
52         ./configure --prefix=/usr
54         msg "Building..."
55         make
58 package() {
59         cd ${srcdir}/${_hgrepo}-build
61         msg "Installing..."
62         make DESTDIR=${pkgdir} install
64         install -d "${pkgdir}/usr/share/man/man1"
65         install -m644 man/* "${pkgdir}/usr/share/man/man1"
67         sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
68                -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
69                $(find $pkgdir -name '*.py')
71         cd ${srcdir}
72         rm -rf ${_hgrepo}-build