# Copyright 2005 Matasano Security, LLC <tqbf@matasano.com> - All Rights Reserved
maintainers {ecronin @ecronin} openmaintainer
description A miscelleny of network testing tools.
long_description Blackbag is Matasano's suite of penetration testing and \
reverse engineering tools. What started as a binary \
interactive netcat, has evolved into our "blackbag" of \
tools to help us understand and attack proprietary \
protocols, find compressed images inside of files and more!
homepage http://wayback.archive.org/web/20101121045242/http://chargen.matasano.com/chargen/2008/5/1/blackbag-091-new-link-and-minor-fixes.html
master_sites https://github.com/emonti/rbkb/raw/master/reference
checksums md5 5478497661f4c90ca8ac62da7b1572c7 \
sha1 6ecf6b2d012993181c25801292cdb9168accfabc
depends_lib port:libevent port:libpcap path:lib/libssl.dylib:openssl port:zlib
build.env LFLAGS=-L${prefix}/lib \
IFLAGS=-I${prefix}/include
patchfiles patch-bkb.diff
reinplace "s|/usr/local|\$\(DESTDIR\)${prefix}|g" ${worksrcpath}/Makefile
reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/bkb
reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/sub.c
reinplace "s|/usr/local|\$\(DESTDIR\)${prefix}|g" ${worksrcpath}/asn/Makefile
reinplace "s|/usr/local/bin|${prefix}/bin/blackbag|g" ${worksrcpath}/asn/asn
reinplace "s|shift|#shift|g" ${worksrcpath}/asn/asn
reinplace "s|-I../third-party/libevent-1.0b||g" ${worksrcpath}/Makefile
reinplace "s|-L../third-party/libevent-1.0b||g" ${worksrcpath}/Makefile
reinplace "s|-g||g" ${worksrcpath}/common.mk
reinplace "s|-I\$\(TOP\)/../third-party/libevent-1.0b||g" ${worksrcpath}/common.mk
reinplace "s|-L\$\(TOP\)/../third-party/libevent-1.0b||g" ${worksrcpath}/common.mk
reinplace "s|-L\$\(TOP\)/../third-party/libevent-1.0b||g" ${worksrcpath}/asn/Makefile
system "touch ${worksrcpath}/sub.macros"
system "cd ${worksrcpath}/asn && ${build.cmd}"
xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
xinstall -m 0644 ${worksrcpath}/README \
${destroot}${prefix}/share/doc/${name}/README
file rename ${worksrcpath}/asn/asn ${worksrcpath}/asn/asn1
system "cd ${worksrcpath}/asn && \
${build.cmd} install ${build.target} DESTDIR=${destroot}"