# Contributor: Marian # Maintainer: Marian global pkgname := 'afl' global pkgver := '2.51b' global pkgrel := '0' global pkgdesc := '"American fuzzy lop - a fuzzer relying on genetic algorithms instead brute force'" global url := '"http://lcamtuf.coredump.cx/afl/'" global arch := '"all'" global license := '"ASL 2.0'" global depends := '"clang llvm'" global makedepends := '"clang-dev llvm-dev'" global subpackages := ""$pkgname-doc"" global source := ""http://lcamtuf.coredump.cx/$pkgname/releases/$pkgname-$pkgver.tgz"" global builddir := ""$srcdir/$pkgname-$pkgver"" proc build { var dir = ''; for dir in [$builddir "$builddir"/llvm_mode] { make -C $dir PREFIX=/usr CC=clang AFL_NO_X86=1 } } proc 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. matchstr $CARCH { x86* { } * { rm -f "$pkgdir"/usr/share/afl/testcases/others/elf/small_exec.elf } } } global sha512sums := '"fd67cf44b7336175041c2efa42b122e91f887f4a293618a59ea1e145ef47b9c0fab9fc274e4b94499c523bec950ff5a704050c3f4260e890ad97774c365a358c afl-2.51b.tgz'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(afl)} spids:[6])] spids: [6] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(2.51b)} spids:[9])] spids: [9] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[12])] spids: [12] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: { (DQ ("American fuzzy lop - a fuzzer relying on genetic algorithms instead brute force")) } spids: [15] ) ] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://lcamtuf.coredump.cx/afl/"))} spids: [20] ) ] spids: [20] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[25])] spids: [25] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ ("ASL 2.0"))} spids:[30])] spids: [30] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ ("clang llvm"))} spids:[35])] spids: [35] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ("clang-dev llvm-dev"))} spids: [40] ) ] spids: [40] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (-doc))} spids: [45] ) ] spids: [45] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://lcamtuf.coredump.cx/") ($ VSub_Name "$pkgname") (/releases/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") (.tgz) ) } spids: [51] ) ] spids: [51] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver"))} spids: [62] ) ] spids: [62] ) (FuncDef name: build body: (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:dir) op:Equal spids:[81])] spids: [79] ) terminator: ) (ForEach iter_name: dir iter_words: [ {(DQ ($ VSub_Name "$builddir"))} {(DQ ($ VSub_Name "$builddir")) (/llvm_mode)} ] do_arg_iter: False body: (DoGroup children: [ (C {(make)} {(-C)} {(DQ ($ VSub_Name "$dir"))} {(Lit_VarLike "PREFIX=") (/usr)} {(Lit_VarLike "CC=") (clang)} {(Lit_VarLike "AFL_NO_X86=") (1)} ) ] spids: [100 121] ) spids: [89 98] ) ] spids: [76] ) spids: [72 75] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(make)} {(Lit_VarLike "AFL_NO_X86=") (1)} {(Lit_VarLike "PREFIX=") (/usr)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))} {(install)} ) (C {(install)} {(-Dm644)} {(llvm_mode/README.llvm)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share/doc/) ($ VSub_Name "$pkgname") (/README.llvm_mode) } ) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$pkgdir") (/usr/bin/afl-clang))} {(DQ ($ VSub_Name "$pkgdir") ("/usr/bin/afl-clang++"))} {(DQ ($ VSub_Name "$pkgdir") (/usr/bin/afl-gcc))} {(DQ ($ VSub_Name "$pkgdir") ("/usr/bin/afl-g++"))} ) (Case to_match: {(DQ ($ VSub_Name "$CARCH"))} arms: [ (case_arm pat_list:[{(x86) (Lit_Other "*")}] spids:[231233235-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share/afl/testcases/others/elf/small_exec.elf) } ) ] spids: [238 239 250 -1] ) ] spids: [222 228 253] ) ] spids: [130] ) spids: [126 129] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "fd67cf44b7336175041c2efa42b122e91f887f4a293618a59ea1e145ef47b9c0fab9fc274e4b94499c523bec950ff5a704050c3f4260e890ad97774c365a358c afl-2.51b.tgz" ) ) } spids: [258] ) ] spids: [258] ) ] )