aboutsummaryrefslogtreecommitdiffstats
path: root/testing/afl/APKBUILD
blob: 21f590160ed23ef4fa484a94832a345e4b5bf7b8 (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
# Contributor: Marian <mari.hahn@wwu.de>
# Maintainer: Marian <mari.hahn@wwu.de>
pkgname=afl
pkgver=2.36b
pkgrel=0
pkgdesc="american fuzzy lop is a fuzzer relying on genetic algorithms instead brute force"
url="http://lcamtuf.coredump.cx/afl/"
arch="all"
license="ASL 2.0"
depends="clang clang-libs llvm llvm-libs"
depends_dev=""
makedepends="llvm-dev clang-dev"
install=""
subpackages="$pkgname-doc"
source="http://lcamtuf.coredump.cx/$pkgname/releases/$pkgname-$pkgver.tgz"
builddir="$srcdir/"$pkgname-$pkgver

build() {
	local dir=
	for dir in "$builddir" "$builddir"/llvm_mode; do
		make -C "$dir" PREFIX=/usr CC=clang \
			AFL_NO_X86=1 || return 1
	done
}

package() {
	cd "$builddir"
	make AFL_NO_X86=1 PREFIX=/usr \
		DESTDIR="$pkgdir" install || return 1
	install -Dm644 llvm_mode/README.llvm \
		"$pkgdir"/usr/share/doc/$pkgname/README.llvm_mode \
		|| return 1

	# Only install the llvm_mode of afl. Even though this is still
	# considered experimental it faster than the gcc mode and portable to
	# non-x86 platforms. Therefore only support the llvm_mode is the only
	# way to make this package work on all platforms.
	rm -f "${pkgdir}/usr/bin/afl-clang" "${pkgdir}/usr/bin/afl-clang++" \
		"${pkgdir}/usr/bin/afl-gcc" "${pkgdir}/usr/bin/afl-g++"
}

md5sums="d452e535828b16d986d6c0c9523277d4  afl-2.36b.tgz"
sha256sums="d36e2643eaddbd6e79a0dd835fd6e23428198a7a7cd640e96ccbf21d5bd8bcc8  afl-2.36b.tgz"
sha512sums="3b9f94be9ceb2df10417e480953c4c9878d8a667cf3a1dd45da8aeca43abcfc401b3e44af7c9045f5fcddbf772cd640c090db404e0d685d7b3cea06fc111932d  afl-2.36b.tgz"