summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1223ab2d7a45c5605d56e9e74083ff05fbf10de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# with fixes by 0xAA <0xaa@dmg.sx>
pkgname="radare2-git"
pkgver=20160128.10200.ea70e2d
pkgrel=1
pkgdesc="Open-source tools to disasm, debug, analyze and manipulate binary files"
arch=('i686' 'x86_64')
url="http://radare.org"
license=('GPL3' 'LGPL3')
makedepends=('git')
depends=('capstone')
provides=('radare2')
conflicts=('radare2')

source=("$pkgname"::"git://github.com/radare/radare2.git")
md5sums=('SKIP')

pkgver () {
	_date=`date +"%Y%m%d"`
	cd "${srcdir}/${pkgname}"
	echo "$_date.$(git rev-list --count master).$(git rev-parse --short master)"
}

build() {
# not sure if those are still needed
	export CFLAGS="${CFLAGS//-fPIE -pie}"
	export CXXFLAGS="${CXXFLAGS//-fPIE -pie}"
	# this is actually needed to prevent linking against old system-wide r2 libs
	# you can comment this out, if you build in a clean environment
	export PKG_CONFIG_PATH="${srcdir}/${pkgname}/pkgcfg:${PKG_CONFIG_PATH}"

	cd ${srcdir}/${pkgname}
	# in theory explicitly passing --with-syscapstone shouldn't be needed
	# anymore, as ./sys/build.sh checks for a suitable system wide capstone
	# installation. Unfortunately linking syscapstone is broken and the
	# build system always clones capstone and links against this instead.
	#CFGARG="--with-syscapstone" ./sys/build.sh
	./autogen.sh
	./configure --with-syscapstone --with-openssl --prefix=/usr
	make
	#./sys/build.sh
}

package() {
	cd ${srcdir}/${pkgname}
	make DESTDIR=${pkgdir} install
	install -D -m644 man/* "${pkgdir}/usr/share/man/man1" 
	rm -rf ${srcdir}/${pkgname}
}