2019-11-17 01:03:04 +00:00
|
|
|
# Created by: David O'Brien <obrien@FreeBSD.org>
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= zeek
|
2021-03-20 01:16:38 +00:00
|
|
|
PORTVERSION= 4.0.0
|
2019-11-17 01:03:04 +00:00
|
|
|
CATEGORIES= security
|
2020-03-15 22:44:26 +00:00
|
|
|
MASTER_SITES= https://old.zeek.org/downloads/
|
2019-11-17 01:03:04 +00:00
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
|
|
|
|
MAINTAINER= leres@FreeBSD.org
|
|
|
|
COMMENT= System for detecting network intruders in real-time
|
|
|
|
|
|
|
|
LICENSE= BSD3CLAUSE
|
|
|
|
|
2020-12-22 17:02:54 +00:00
|
|
|
BROKEN_FreeBSD_11_powerpc64== Does not build: error: zero-size array 'names'
|
|
|
|
BROKEN_FreeBSD_12_powerpc64== Does not build: error: zero-size array 'names'
|
2019-11-17 01:03:04 +00:00
|
|
|
|
|
|
|
USES= bison cmake compiler:c++11-lang gettext-runtime ninja perl5 python shebangfix ssl
|
2020-04-14 18:10:15 +00:00
|
|
|
USE_LDCONFIG= yes
|
2019-11-17 01:03:04 +00:00
|
|
|
|
2020-03-18 00:34:19 +00:00
|
|
|
PORTSCOUT= limit:0,even
|
|
|
|
|
2019-11-17 01:03:04 +00:00
|
|
|
CMAKE_ARGS+= -DPYTHON_EXECUTABLE:PATH=${PYTHON_CMD}
|
|
|
|
|
2021-03-20 01:16:38 +00:00
|
|
|
SHEBANG_FILES= auxil/zeekctl/auxil/trace-summary/trace-summary
|
2019-11-17 01:03:04 +00:00
|
|
|
|
|
|
|
SUB_FILES= pkg-message
|
|
|
|
NO_MTREE= yes
|
|
|
|
|
|
|
|
CMAKE_ARGS+= -GNinja \
|
|
|
|
-D CMAKE_INSTALL_PREFIX:PATH=${PREFIX} \
|
|
|
|
-D ZEEK_ROOT_DIR:PATH=${PREFIX} \
|
|
|
|
-D PY_MOD_INSTALL_DIR:PATH=${PREFIX}/lib/zeekctl \
|
|
|
|
-D ZEEK_SCRIPT_INSTALL_PATH:PATH=${PREFIX}/share/zeek \
|
|
|
|
-D ZEEK_ETC_INSTALL_DIR:PATH=${PREFIX}/etc \
|
|
|
|
-D ZEEK_MAN_INSTALL_PATH=${MANPREFIX}/man \
|
|
|
|
-D ENABLE_PERFTOOLS_DEBUG:BOOL=false \
|
|
|
|
-D BinPAC_SKIP_INSTALL:BOOL=true \
|
|
|
|
-D INSTALL_AUX_TOOLS:BOOL=true \
|
|
|
|
-D BUILD_SHARED_LIBS:BOOL=true \
|
|
|
|
-D BUILD_STATIC_BROKER:BOOL=true \
|
|
|
|
-D CMAKE_EXE_LINKER_FLAGS="${OPENSSL_LDFLAGS}"
|
|
|
|
|
|
|
|
ZEEKUSER?= zeek
|
|
|
|
ZEEKGROUP?= zeek
|
2020-11-06 18:38:46 +00:00
|
|
|
PLIST_SUB+= ARCH=${UNAME_M} \
|
2019-11-17 01:03:04 +00:00
|
|
|
ZEEKUSER=${ZEEKUSER} \
|
|
|
|
ZEEKGROUP=${ZEEKGROUP} \
|
|
|
|
LCASE_OPSYS=${OPSYS:tl}
|
|
|
|
|
|
|
|
USERS= ${ZEEKUSER}
|
|
|
|
GROUPS= ${ZEEKGROUP}
|
|
|
|
|
2020-11-19 00:34:21 +00:00
|
|
|
OPTIONS_DEFINE= BROKER DEBUG GEOIP2 IPSUMDUMP LBL_CF LBL_HF NETMAP \
|
|
|
|
PERFTOOLS ZEEKCTL
|
2019-11-17 01:03:04 +00:00
|
|
|
OPTIONS_DEFAULT=BROKER GEOIP2 IPSUMDUMP LBL_CF LBL_HF NETMAP ZEEKCTL
|
|
|
|
OPTIONS_SUB= yes
|
|
|
|
|
|
|
|
BROKER_DESC= Enable the Broker communication library
|
|
|
|
GEOIP2_DESC= Build with GeoIP2 (MaxMindDB) support
|
|
|
|
IPSUMDUMP_DESC= Enables traffic summaries
|
|
|
|
LBL_CF_DESC= Unix time to formated time/date filter support
|
|
|
|
LBL_HF_DESC= Address to hostname filter support
|
2021-03-20 01:16:38 +00:00
|
|
|
NETMAP_DESC= Native Netmap Packet IOSource for Zeek
|
2019-11-17 01:03:04 +00:00
|
|
|
PERFTOOLS_DESC= Use Perftools to improve memory & CPU usage
|
|
|
|
ZEEKCTL_DESC= ZeekControl support (implies BROKER and IPSUMDUMP)
|
|
|
|
|
|
|
|
ZEEKCTL_IMPLIES= BROKER IPSUMDUMP
|
|
|
|
|
2020-06-17 18:17:45 +00:00
|
|
|
BROKER_BUILD_DEPENDS= swig:devel/swig
|
2019-11-17 01:03:04 +00:00
|
|
|
BROKER_CMAKE_BOOL= ENABLE_BROKER
|
|
|
|
DEBUG_CMAKE_BOOL= ENABLE_DEBUG
|
2020-05-08 20:51:23 +00:00
|
|
|
GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb
|
|
|
|
IPSUMDUMP_BUILD_DEPENDS=ipsumdump:net/ipsumdump
|
|
|
|
IPSUMDUMP_RUN_DEPENDS= ipsumdump:net/ipsumdump
|
2019-11-17 01:03:04 +00:00
|
|
|
LBL_CF_RUN_DEPENDS= ${LOCALBASE}/bin/cf:sysutils/lbl-cf
|
2020-05-08 20:51:23 +00:00
|
|
|
LBL_HF_RUN_DEPENDS= ${LOCALBASE}/bin/hf:sysutils/lbl-hf
|
2021-03-20 01:16:38 +00:00
|
|
|
NETMAP_GH_TUPLE= zeek:zeek-netmap:v2.0.0:zeek_netmap
|
2019-11-17 01:03:04 +00:00
|
|
|
NETMAP_USE= GITHUB=nodefault
|
2020-05-08 20:51:23 +00:00
|
|
|
PERFTOOLS_BUILD_DEPENDS=${LOCALBASE}/bin/perftools-pprof:devel/google-perftools
|
2019-11-17 01:03:04 +00:00
|
|
|
PERFTOOLS_CMAKE_BOOL= ENABLE_PERFTOOLS
|
2020-05-08 20:51:23 +00:00
|
|
|
PERFTOOLS_RUN_DEPENDS=${LOCALBASE}/bin/perftools-pprof:devel/google-perftools
|
2020-06-17 18:17:45 +00:00
|
|
|
PYTHON_BUILD_DEPENDS= swig:devel/swig
|
2019-11-17 01:03:04 +00:00
|
|
|
ZEEKCTL_BUILD_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash \
|
|
|
|
${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
|
2020-06-17 18:17:45 +00:00
|
|
|
swig:devel/swig
|
2020-05-08 20:51:23 +00:00
|
|
|
ZEEKCTL_CMAKE_BOOL= INSTALL_ZEEKCTL
|
2019-11-17 01:03:04 +00:00
|
|
|
ZEEKCTL_RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash \
|
|
|
|
${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}
|
|
|
|
|
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
|
|
|
.if ${PORT_OPTIONS:MZEEKCTL}
|
|
|
|
USE_RC_SUBR= zeek
|
|
|
|
.endif
|
|
|
|
|
2020-11-06 18:38:46 +00:00
|
|
|
post-patch:
|
2021-03-20 01:16:38 +00:00
|
|
|
${REINPLACE_CMD} -e '\|/usr/local/|s|$$| ${STAGEDIR}${PREFIX}/|' \
|
|
|
|
${WRKSRC_zeek_netmap}/cmake/FindNetmap.cmake
|
|
|
|
|
|
|
|
|
|
|
|
# # Silence the "use ZeekControl.plugin instead of BroControl.plugin" nag
|
|
|
|
# @${REINPLACE_CMD} -e 's/^print/#&/' \
|
|
|
|
# ${WRKSRC}/auxil/zeekctl/BroControl/__init__.py
|
2020-11-06 18:38:46 +00:00
|
|
|
|
2019-11-17 01:03:04 +00:00
|
|
|
post-install-ZEEKCTL-on:
|
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/logs
|
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/spool/tmp
|
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/spool/installed-scripts-do-not-touch/auto
|
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/spool/installed-scripts-do-not-touch/site
|
|
|
|
.for F in zeekctl.cfg networks.cfg node.cfg
|
2020-11-06 18:38:46 +00:00
|
|
|
${MV} ${STAGEDIR}${PREFIX}/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.sample
|
2019-11-17 01:03:04 +00:00
|
|
|
.endfor
|
|
|
|
${RM} ${STAGEDIR}${PREFIX}/share/zeekctl/scripts/zeekctl-config.sh
|
|
|
|
${LN} -s ../../../spool/zeekctl-config.sh \
|
|
|
|
${STAGEDIR}${PREFIX}/share/zeekctl/scripts/zeekctl-config.sh
|
|
|
|
|
|
|
|
post-install:
|
2020-11-06 18:38:46 +00:00
|
|
|
${MV} ${STAGEDIR}${DATADIR}/site/local.zeek \
|
|
|
|
${STAGEDIR}${DATADIR}/site/local.zeek.sample
|
2019-11-17 01:03:04 +00:00
|
|
|
|
|
|
|
pre-install-ZEEKCTL-on:
|
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.d
|
|
|
|
|
2021-03-20 01:16:38 +00:00
|
|
|
post-install-NETMAP-on:
|
|
|
|
${MKDIR} ${WRKDIR}/zeek-bin
|
|
|
|
${CP} ${STAGEDIR}${PREFIX}/bin/zeek-config ${WRKDIR}/zeek-bin
|
|
|
|
${REINPLACE_CMD} -e 's|=/usr/local|=${STAGEDIR}${PREFIX}|' \
|
|
|
|
-e '/^include_dir=/s|:/usr/local|:${STAGEDIR}${PREFIX}|' \
|
|
|
|
${WRKDIR}/zeek-bin/zeek-config
|
|
|
|
cd ${WRKSRC_zeek_netmap} && env PATH=${WRKDIR}/zeek-bin:${PATH} \
|
|
|
|
./configure --with-netmap=/usr \
|
|
|
|
--install-root=${STAGEDIR}${PREFIX}/lib/zeek/plugins
|
|
|
|
cd ${WRKSRC_zeek_netmap}/build && make && make install
|
|
|
|
|
2020-11-06 18:38:46 +00:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
UNAME_M!= ${UNAME} -m
|
2019-11-17 01:03:04 +00:00
|
|
|
|
2020-11-06 18:38:46 +00:00
|
|
|
.include <bsd.port.post.mk>
|