freebsd-ports/security/afl++/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.

Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.

There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.

This commit implements such a proposal and moves one of the WWW: entries
of each pkg-descr file into the respective port's Makefile. A heuristic
attempts to identify the most relevant URL in case there is more than
one WWW: entry in some pkg-descr file. URLs that are not moved into the
Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr
files in order to preserve them.

There are 1256 ports that had no WWW: entries in pkg-descr files. These
ports will not be touched in this commit.

The portlint port has been adjusted to expect a WWW entry in each port
Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as
deprecated.

Approved by:		portmgr (tcberner)
2022-09-07 23:10:59 +02:00

81 lines
2.3 KiB
Makefile

PORTNAME= afl
PORTVERSION= 4.00c
CATEGORIES= security
PKGNAMESUFFIX= ++-${FLAVOR}
MAINTAINER= ports@FreeBSD.org
COMMENT= Fast instrumented fuzzer
WWW= https://aflplus.plus/
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/docs/COPYING
ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc powerpc64 powerpc64le riscv64
ONLY_FOR_ARCHS_REASON= uses x86-only instrumentation or requires complete LLVM support
BUILD_DEPENDS= ginstall:sysutils/coreutils
FLAVORS= llvm gcc
FLAVOR?= ${FLAVORS:[1]}
_LLVM_VER= 13
llvm_BUILD_DEPENDS= clang${_LLVM_VER}:devel/llvm${_LLVM_VER}
llvm_RUN_DEPENDS= clang${_LLVM_VER}:devel/llvm${_LLVM_VER}
USES= gmake shebangfix tar:tgz
.if ${FLAVOR} == gcc
USE_GCC= yes
.endif
USE_GITHUB= yes
GH_ACCOUNT= AFLplusplus
GH_PROJECT= AFLplusplus
SHEBANG_FILES= afl-persistent-config
MAKEFILE= GNUmakefile
MAKE_ARGS= ${${ARCH} != amd64 && ${ARCH} != i386:?AFL_NO_X86=1:} \
PREFIX="${PREFIX}/${PKGBASE}"
.if ${FLAVOR} == llvm
CFLAGS_riscv64= -mno-relax
MAKE_ARGS+= CC=clang${_LLVM_VER} \
CXX=clang++${_LLVM_VER} \
LLVM_CONFIG=llvm-config${_LLVM_VER}
.endif
ALL_TARGET= distrib
QA_ENV= IGNORE_QA_stripped=1 # unstripped to keep it functional
DOCSDIR= ${PREFIX}/${PKGBASE}/share/doc/afl
MANDIRS= ${PREFIX}/${PKGBASE}/share/man/man8
BINARY_ALIAS= install=ginstall
PORTDOCS= *
OPTIONS_DEFINE= DEBUG DOCS PYTHON
OPTIONS_DEFAULT= PYTHON
PYTHON_DESC= Python mutators support
PYTHON_USES= gettext-runtime python
PYTHON_BINARY_ALIAS= python3-config=${PYTHON_CMD}-config \
python3=${PYTHON_CMD}
post-patch:
@${REINPLACE_CMD} '/alt_cc/ s,"gcc","gcc${GCC_DEFAULT:S/-devel$//}",' \
${WRKSRC}/src/afl-cc.c
.if ${FLAVOR} == gcc
@${REINPLACE_CMD} 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \
${WRKSRC}/src/afl-as.c
.elif ${FLAVOR} == llvm
@${ECHO_CMD} "all:" >${WRKSRC}/GNUmakefile.gcc_plugin
.endif
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/man.d
@${ECHO_CMD} "MANPATH ${PREFIX}/${PKGBASE}/share/man" >${STAGEDIR}${PREFIX}/etc/man.d/${PKGBASE}.conf
@${ECHO_CMD} "etc/man.d/${PKGBASE}.conf" >>${TMPPLIST}
@cd ${STAGEDIR}${PREFIX}; \
${FIND} ${PKGBASE} -not -path '${PKGBASE}/share/doc/*' -and \( -type f -or -type l \) | \
${SED} -Ee 's,^afl\+\+-${FLAVOR}/share/man/.*,&.gz,' \
-e 's,^.*/afl-${${FLAVOR} == gcc:?(clang|llvm):(gcc|g\+\+)}.*,@comment &,' | \
${SORT} >> ${TMPPLIST}
@${CAT} ${TMPPLIST}
.include <bsd.port.mk>