diff --git a/net-mgmt/fastnetmon/Makefile b/net-mgmt/fastnetmon/Makefile index eb1c8c795456..dc9eb4a446d4 100644 --- a/net-mgmt/fastnetmon/Makefile +++ b/net-mgmt/fastnetmon/Makefile @@ -1,72 +1,71 @@ PORTNAME= fastnetmon -PORTVERSION= 1.2.4 +PORTVERSION= 1.2.5 DISTVERSIONPREFIX= v -PORTREVISION= 3 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 PORTDOCS= * CXXFLAGS += -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED \ -D_GNU_SOURCE CFLAGS_i386= -march=i586 CMAKE_SOURCE_PATH= ${WRKSRC}/src 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 + ${WRKSRC}/src/man/fastnetmon.8 post-install: ${MV} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf \ ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample ${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/distinfo b/net-mgmt/fastnetmon/distinfo index ae85613297b9..ef5b9939a04a 100644 --- a/net-mgmt/fastnetmon/distinfo +++ b/net-mgmt/fastnetmon/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1677848493 -SHA256 (pavel-odintsov-fastnetmon-v1.2.4_GH0.tar.gz) = 84cd5db0e270f6c268923592eabd5cb0d1689293d9d9f6f0634af548b29f9bb4 -SIZE (pavel-odintsov-fastnetmon-v1.2.4_GH0.tar.gz) = 1056097 +TIMESTAMP = 1686746794 +SHA256 (pavel-odintsov-fastnetmon-v1.2.5_GH0.tar.gz) = d92a1f16e60b6ab6f5c5e023a215570e9352ce9d0c9a9d7209416f8cd0227ae6 +SIZE (pavel-odintsov-fastnetmon-v1.2.5_GH0.tar.gz) = 1383370 diff --git a/net-mgmt/fastnetmon/files/patch-src_fast__endianless.hpp b/net-mgmt/fastnetmon/files/patch-src_fast__endianless.hpp deleted file mode 100644 index 3b80a205bcde..000000000000 --- a/net-mgmt/fastnetmon/files/patch-src_fast__endianless.hpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/fast_endianless.hpp.orig 2023-03-04 15:33:46 UTC -+++ src/fast_endianless.hpp -@@ -12,6 +12,7 @@ - // For be64toh and htobe64 - #if defined(__FreeBSD__) || defined(__DragonFly__) - #include -+#include - #endif - - // Linux standard functions for endian conversions are ugly because there are no checks about arguments length diff --git a/net-mgmt/fastnetmon/files/patch-src_fast__library.cpp b/net-mgmt/fastnetmon/files/patch-src_fast__library.cpp deleted file mode 100644 index 86b2dcd4bb68..000000000000 --- a/net-mgmt/fastnetmon/files/patch-src_fast__library.cpp +++ /dev/null @@ -1,15 +0,0 @@ ---- src/fast_library.cpp.orig 2023-03-05 11:34:07 UTC -+++ src/fast_library.cpp -@@ -1249,7 +1249,11 @@ bool get_interface_number_by_device_name(int socket_fd - return false; - } - -- interface_number = ifr.ifr_ifindex; -+ #ifdef __FreeBSD__ -+ interface_number = ifr.ifr_ifru.ifru_index; -+ #else -+ interface_number = ifr.ifr_ifindex; -+ #endif - #else - /* Fallback to if_nametoindex(3) otherwise. */ - interface_number = if_nametoindex(interface_name.c_str()); diff --git a/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template b/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template deleted file mode 100644 index bbf14617178a..000000000000 --- a/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template +++ /dev/null @@ -1,26 +0,0 @@ ---- src/fast_platform.h.template.orig 2023-03-01 14:23:34 UTC -+++ src/fast_platform.h.template -@@ -9,19 +9,19 @@ class FastnetmonPlatformConfigurtion { - std::string fastnetmon_version = "${FASTNETMON_APPLICATION_VERSION}"; - - std::string pid_path = "/var/run/fastnetmon.pid"; -- std::string global_config_path = "/etc/fastnetmon.conf"; -+ std::string global_config_path = "%%PREFIX%%/etc/fastnetmon.conf"; - - std::string log_file_path = "/var/log/fastnetmon.log"; - std::string attack_details_folder = "/var/log/fastnetmon_attacks"; - - // Default path to notify script -- std::string notify_script_path = "/usr/local/bin/notify_about_attack.sh"; -+ std::string notify_script_path = "%%PREFIX%%/bin/notify_about_attack.sh"; - - // Default path to file with networks for whitelising -- std::string white_list_path = "/etc/networks_whitelist"; -+ std::string white_list_path = "%%PREFIX%%/etc/networks_whitelist"; - - // Default path to file with all networks listing -- std::string networks_list_path = "/etc/networks_list"; -+ std::string networks_list_path = "%%PREFIX%%/etc/networks_list"; - - /* Platform specific paths end */ - }; diff --git a/net-mgmt/fastnetmon/files/patch-src_fastnetmon.cpp b/net-mgmt/fastnetmon/files/patch-src_fastnetmon.cpp index b0ba26165d1b..0883c1581808 100644 --- a/net-mgmt/fastnetmon/files/patch-src_fastnetmon.cpp +++ b/net-mgmt/fastnetmon/files/patch-src_fastnetmon.cpp @@ -1,40 +1,29 @@ ---- src/fastnetmon.cpp.orig 2023-03-01 14:23:34 UTC +--- src/fastnetmon.cpp.orig 2023-05-23 06:20:59 UTC +++ src/fastnetmon.cpp -@@ -12,8 +12,8 @@ - #include - - #include --#include // struct arphdr --#include -+//#include // struct arphdr -+//#include - #include - #include - #include -@@ -161,7 +161,7 @@ unsigned int stats_thread_initial_call_delay = 30; +@@ -156,7 +156,7 @@ unsigned int stats_thread_initial_call_delay = 30; std::string reporting_server = "community-stats.fastnetmon.com"; // Path to temporarily store backtrace when fatal failure happened -std::string backtrace_path = "/var/log/fastnetmon_backtrace.dump"; +std::string backtrace_path = "/var/log/fastnetmon/fastnetmon_backtrace.dump"; // Each this seconds we will check about available data in bucket unsigned int check_for_availible_for_processing_packets_buckets = 1; -@@ -435,7 +435,7 @@ std::string exabgp_community_subnet = ""; +@@ -430,7 +430,7 @@ std::string exabgp_community_subnet = ""; std::string exabgp_community_host = ""; -std::string exabgp_command_pipe = "/var/run/exabgp.cmd"; +std::string exabgp_command_pipe = "/var/run/fastnetmon/exabgp.cmd"; std::string exabgp_next_hop = ""; // Graphite monitoring -@@ -519,7 +519,7 @@ void sigpipe_handler_for_popen(int signo) { +@@ -514,7 +514,7 @@ void sigpipe_handler_for_popen(int signo) { #ifdef GEOIP bool geoip_init() { // load GeoIP ASN database to memory - geo_ip = GeoIP_open("/root/fastnetmon/GeoIPASNum.dat", GEOIP_MEMORY_CACHE); + geo_ip = GeoIP_open("/usr/local/share/fastnetmon/GeoIPASNum.dat", GEOIP_MEMORY_CACHE); if (geo_ip == NULL) { return false; diff --git a/net-mgmt/fastnetmon/files/patch-src_notify__about__attack.sh b/net-mgmt/fastnetmon/files/patch-src_notify__about__attack.sh deleted file mode 100644 index dc4a974f3297..000000000000 --- a/net-mgmt/fastnetmon/files/patch-src_notify__about__attack.sh +++ /dev/null @@ -1,8 +0,0 @@ ---- src/notify_about_attack.sh.orig 2023-03-06 10:33:26 UTC -+++ src/notify_about_attack.sh -@@ -1,4 +1,4 @@ --#!/usr/bin/env bash -+#!/bin/sh - - # - # Hello, lovely FastNetMon customer. I'm really happy to see you here