diff --git a/net-mgmt/fastnetmon/Makefile b/net-mgmt/fastnetmon/Makefile index f1269937c2ad..128d059d46ec 100644 --- a/net-mgmt/fastnetmon/Makefile +++ b/net-mgmt/fastnetmon/Makefile @@ -1,73 +1,72 @@ PORTNAME= fastnetmon PORTVERSION= 1.2.4 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= net-mgmt security MAINTAINER= farrokhi@FreeBSD.org COMMENT= Very fast DDoS analyzer with sflow/netflow/mirror support WWW= https://fastnetmon.com LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_armv6= does not build: invokes x86 assembler BROKEN_armv7= does not build: invokes x86 assembler LIB_DEPENDS= libboost_regex.so:devel/boost-libs \ liblog4cpp.so:devel/log4cpp \ libmongoc-1.0.so:devel/mongo-c-driver \ libjson-c.so:devel/json-c \ libbson-1.0.so:devel/libbson \ libcapnp.so:devel/capnproto \ libgrpc.so:devel/grpc142 \ libprotobuf.so:devel/protobuf \ libabsl_base.so:devel/abseil \ libhiredis.so:databases/hiredis USES= cmake compiler:c++11-lang pkgconfig localbase:ldflags ssl USE_GITHUB= yes GH_ACCOUNT= pavel-odintsov USERS= ${PORTNAME} GROUPS= ${PORTNAME} USE_RC_SUBR= ${PORTNAME} -OPTIONS_DEFINE= DOCS REDIS - -REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis +OPTIONS_DEFINE= DOCS PORTDOCS= * -CXXFLAGS += -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED +CXXFLAGS += -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED \ + -D_GNU_SOURCE CFLAGS_i386= -march=i586 CMAKE_SOURCE_PATH= ${WRKSRC}/src -CMAKE_ARGS+= -DDISABLE_PF_RING_SUPPORT=ON \ - -DENABLE_NETMAP_SUPPORT=OFF \ +CMAKE_ARGS+= -DENABLE_NETMAP_SUPPORT=ON \ -DLINK_WITH_ABSL=ON \ -DSET_ABSOLUTE_INSTALL_PATH=OFF \ -DCMAKE_INSTALL_MANDIR=${PREFIX}/man CMAKE_INSTALL_PREFIX= ${PREFIX} .include post-patch: @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|; \ s|/var/run|&/fastnetmon|g; s|/var/log|&/fastnetmon|g; \ s|"/etc/|"${PREFIX}/etc/|g; s|/root/fastnetmon|${DATADIR}|g' \ ${WRKSRC}/src/fastnetmon.conf ${WRKSRC}/src/fastnetmon.cpp @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ ${WRKSRC}/src/man/fastnetmon.8 ${WRKSRC}/src/fast_platform.h.template post-install: ${MV} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf \ ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample - ${MKDIR} ${STAGEDIR}/var/run/fastnetmon ${STAGEDIR}/var/log/fastnetmon + ${MKDIR} ${STAGEDIR}/var/run/fastnetmon ${STAGEDIR}/var/log/fastnetmon_attacks ${INSTALL_SCRIPT} ${WRKSRC}/src/notify_about_attack.sh ${STAGEDIR}${PREFIX}/bin post-install-DOCS-on: cd ${WRKSRC} && ${COPYTREE_SHARE} "README.md docs" ${STAGEDIR}${DOCSDIR} .include diff --git a/net-mgmt/fastnetmon/files/fastnetmon.in b/net-mgmt/fastnetmon/files/fastnetmon.in index 431a34793412..c6ee5b2aa52e 100644 --- a/net-mgmt/fastnetmon/files/fastnetmon.in +++ b/net-mgmt/fastnetmon/files/fastnetmon.in @@ -1,30 +1,30 @@ #!/bin/sh # PROVIDE: fastnetmon # REQUIRE: NETWORKING SERVERS LOGIN # BEFORE: securelevel # KEYWORD: shutdown # Add the following line to /etc/rc.conf to enable 'fastnetmon': # # fastnetmon_enable="YES" # . /etc/rc.subr name=fastnetmon desc="fastnetmon startup script" rcvar=fastnetmon_enable load_rc_config "$name" : ${fastnetmon_enable:=NO} -: ${fastnetmon_conf:=%%ETCDIR%%/$name.conf} -: ${fastnetmon_flags:=--daemonize} +: ${fastnetmon_conf:=%%PREFIX%%/etc/$name.conf} +: ${fastnetmon_flags:=} : ${fastnetmon_user:=fastnetmon} command=%%PREFIX%%/bin/fastnetmon -command_args="--configuration_file ${fastnetmon_conf} ${fastnetmon_flags}" +command_args="--daemonize --configuration_file ${fastnetmon_conf} ${fastnetmon_flags}" pidfile=/var/run/fastnetmon/$name.pid run_rc_command "$1" diff --git a/net-mgmt/fastnetmon/files/patch-src_netmap__plugin_netmap__collector.cpp b/net-mgmt/fastnetmon/files/patch-src_netmap__plugin_netmap__collector.cpp new file mode 100644 index 000000000000..19a3f3d8b17d --- /dev/null +++ b/net-mgmt/fastnetmon/files/patch-src_netmap__plugin_netmap__collector.cpp @@ -0,0 +1,10 @@ +--- src/netmap_plugin/netmap_collector.cpp.orig 2023-03-01 14:23:34 UTC ++++ src/netmap_plugin/netmap_collector.cpp +@@ -19,6 +19,7 @@ + + // Disable debug messages from Netmap + #define NETMAP_NO_DEBUG ++typedef bool _Bool; + #include + #include + diff --git a/net-mgmt/fastnetmon/pkg-plist b/net-mgmt/fastnetmon/pkg-plist index 01e28de42b0d..6c244f25be27 100644 --- a/net-mgmt/fastnetmon/pkg-plist +++ b/net-mgmt/fastnetmon/pkg-plist @@ -1,11 +1,11 @@ bin/fastnetmon bin/fastnetmon_api_client bin/fastnetmon_client bin/notify_about_attack.sh etc/networks_list etc/networks_whitelist man/man8/fastnetmon.8.gz man/man1/fastnetmon_client.1.gz @sample etc/fastnetmon.conf.sample @dir(fastnetmon,fastnetmon) /var/run/fastnetmon -@dir(fastnetmon,fastnetmon) /var/log/fastnetmon +@dir(fastnetmon,fastnetmon) /var/log/fastnetmon_attacks