APKBUILD 1.43 KB
Newer Older
1 2
# Contributor: Marian <marian.buschsieweke@ovgu.de>
# Maintainer: Marian <marian.buschsieweke@ovgu.de>
Marian Buschsieweke's avatar
Marian Buschsieweke committed
3
pkgname=afl
4
pkgver=2.52b
5
pkgrel=0
Jakub Jirutka's avatar
Jakub Jirutka committed
6
pkgdesc="American fuzzy lop - a fuzzer relying on genetic algorithms instead brute force"
Marian Buschsieweke's avatar
Marian Buschsieweke committed
7 8
url="http://lcamtuf.coredump.cx/afl/"
arch="all"
9
license="Apache-2.0"
10 11
depends="clang llvm"
makedepends="clang-dev llvm-dev"
Marian Buschsieweke's avatar
Marian Buschsieweke committed
12
subpackages="$pkgname-doc"
13
source="http://lcamtuf.coredump.cx/$pkgname/releases/$pkgname-$pkgver.tgz"
Jakub Jirutka's avatar
Jakub Jirutka committed
14
builddir="$srcdir/$pkgname-$pkgver"
Marian Buschsieweke's avatar
Marian Buschsieweke committed
15 16

build() {
Jakub Jirutka's avatar
Jakub Jirutka committed
17 18
	local dir; for dir in "$builddir" "$builddir"/llvm_mode; do
		make -C "$dir" PREFIX=/usr CC=clang AFL_NO_X86=1
19
	done
Marian Buschsieweke's avatar
Marian Buschsieweke committed
20 21 22
}

package() {
23
	cd "$builddir"
Jakub Jirutka's avatar
Jakub Jirutka committed
24 25

	make AFL_NO_X86=1 PREFIX=/usr DESTDIR="$pkgdir" install
26
	install -Dm644 llvm_mode/README.llvm \
Jakub Jirutka's avatar
Jakub Jirutka committed
27
		"$pkgdir"/usr/share/doc/$pkgname/README.llvm_mode
28 29

	# Only install the llvm_mode of afl. Even though this is still
30 31
	# considered experimental it is faster than the gcc mode and
	# portable to non-x86 platforms.
Jakub Jirutka's avatar
Jakub Jirutka committed
32 33
	rm -f "$pkgdir/usr/bin/afl-clang" "$pkgdir/usr/bin/afl-clang++" \
		"$pkgdir/usr/bin/afl-gcc" "$pkgdir/usr/bin/afl-g++"
34

35 36 37 38 39 40
	# small_exec.elf is an Intel binary which causes an error during
	# the strip() process on non Intel plattforms.
	case "$CARCH" in
		x86*) ;;
		*) rm -f "$pkgdir"/usr/share/afl/testcases/others/elf/small_exec.elf ;;
	esac
Marian Buschsieweke's avatar
Marian Buschsieweke committed
41 42
}

43
sha512sums="30d4526440cff109ef2a014278f52a04b1b33560b6ab7d7f59e1516655858ffb36dac81963d2d8f214984776742ca9a7942c27c8fb61f7eb70b5b35cd029008f  afl-2.52b.tgz"