diff --git a/net/ntopng/Makefile b/net/ntopng/Makefile index 4abb1dff0402..3123823a03f5 100644 --- a/net/ntopng/Makefile +++ b/net/ntopng/Makefile @@ -1,70 +1,71 @@ PORTNAME= ntopng PORTVERSION= 6.0.d20231103 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= net MAINTAINER= madpilot@FreeBSD.org COMMENT= Network monitoring tool with command line and web interfaces WWW= https://www.ntop.org/products/traffic-analysis/ntop/ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= librrd.so:databases/rrdtool \ libzmq.so:net/libzmq4 \ libcurl.so:ftp/curl \ libndpi.so:net/ndpi \ libjson-c.so:devel/json-c \ libsodium.so:security/libsodium \ libmaxminddb.so:net/libmaxminddb \ libexpat.so:textproc/expat2 \ libzstd.so:archivers/zstd \ libgcrypt.so:security/libgcrypt \ libgpg-error.so:security/libgpg-error \ libhiredis.so:databases/hiredis BUILD_DEPENDS= bash:shells/bash USES= autoreconf compiler:c++11-lang cpe gmake libtool localbase \ lua:54 mysql pathfix pkgconfig shebangfix sqlite ssl SUB_FILES= ntopng-geoip2update.sh pkg-deinstall pkg-message SHEBANG_FILES= httpdocs/misc/ntopng-add-user.sh \ httpdocs/misc/ntopng-utils-manage-config.in GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-ndpi-includes=${LOCALBASE}/include/ndpi USERS= ntopng GROUPS= ntopng PLIST_SUB= NTOPNGUSER="${USERS}" NTOPNGROUP="${GROUPS}" USE_GITHUB= yes GH_TUPLE= ntop:ntopng-dist:5034f89:dist/httpdocs/dist GH_ACCOUNT= ntop GH_TAGNAME= 4e18f59 CPE_VENDOR= ntop OPTIONS_DEFINE= NLS OPTIONS_SUB= yes NLS_USES= gettext USE_RC_SUBR= ntopng post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ -e 's|%%SSL_INC%%|${OPENSSLINC}|g' \ -e 's|%%SSL_LIB%%|${OPENSSLLIB}|g' \ ${WRKSRC}/Makefile.in \ ${WRKSRC}/configure.ac.in cd ${WRKSRC} && ${SH} autogen.sh post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ntopng ${MKDIR} ${STAGEDIR}/var/db/ntopng ${INSTALL_SCRIPT} ${WRKDIR}/ntopng-geoip2update.sh ${STAGEDIR}${PREFIX}/bin ${RM} ${STAGEDIR}${DATADIR}/httpdocs/misc/ntopng-utils-manage-updates \ ${STAGEDIR}${DATADIR}/httpdocs/misc/ntopng-utils-manage-updates.in .include diff --git a/net/ntopng/files/patch-configure.ac.in b/net/ntopng/files/patch-configure.ac.in index 2efdccd10217..ccb3bc112353 100644 --- a/net/ntopng/files/patch-configure.ac.in +++ b/net/ntopng/files/patch-configure.ac.in @@ -1,215 +1,215 @@ --- configure.ac.in.orig 2023-11-03 09:27:20 UTC +++ configure.ac.in @@ -142,40 +142,8 @@ LIBPCAP=-lpcap MAKE=make BIN_PATH=/usr/bin LIBPCAP=-lpcap +OS=`uname -or | cut -d '-' -f 1` -if test $SYSTEM = "FreeBSD" || test $SYSTEM = "Darwin"; then - CFLAGS="${CFLAGS} -I/usr/local/include" - LDFLAGS="${LDFLAGS} -L/usr/local/lib" - - dnl> https://github.com/google/sanitizers/wiki/AddressSanitizerFlags - CC=clang - CXX="clang++ -fpie -fno-color-diagnostics $CLANG_STDLIB" - if test $SYSTEM = "FreeBSD"; then - MAKE=gmake - BIN_PATH=/usr/local/bin - else - dnl> Adds /opt if MacPorts is installed - if [ test -f /opt/local/bin/port ]; then - CFLAGS="${CFLAGS} -I/opt/local/include" - LDFLAGS="${LDFLAGS} -L/opt/local/lib" - fi - fi - dnl> CXX=clang++ -fsanitize=address -fsanitize-address-use-after-scope - OSXV=`sw_vers -productVersion` - if test $SYSTEM = "Darwin"; then - OS="macOS $OSXV" - else - OS=`uname -or | cut -d '-' -f 1` - fi - if test $MACHINE = "x86_64"; then - LDFLAGS="${LDFLAGS} -L/usr/local/opt/ntopng" - RES=`g++ -Wall -fno-color-diagnostics Prefs.cpp 2>&1 | grep "unrecognized command line option "|wc -l` - if test $RES -eq 0; then - CFLAGS="-fno-color-diagnostics $CFLAGS" - fi - fi -fi - dnl> Remove spaces OS="${OS#"${OS%%[![:space:]]*}"}" @@ -220,15 +188,6 @@ fi LIBS="${LIBS} -lnetfilter_queue -lnfnetlink -lnetfilter_conntrack" fi -if test -d "/usr/local/include"; then - CFLAGS="${CFLAGS} -I/usr/local/include" - CXXFLAGS="${CXXFLAGS} -I/usr/local/include" -fi - -if test -d "/usr/local/lib"; then - LIBS="${LIBS} -L/usr/local/lib" -fi - if test -d /opt/local/include; then : CFLAGS="${CFLAGS} -I/opt/local/include" CXXFLAGS="${CXXFLAGS} -I/opt/local/include" @@ -282,15 +241,12 @@ AC_ARG_WITH(ndpi-includes, NDPI_CUST_INC="-I$withval -I$withval/../lib/third_party/include" ]) -if test -d /usr/local/include/ndpi ; then : - echo "WARNING: /usr/local/include/ndpi is present and might lead to compile errors" -fi - -NDPI_INC=`echo $NDPI_CFLAGS | sed -e "s/[ ]*$//"` -NDPI_LIB= -NDPI_LIB_DEP= - -AC_MSG_CHECKING(for nDPI source) +PKG_CHECK_MODULES([NDPI], [libndpi >= 2.0], [ + NDPI_INC=`echo $NDPI_CFLAGS | sed -e "s/[ ]*$//"` + NDPI_LIB="$NDPI_LIBS" + NDPI_LIB_DEP= + ], [ + AC_MSG_CHECKING(for nDPI source) if test -d "./nDPI" ; then : NDPI_HOME=./nDPI elif test -d "../nDPI" ; then : @@ -315,8 +271,8 @@ AC_MSG_CHECKING(for nDPI source) else AC_MSG_RESULT(not found) fi + ]) - if test ! -z "$NDPI_CUST_INC" ; then : NDPI_INC=$NDPI_CUST_INC fi -@@ -339,46 +295,9 @@ AC_ARG_WITH(json-c-static, +@@ -339,45 +295,10 @@ AC_ARG_WITH(json-c-static, [PKG_CHECK_MODULES(JSON, json-c, [], [AC_MSG_ERROR(Please install libjson-c-dev package prerequisite)])] ) -if test -x /bin/freebsd-version; then - FREEBSD_VERSION=`freebsd-version | cut -f 1 -d '.'` -fi -+SSL_INC="-I%%SSL_INC%%" -+SSL_LIB="-L%%SSL_LIB%% -lssl -lcrypto" -if test "${FREEBSD_VERSION}" != "14"; then -pkg-config --exists libssl -if test "$?" -ne 1; then - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) - SSL_INC="`pkg-config --cflags libssl` -I/usr/include/openssl" - SSL_LIB="`pkg-config --libs libssl` -lssl -lcrypto" -else - dnl Workaround for MacOS Brew - if test -d "/usr/local/Cellar/openssl@1.1"; then - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) - SSL_INC="-I/usr/local/Cellar/openssl@1.1/include" - SSL_LIB="-L/usr/local/Cellar/openssl@1.1 -lssl -lcrypto" - elif test -d "/usr/local/opt/openssl/lib"; then - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) - SSL_INC="-I/usr/local/opt/openssl/include" - SSL_LIB="-L/usr/local/opt/openssl/lib -lssl -lcrypto" - elif test -d "/opt/homebrew/Cellar/openssl@1.1"; then - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) - SSL_INC="-I/opt/homebrew/Cellar/openssl@1.1/include" - SSL_LIB="-L/opt/homebrew/Cellar/openssl@1.1 -lssl -lcrypto" - elif test -d "/usr/local/opt/openssl/lib"; then - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) - SSL_INC="-I/usr/local/opt/openssl/include" - SSL_LIB="-L/usr/local/opt/openssl/lib -lssl -lcrypto" - dnl Workaround for FreeBSD - elif test -f "/usr/lib/libssl.so"; then - AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) - SSL_INC="-I/usr/include" - SSL_LIB="-L/usr/lib -lssl -lcrypto" - else - echo "Please install openssl-dev(el) package prerequisite" - exit -1 - fi -fi -fi -- ++AC_DEFINE_UNQUOTED(NO_SSL_DL, 1, [has openssl]) ++SSL_INC="-I%%SSL_INC%%" ++SSL_LIB="-L%%SSL_LIB%% -lssl -lcrypto" + AC_MSG_CHECKING([PF_RING nBPF]) NBPF_HOME=${PWD}/../PF_RING/userland/nbpf - LIBNBPF=${NBPF_HOME}/libnbpf.a -@@ -510,12 +429,8 @@ AS_VAR_IF(with_hiredis, yes, [ +@@ -510,12 +431,8 @@ AS_VAR_IF(with_hiredis, yes, [ pkg-config --exists hiredis if test "$?" -ne 1; then HIREDIS_INC="`pkg-config --cflags hiredis` -I/usr/include/hiredis" - if test $SYSTEM = "FreeBSD"; then - HIREDIS_LIB="/usr/local/lib/libhiredis.a" + HIREDIS_LIB="`pkg-config --libs hiredis`" else - HIREDIS_LIB="`pkg-config --libs hiredis`" - fi - else echo "Please install hiredis package prerequisite" exit -1 fi -@@ -533,14 +448,14 @@ if test "${with_nedge+set}" != set; then +@@ -533,14 +450,14 @@ if test "${with_nedge+set}" != set; then fi if test $SYSTEM = "FreeBSD"; then - LIBPCAP="${PF_RING_HOME}/userland/libpcap/libpcap.a" + # Use pcap from base else if test -d ${PF_RING_HOME}; then AC_MSG_CHECKING(for PF_RING source installed in $PF_RING_HOME) fi fi - if test -f "/usr/local/lib/libpfring.a" || test -f "/opt/pfring/lib/libpfring.a" || test -f "${PF_RING_HOME}/userland/lib/libpfring.a"; then + if test -f "%%LOCALBASE%%/lib/libpfring.a" || test -f "/opt/pfring/lib/libpfring.a" || test -f "${PF_RING_HOME}/userland/lib/libpfring.a"; then AC_DEFINE_UNQUOTED(HAVE_PF_RING, 1, [Native PF_RING support]) if test -f "${PF_RING_HOME}/userland/lib/libpfring.a"; then echo "${PF_RING_HOME}/userland/libpcap/libpcap.a" -@@ -560,18 +475,18 @@ if test "${with_nedge+set}" != set; then +@@ -560,18 +477,18 @@ if test "${with_nedge+set}" != set; then CXXFLAGS="${CXXFLAGS} -I/opt/pfring/include" echo "Using PF_RING installed in /opt/pfring" else - if test -f "/usr/local/lib/libpfring.a"; then - if test -f "/usr/local/lib/libpcap.a"; then - LIBS="${LIBS} /usr/local/lib/libpfring.a" - echo "Using PF_RING installed in /usr/local/lib" + if test -f "%%LOCALBASE%%/lib/libpfring.a"; then + if test -f "%%LOCALBASE%%/lib/libpcap.a"; then + LIBS="${LIBS} %%LOCALBASE%%/lib/libpfring.a" + echo "Using PF_RING installed in %%LOCALBASE%%/lib" AC_CHECK_LIB([pcap], [pcap_open_live], pcap=true) if test x$pcap = x then - echo "Found /usr/local/lib/libpfring.a but missing header files." + echo "Found %%LOCALBASE%%/lib/libpfring.a but missing header files." exit 1 fi else - echo "Found /usr/local/lib/libpfring.a but missing libpcap.a in the same directory" + echo "Found %%LOCALBASE%%/lib/libpfring.a but missing libpcap.a in the same directory" echo "Please make sure you have installed your PF_RING libraries and try again" exit 1 fi -@@ -756,14 +671,12 @@ else +@@ -756,14 +673,12 @@ else echo "Building without support for MySQL libraries." fi else - if test "${FREEBSD_VERSION}" != "14"; then dnl> FreeBSD if test -f "/usr/local/lib/mysql/libmysqlclient.a"; then - MYSQL_LIB=/usr/local/lib/mysql/libmysqlclient.a - MYSQL_INC="-I /usr/local/include/mysql/" - AC_DEFINE_UNQUOTED(HAVE_MYSQL, 1, [use mysql]) + MYSQL_LIB="-L%%LOCALBASE%%/lib/mysql -lmysqlclient" + MYSQL_INC="-I%%LOCALBASE%%/include/mysql" + AC_DEFINE_UNQUOTED(HAVE_MYSQL, 1, [use mysql]) fi - fi fi AC_CHECK_LIB([expat], [XML_ParserCreate], expat=true)