# Contributor: Marian # Maintainer: Marian pkgname=afl pkgver=2.49b 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++" # 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 } sha512sums="2edf84fe2398377b2259c5b56452014cd9168149f9da7cc180578817c7a89cb7ba536a09929b5bb0925b35f00022877693c70f0d0a13dfbef9d05ca75ad19017 afl-2.49b.tgz"