aboutsummaryrefslogtreecommitdiffstats
path: root/testing/afl/APKBUILD
blob: 443666117db241d29df785f43ce49a52181d8f6e (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
# Contributor: Marian <m.buschsieweke@uni-muenster.de>
# Maintainer: Marian <m.buschsieweke@uni-muenster.de>
pkgname=afl
pkgver=2.41b
pkgrel=0
pkgdesc="American fuzzy lop - a fuzzer relying on genetic algorithms instead brute force"
url="http://lcamtuf.coredump.cx/afl/"
arch="all"
license="ASL 2.0"
depends="clang llvm"
makedepends="clang-dev llvm-dev"
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
	done
}

package() {
	cd "$builddir"

	make AFL_NO_X86=1 PREFIX=/usr DESTDIR="$pkgdir" install
	install -Dm644 llvm_mode/README.llvm \
		"$pkgdir"/usr/share/doc/$pkgname/README.llvm_mode

	# Only install the llvm_mode of afl. Even though this is still
	# considered experimental it is faster than the gcc mode and
	# portable to non-x86 platforms.
	rm -f "$pkgdir/usr/bin/afl-clang" "$pkgdir/usr/bin/afl-clang++" \
		"$pkgdir/usr/bin/afl-gcc" "$pkgdir/usr/bin/afl-g++"

	if [ "$CARCH" = "ppc64le" ]; then
		rm -f "$pkgdir"/usr/share/afl/testcases/others/elf/small_exec.elf
	fi
}

sha512sums="e1af6e6c4dedcc3f7f17857bf45a2efeb64bdc51633003c5bd700c51eb30c72f1f4e7fed5f6570ec98ccbd22b54dbcf08cc3faec4d28004fe0fa863a4d7ea90f  afl-2.41b.tgz"