freebsd-ports/security/afl/Makefile
Raphael Kubo da Costa 9027a8a6a4 Update to 1.96b.
And pass maintainership to submitter.

PR:		206601
Submitted by:	Tobias Kortkamp <t@tobik.me>
2016-01-28 22:30:20 +00:00

67 lines
2.1 KiB
Makefile

# Created by: Fabian Keil <fk@fabiankeil.de>
# $FreeBSD$
PORTNAME= afl
PORTVERSION= 1.96b
CATEGORIES= security
MASTER_SITES= http://lcamtuf.coredump.cx/afl/releases/
MAINTAINER= t@tobik.me
COMMENT= Fast instrumented fuzzer
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/docs/COPYING
USES= compiler gmake tar:tgz
OPTIONS_DEFINE= DEBUG DOCS MINIMIZE_CORPUS PLOT_SUPPORT TEST_INSTRUMENTATION
MINIMIZE_CORPUS_DESC= Install afl-cmin. Adds bash dependency
PLOT_SUPPORT_DESC= Support progress plotting. Adds Gnuplot dependency
TEST_INSTRUMENTATION_DESC= Execute tests (expected to fail in jails)
OPTIONS_DEFAULT= DOCS MINIMIZE_CORPUS PLOT_SUPPORT
OPTIONS_SUB= yes
PORTSCOUT= ignore:1
ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= Uses binary instrumentation
.include <bsd.port.pre.mk>
.if (${COMPILER_TYPE} == "clang" && ${ARCH} == "i386")
# Clang i386 emits .cfi_sections which base as(1) doesn't understand
BUILD_DEPENDS += ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
RUN_DEPENDS += ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
.endif
MINIMIZE_CORPUS_RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
PLOT_SUPORT_RUN_DEPENDS= gnuplot:${PORTSDIR}/math/gnuplot
post-patch:
.if ! ${PORT_OPTIONS:MTEST_INSTRUMENTATION}
# afl needs shmget() which usually isn't available in jails. Disabling
# the instrumentation tests makes sure building packages in jails works
# by default anyway.
${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/Makefile
.endif
${REINPLACE_CMD} -E -e 's@ -O3@@; s@ -g@@' \
-e 's@install -m 755@${INSTALL_PROGRAM}@' \
-e 's@ afl-(cmin|plot|whatsup) @ @g' \
${WRKSRC}/Makefile
.if (${COMPILER_TYPE} == "clang" && ${ARCH} == "i386")
${REINPLACE_CMD} -e 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \
${WRKSRC}/afl-as.c
.endif
post-install:
${INSTALL_DATA} ${WRKSRC}/docs/COPYING ${STAGEDIR}${DOCSDIR}/
.for afl_script in afl-cmin afl-plot afl-whatsup
${INSTALL_SCRIPT} ${WRKSRC}/${afl_script} ${STAGEDIR}${PREFIX}/bin/
.endfor
post-install-MINIMIZE_CORPUS-on:
${INSTALL_SCRIPT} ${WRKSRC}/afl-cmin ${STAGEDIR}${PREFIX}/bin/
.include <bsd.port.post.mk>