Index: head/net-mgmt/fastnetmon/Makefile =================================================================== --- head/net-mgmt/fastnetmon/Makefile (revision 513532) +++ head/net-mgmt/fastnetmon/Makefile (revision 513533) @@ -1,66 +1,66 @@ # Created by: Babak Farrokhi # $FreeBSD$ PORTNAME= fastnetmon -PORTVERSION= 1.1.3 +PORTVERSION= 1.1.4 DISTVERSIONPREFIX= v -PORTREVISION= 14 CATEGORIES= net-mgmt security MAINTAINER= farrokhi@FreeBSD.org COMMENT= Very fast DDoS analyzer with sflow/netflow/mirror support LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE +BROKEN_armv6= Does not build: invokes x86 assembler +BROKEN_armv7= Does not build: invokes x86 assembler +BROKEN_powerpc64= Does not build + LIB_DEPENDS= libboost_regex.so:devel/boost-libs \ liblog4cpp.so:devel/log4cpp \ libluajit-5.1.so:lang/luajit \ libmongoc-1.0.so:devel/mongo-c-driver \ libjson-c.so:devel/json-c \ libbson-1.0.so:devel/libbson +USES= cmake + USE_GITHUB= yes GH_ACCOUNT= pavel-odintsov USERS= ${PORTNAME} GROUPS= ${PORTNAME} -USES= cmake -CMAKE_SOURCE_PATH= ${WRKSRC}/src - -CMAKE_ARGS+= -DDISABLE_PF_RING_SUPPORT=ON -CMAKE_INSTALL_PREFIX= ${PREFIX} - -BROKEN_armv6= Does not build: invokes x86 assembler -BROKEN_armv7= Does not build: invokes x86 assembler -BROKEN_powerpc64= Does not build - USE_RC_SUBR= ${PORTNAME} OPTIONS_DEFINE= DOCS REDIS REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis PORTDOCS= * CFLAGS_i386= -march=i586 +CMAKE_SOURCE_PATH= ${WRKSRC}/src +CMAKE_ARGS+= -DDISABLE_PF_RING_SUPPORT=ON +CMAKE_INSTALL_PREFIX= ${PREFIX} post-patch: @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/src/CMakeLists.txt @${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.1 ${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 ${INSTALL_MAN} ${WRKSRC}/src/man/fastnetmon.1 ${STAGEDIR}${MANPREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/src/man/fastnetmon_client.1 ${STAGEDIR}${MANPREFIX}/man/man1 post-install-DOCS-on: cd ${WRKSRC} && ${COPYTREE_SHARE} "README.md docs" ${STAGEDIR}${DOCSDIR} .include Index: head/net-mgmt/fastnetmon/distinfo =================================================================== --- head/net-mgmt/fastnetmon/distinfo (revision 513532) +++ head/net-mgmt/fastnetmon/distinfo (revision 513533) @@ -1,3 +1,3 @@ -TIMESTAMP = 1478621523 -SHA256 (pavel-odintsov-fastnetmon-v1.1.3_GH0.tar.gz) = 1b78c5f7e5d750bf7dbf2c516710a53e430975480b45bfc6996fe00f5bef7de8 -SIZE (pavel-odintsov-fastnetmon-v1.1.3_GH0.tar.gz) = 4173724 +TIMESTAMP = 1555233508 +SHA256 (pavel-odintsov-fastnetmon-v1.1.4_GH0.tar.gz) = 4c13bc3304346db52086938533d6514d69c7014a0ac100655c6cf75ff321e0fb +SIZE (pavel-odintsov-fastnetmon-v1.1.4_GH0.tar.gz) = 665067 Index: head/net-mgmt/fastnetmon/files/patch-src_fast__dpi.cpp =================================================================== --- head/net-mgmt/fastnetmon/files/patch-src_fast__dpi.cpp (revision 513532) +++ head/net-mgmt/fastnetmon/files/patch-src_fast__dpi.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- src/fast_dpi.cpp.orig 2016-06-22 05:22:26 UTC -+++ src/fast_dpi.cpp -@@ -35,7 +35,7 @@ struct ndpi_detection_module_struct* ini - u_int32_t detection_tick_resolution = 1000; - - struct ndpi_detection_module_struct* my_ndpi_struct = -- ndpi_init_detection_module(detection_tick_resolution, malloc, free, debug_printf); -+ ndpi_init_detection_module(); - - if (my_ndpi_struct == NULL) { - // printf("Can't init nDPI"); Property changes on: head/net-mgmt/fastnetmon/files/patch-src_fast__dpi.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/fastnetmon/files/patch-src_CMakeLists.txt =================================================================== --- head/net-mgmt/fastnetmon/files/patch-src_CMakeLists.txt (revision 513532) +++ head/net-mgmt/fastnetmon/files/patch-src_CMakeLists.txt (revision 513533) @@ -1,106 +1,88 @@ ---- src/CMakeLists.txt.orig 2016-06-22 05:22:26 UTC +--- src/CMakeLists.txt.orig 2019-02-13 22:20:23 UTC +++ src/CMakeLists.txt -@@ -27,6 +27,13 @@ project(FastNetMon) - set (FASTNETMON_VERSION_MAJOR 1) - set (FASTNETMON_VERSION_MINOR 1) +@@ -33,6 +33,13 @@ set (FASTNETMON_VERSION_MINOR 1) + set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "/lib/systemd/system" + CACHE PATH "Location for systemd service files") +# Respect PREFIX variable in FreeBSD +if($ENV{PREFIX}) + set(PREFIX $ENV{PREFIX}) +else() + set(PREFIX "/usr/local") +endif() + if (ENABLE_GOBGP_SUPPORT) # We could not compile gRPC without C++ 11 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") -@@ -59,12 +66,14 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL +@@ -65,12 +72,12 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};/opt/l message(STATUS "C++ compilation flags: ${CMAKE_CXX_FLAGS_RELEASE}") -set(HIREDIS_CUSTOM_INSTALL_PATH "/opt/libhiredis_0_13") -set(LOG4CPP_CUSTOM_INSTALL_PATH "/opt/log4cpp1.1.1") -set(JSONC_CUSTOM_INSTALL_PATH "/opt/json-c-0.12") -set(PFRING_CUSTOM_INSTALL_PATH "/opt/pf_ring_6.0.3") -set(LIBPCAP_CUSTOM_INSTALL_PATH "/opt/libpcap_1.7.4") -set(MONGO_C_CUSTOM_INSTALL_PATH "/opt/mongo_c_driver_1_1_9") +set(HIREDIS_CUSTOM_INSTALL_PATH ${PREFIX}) +set(LOG4CPP_CUSTOM_INSTALL_PATH ${PREFIX}) +set(JSONC_CUSTOM_INSTALL_PATH ${PREFIX}) +set(PFRING_CUSTOM_INSTALL_PATH ${PREFIX}) +set(LIBPCAP_CUSTOM_INSTALL_PATH ${PREFIX}) +set(MONGO_C_CUSTOM_INSTALL_PATH ${PREFIX}) -+set(NDPI_CUSTOM_INSTALL_PATH ${PREFIX}) -+set(LUAJIT_CUSTOM_INSTALL_PATH ${PREFIX}) set(FASTNETMON_PROFILER OFF) -@@ -184,21 +193,21 @@ add_library(sflow_plugin STATIC sflow_pl +@@ -227,21 +234,22 @@ add_library(sflow_plugin STATIC sflow_plugin/sflow_col add_library(netflow_plugin STATIC netflow_plugin/netflow_collector.cpp) target_link_libraries(netflow_plugin ipfix_rfc) --set(ENABLE_DPI_SUPPORT YES) -+#set(ENABLE_DPI_SUPPORT YES) +-option(ENABLE_DPI_SUPPORT "Enable Deep Packet Inspection support" ON) ++option(ENABLE_DPI_SUPPORT "Enable Deep Packet Inspection support" OFF) if (ENABLE_DPI_SUPPORT) message(STATUS "We will enable nDPI support") add_library(fast_dpi STATIC fast_dpi.cpp) - set(NDPI_INCLUDE_DIRS "/opt/ndpi/include/libndpi-1.7.1") -- ++ set(NDPI_INCLUDE_DIRS ${PREFIX}) + - find_library(NDPI_LIBRARIES NAMES ndpi PATHS "/opt/ndpi/lib" NO_DEFAULT_PATH) + file(GLOB NDPI_SEARCH_PATHS "${NDPI_CUSTOM_INSTALL_PATH}/include/libndpi-*") -+ find_path(NDPI_INCLUDE_DIRS NAMES libndpi/ndpi_api.h PATHS ${NDPI_SEARCH_PATHS} NO_DEFAULT_PATH) + find_library(NDPI_LIBRARIES NAMES ndpi PATHS "${NDPI_CUSTOM_INSTALL_PATH}/lib" NO_DEFAULT_PATH) if (NOT NDPI_LIBRARIES) message(FATAL_ERROR "Could not find nDPI library") endif() - link_directories("/opt/ndpi/lib") + link_directories(${NDPI_LIBRARIES}) include_directories(${NDPI_INCLUDE_DIRS}) add_definitions(-DENABLE_DPI) -@@ -215,8 +224,6 @@ if (ENABLE_LUA_SUPPORT) +@@ -258,7 +266,7 @@ if (ENABLE_LUA_SUPPORT) add_definitions(-DENABLE_LUA_HOOKS) - set(LUAJIT_CUSTOM_INSTALL_PATH "/opt/luajit_2.0.4") -- ++ set(LUAJIT_CUSTOM_INSTALL_PATH ${PREFIX}) + link_directories("${LUAJIT_CUSTOM_INSTALL_PATH}/lib") include_directories("${LUAJIT_CUSTOM_INSTALL_PATH}/include") +@@ -656,12 +664,12 @@ install(FILES networks_list DESTINATION "${CMAKE_INSTA + install(FILES networks_whitelist DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") -@@ -578,14 +585,14 @@ if (BUILD_TESTS) - endif() - - if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "DragonFly") -- install(TARGETS fastnetmon DESTINATION bin) -- install(TARGETS fastnetmon_client DESTINATION bin) -+ install(TARGETS fastnetmon DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -+ install(TARGETS fastnetmon_client DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - -- install(FILES fastnetmon.conf DESTINATION etc) -+ install(FILES fastnetmon.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc) - - # Install blank files for networks list and whitelist -- install(FILES networks_list DESTINATION etc) -- install(FILES networks_whitelist DESTINATION etc) -+ install(FILES networks_list DESTINATION ${CMAKE_INSTALL_PREFIX}/etc) -+ install(FILES networks_whitelist DESTINATION ${CMAKE_INSTALL_PREFIX}/etc) - else() - # Linux - install(TARGETS fastnetmon DESTINATION /usr/sbin) -@@ -599,8 +606,10 @@ else() - endif() - # man pages -install(FILES man/fastnetmon.1 DESTINATION /usr/share/man/man1) -install(FILES man/fastnetmon_client.1 DESTINATION /usr/share/man/man1) +#install(FILES man/fastnetmon.1 DESTINATION /usr/share/man/man1) +#install(FILES man/fastnetmon_client.1 DESTINATION /usr/share/man/man1) -+ -+install(FILES fastnetmon.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc) - # Configure cpack package builder - # Run it with: cd build; cpack -G DEB .. + # service files +-configure_file(fastnetmon.service.in "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" @ONLY) +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}) ++#configure_file(fastnetmon.service.in "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" @ONLY) ++#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}) + + if (${OS_ID} MATCHES debian|ubuntu) + install(FILES fastnetmon_init_script_debian_6_7 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d RENAME fastnetmon) Index: head/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template =================================================================== --- head/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template (nonexistent) +++ head/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template (revision 513533) @@ -0,0 +1,26 @@ +--- src/fast_platform.h.template.orig 2019-02-13 22:20:23 UTC ++++ src/fast_platform.h.template +@@ -8,19 +8,19 @@ + 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 */ + Property changes on: head/net-mgmt/fastnetmon/files/patch-src_fast__platform.h.template ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/net-mgmt/fastnetmon/files/patch-src_man_fastnetmon.1 =================================================================== --- head/net-mgmt/fastnetmon/files/patch-src_man_fastnetmon.1 (nonexistent) +++ head/net-mgmt/fastnetmon/files/patch-src_man_fastnetmon.1 (revision 513533) @@ -0,0 +1,11 @@ +--- src/man/fastnetmon.1.orig 2019-02-13 22:20:23 UTC ++++ src/man/fastnetmon.1 +@@ -8,7 +8,7 @@ fastnetmon [--daemonize] + .SH DESCRIPTION + FastNetMon - a high performance DoS/DDoS load analyzer built on top of multiple packet capture engines (NetFlow, IPFIX, sFLOW, netmap, PF_RING, PCAP). + +-For more information about configuration, please look at the comments in /etc/fastnetmon.conf and check the project GitHub page: https://github.com/pavel-odintsov/fastnetmon. ++For more information about configuration, please look at the comments in /usr/local/etc/fastnetmon.conf and check the project GitHub page: https://github.com/pavel-odintsov/fastnetmon. + .SH OPTIONS + fastnetmon has only a single command line option --daemonize which is used for forking and detaching it from the terminal. + .SH SEE ALSO Property changes on: head/net-mgmt/fastnetmon/files/patch-src_man_fastnetmon.1 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property