diff --git a/net-mgmt/nfsen/Makefile b/net-mgmt/nfsen/Makefile index de60562711e9..2d39f0881a7d 100644 --- a/net-mgmt/nfsen/Makefile +++ b/net-mgmt/nfsen/Makefile @@ -1,78 +1,81 @@ PORTNAME= nfsen -PORTVERSION= 1.3.8 -PORTREVISION= 1 +PORTVERSION= 1.3.11 +DISTVERSIONPREFIX=v. CATEGORIES= net-mgmt -MASTER_SITES= SF/${PORTNAME}/stable/${PORTNAME}-${PORTVERSION} \ - http://nfsen.sourceforge.net/ MAINTAINER= ports@FreeBSD.org COMMENT= Web based frontend to nfdump netflow collector -WWW= https://nfsen.sourceforge.net/ +WWW= https://github.com/phaag/nfsen LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/BSD-license.txt RUN_DEPENDS= rrdtool>=0:databases/rrdtool \ p5-Mail-Tools>=0:mail/p5-Mail-Tools \ p5-Socket6>=0:net/p5-Socket6 \ - nfdump>=0:net-mgmt/nfdump + nfdump>=1.7:net-mgmt/nfdump USES= cpe iconv shebangfix perl5 php + +USE_GITHUB= yes +GH_ACCOUNT= phaag + CPE_VENDOR= nfsen CPE_PRODUCT= nfsen USE_PHP= session sockets NO_BUILD= yes NO_ARCH= yes NFSENOWN?= www PLIST_SUB+= PORTNAME=${PORTNAME} PLIST_SUB+= NFSENOWN=${NFSENOWN} USE_RC_SUBR= nfsen perl_OLD_CMD= %%PERL%% -SHEBANG_FILES= bin/testPlugin bin/RebuildHierarchy.pl bin/nfsen bin/nfsend libexec/NfSenRRD.pm \ - libexec/NfAlert.pm libexec/NfProfile.pm libexec/Notification.pm libexec/NfSen.pm \ - libexec/NfConf.pm libexec/Lookup.pm libexec/AbuseWhois.pm libexec/NfSenRC.pm \ - libexec/Nfsources.pm +SHEBANG_FILES= bin/testPlugin bin/RebuildHierarchy.pl bin/nfsen bin/nfsend REINPLACE_ARGS= -i '' REINPLACE_LIST= bin/testPlugin bin/RebuildHierarchy.pl bin/nfsen bin/nfsend etc/nfsen-dist.conf libexec/NfConf.pm SUB_LIST+= "CONFDIR=${PREFIX}/etc" SUB_LIST+= "LIBEXECDIR=${PREFIX}/libexec/${PORTNAME}" SUB_LIST+= "PORTVERSION=${PORTVERSION}" SUB_LIST+= "PREFIX=${PREFIX}" SUB_LIST+= "WWWDIR=${WWWDIR}" SUB_LIST+= "PORTNAME=${PORTNAME}" SUB_LIST+= "NFSENOWN=${NFSENOWN}" +SUB_FILES= pkg-message + +PKGMESSAGE= ${WRKDIR}/pkg-message + post-patch: .for nfsenfile in ${REINPLACE_LIST} - @${REINPLACE_CMD} ${_SUB_LIST_TEMP} ${WRKSRC}/${nfsenfile} + @${REINPLACE_CMD} -i '' ${_SUB_LIST_TEMP} ${WRKSRC}/${nfsenfile} .endfor .for perlfile in ${SHEBANG_FILES} - @${REINPLACE_CMD} "s|perl -w$$|perl|" ${WRKSRC}/${perlfile} + @${REINPLACE_CMD} -i '' "s|perl -w$$|perl|" ${WRKSRC}/${perlfile} .endfor ${CP} ${FILESDIR}/conf.php ${WRKSRC} - @${REINPLACE_CMD} ${_SUB_LIST_TEMP} ${WRKSRC}/conf.php - @${REINPLACE_CMD} "s|/usr/bin/perl|${perl_CMD}|" ${WRKSRC}/libexec/Nfcomm.pm + @${REINPLACE_CMD} -i '' ${_SUB_LIST_TEMP} ${WRKSRC}/conf.php + @${REINPLACE_CMD} -i '' "s|/usr/bin/perl|${perl_CMD}|" ${WRKSRC}/libexec/Nfcomm.pm FIND_EXPR= ! -name \._* -prune do-install: ${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles-data/live ${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles-stat/live ${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles/live ${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/filters ${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/run ${INSTALL} -d ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/plugins ${INSTALL} -d ${STAGEDIR}/${WWWDIR}/plugins (cd ${WRKSRC}/bin && ${INSTALL_SCRIPT} * ${STAGEDIR}/${PREFIX}/bin/) ${INSTALL_DATA} ${WRKSRC}/etc/nfsen-dist.conf ${STAGEDIR}/${PREFIX}/etc/ (cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/ "${FIND_EXPR}") (cd ${WRKSRC}/plugins/frontend/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/plugins/ "${FIND_EXPR}") (cd ${WRKSRC}/libexec && ${INSTALL_SCRIPT} * ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/) (cd ${WRKSRC}/plugins/backend && ${COPYTREE_SHARE} . ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/plugins/ "${FIND_EXPR}") ${INSTALL_DATA} ${WRKSRC}/installer-items/CopyRecursive.pm ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/ ${INSTALL_DATA} ${WRKSRC}/installer-items/RRDconvertv1.pm ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/ ${INSTALL_DATA} ${WRKSRC}/conf.php ${STAGEDIR}/${WWWDIR} @${ECHO_MSG} "Configure your ${LOCALBASE}/etc/nfsen.conf to have necessary sources "; @${ECHO_MSG} "Then run 'nfsen reconfig' to correctly setup source, RRD, and profile files"; .include diff --git a/net-mgmt/nfsen/distinfo b/net-mgmt/nfsen/distinfo index 404259d27f01..8c32637ba7c4 100644 --- a/net-mgmt/nfsen/distinfo +++ b/net-mgmt/nfsen/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1485556082 -SHA256 (nfsen-1.3.8.tar.gz) = a7612e430357e683af81dbc07335b770b4ada115a6a88591e086ff5b6ed593a9 -SIZE (nfsen-1.3.8.tar.gz) = 221769 +TIMESTAMP = 1697496763 +SHA256 (phaag-nfsen-v.1.3.11_GH0.tar.gz) = a842531f4023913870d0fccf2d375bc335d7ecac9b2eeb7c2aff689a5c1ae962 +SIZE (phaag-nfsen-v.1.3.11_GH0.tar.gz) = 217135 diff --git a/net-mgmt/nfsen/files/patch-etc_nfsen-dist.conf b/net-mgmt/nfsen/files/patch-etc_nfsen-dist.conf index 6163b7da97bd..4749bca1e984 100644 --- a/net-mgmt/nfsen/files/patch-etc_nfsen-dist.conf +++ b/net-mgmt/nfsen/files/patch-etc_nfsen-dist.conf @@ -1,75 +1,75 @@ ---- etc/nfsen-dist.conf.ori 2008-05-29 13:33:01.000000000 -0700 -+++ etc/nfsen-dist.conf 2008-05-29 13:56:53.000000000 -0700 +--- etc/nfsen-dist.conf.orig 2023-10-06 08:13:20.000000000 -0700 ++++ etc/nfsen-dist.conf 2023-10-16 15:55:15.937534000 -0700 @@ -18,7 +18,7 @@ # # Required for default layout -$BASEDIR = "/data/nfsen"; +$BASEDIR = "%%PREFIX%%"; # # Where to install the NfSen binaries @@ -26,7 +26,7 @@ # # Where to install the NfSen Perl modules -$LIBEXECDIR="${BASEDIR}/libexec"; +$LIBEXECDIR="${BASEDIR}/libexec/%%PORTNAME%%"; # # Where to install the config files @@ -36,7 +36,7 @@ # NfSen html pages directory: # All php scripts will be installed here. # URL: Entry point for nfsen: http:///nfsen/nfsen.php -$HTMLDIR = "/var/www/nfsen/"; +$HTMLDIR = "%%PREFIX%%/www/%%PORTNAME%%"; # # Where to install the docs @@ -44,7 +44,7 @@ # # Var space for NfSen -$VARDIR="${BASEDIR}/var"; +$VARDIR="${BASEDIR}/var/%%PORTNAME%%"; - # # directory for all pid files -@@ -53,15 +53,15 @@ + # $PIDDIR="$VARDIR/run"; +@@ -60,15 +60,15 @@ # # The Profiles stat directory, where all profile information # RRD DBs and png pictures of the profile are stored -$PROFILESTATDIR="${BASEDIR}/profiles-stat"; +$PROFILESTATDIR="${VARDIR}/profiles-stat"; # # The Profiles directory, where all netflow data is stored -$PROFILEDATADIR="${BASEDIR}/profiles-data"; +$PROFILEDATADIR="${VARDIR}/profiles-data"; # # Where go all the backend plugins -$BACKEND_PLUGINDIR="${BASEDIR}/plugins"; +$BACKEND_PLUGINDIR="${LIBEXECDIR}/plugins"; # # Where go all the frontend plugins -@@ -69,7 +69,7 @@ +@@ -76,7 +76,7 @@ # # nfdump tools path -$PREFIX = '/usr/local/bin'; +$PREFIX = '%%PREFIX%%/bin'; # # nfsend communication socket -@@ -81,7 +81,7 @@ +@@ -88,7 +88,7 @@ # This may be a different or the same uid than your web server. # Note: This user must be in group $WWWGROUP, otherwise nfcapd # is not able to write data files! -$USER = "netflow"; +$USER = "www"; # user and group of the web server process # All netflow processing will be done with this user diff --git a/net-mgmt/nfsen/files/patch-libexec_NfSenRRD.pm b/net-mgmt/nfsen/files/patch-libexec_NfSenRRD.pm deleted file mode 100644 index b3f9ae85dd89..000000000000 --- a/net-mgmt/nfsen/files/patch-libexec_NfSenRRD.pm +++ /dev/null @@ -1,11 +0,0 @@ ---- libexec/NfSenRRD.pm.orig 2017-01-27 22:36:32 UTC -+++ libexec/NfSenRRD.pm -@@ -73,7 +73,7 @@ sub GetRRDoffset { - if ( $rrd_version < 1.1 ) { # it's RRD 1.0.x - $RRDoffset = 77; - } -- if ( $rrd_version >= 1.2 && $rrd_version < 1.6 ) { -+ if ( $rrd_version >= 1.2 ) { - $RRDoffset = 67; - } - diff --git a/net-mgmt/nfsen/files/pkg-message.in b/net-mgmt/nfsen/files/pkg-message.in new file mode 100644 index 000000000000..babfceb0cabf --- /dev/null +++ b/net-mgmt/nfsen/files/pkg-message.in @@ -0,0 +1,17 @@ +[ +{ type: install + message: <