Maintainer Update to net-mgmt/nfsen to version 1.2.4.20060325 - nfsen now supports reconfiguration for adding and removing netflow sources. The earlier attempt nfsen.reconfigure was wrong. - Fixes some bugs. - Now reguires nfdump 1.5 (beta also supported) Added file(s): - files/nfsen.sh Generated with FreeBSD Port Tools 0.63
State Changed From-To: open->feedback Few things: - you can't edit files belonging to port: @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${FILESDIR}/nfsen.sh Take a look on SUB_FILES and SUB_LIST variables on how to do it correctly. - this port leaves behind PREFIX/etc/nfsen.conf, please fix - this port changes group ownership of PREFIX/bin and PREFIX/etc to www, please fix
Responsible Changed From-To: freebsd-ports-bugs->pav Track
Any progress on this? --- Few things: - you can't edit files belonging to port: @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${FILESDIR}/nfsen.sh Take a look on SUB_FILES and SUB_LIST variables on how to do it correctly. - this port leaves behind PREFIX/etc/nfsen.conf, please fix - this port changes group ownership of PREFIX/bin and PREFIX/etc to www, please fix --- -- Pav Lucistnik <pav@oook.cz> <pav@FreeBSD.org> And now something completely different.
Hi Pav, Sorry I was very busy during the last week. I am sending a new version of the update. Since my port update Peter Haag (the original package author) fixed the group ownership problem. Here I send the new diff against the nfsen currently in a port tree. Regards, Janos Mohacsi Network Engineer, Research Associate NIIF/HUNGARNET, HUNGARY Key 00F9AF98: 8645 1312 D249 471B DBAE 21A2 9F52 0D1F 00F9 AF98 ----snip------ diff -ruN nfsen.orig/Makefile nfsen/Makefile --- nfsen.orig/Makefile Wed Mar 15 21:23:35 2006 +++ nfsen/Makefile Mon Apr 24 17:44:05 2006 @@ -6,28 +6,27 @@ # PORTNAME= nfsen -PORTVERSION= 1.2.3 +PORTVERSION= 1.2.4.20060412 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://nfsen.sourceforge.net/ MASTER_SITE_SUBDIR= ${PORTNAME} +DISTNAME= ${PORTNAME}-snapshot-20060412 MAINTAINER= janos.mohacsi@bsd.hu COMMENT= Web based frontend to nfdump netflow collector RUN_DEPENDS= ${SITE_PERL}/RRDp.pm:${PORTSDIR}/net/rrdtool -.if defined(WITH_IPV6) && !defined(NO_INET6) -RUN_DEPENDS+= nfdump:${PORTSDIR}/net-mgmt/nfdump-devel -.else RUN_DEPENDS+= nfdump:${PORTSDIR}/net-mgmt/nfdump -.endif USE_ICONV= yes USE_PERL5= yes USE_PHP= session pcre NO_BUILD= yes PLIST_SUB+= PORTNAME=${PORTNAME} +SUB_FILES= nfsen.sh +SUB_LIST= PREFIX=${PREFIX} .include <bsd.port.pre.mk> @@ -35,19 +34,36 @@ IGNORE= requires at least perl 5.6.0 .endif +pre-everything:: + @${ECHO_MSG} "" + @${ECHO_MSG} "*****************************************************" + @${ECHO_MSG} "Before upgrading you may backup the original profile " + @${ECHO_MSG} "stat data:" + @${ECHO_MSG} "cd ${WRKSRC}/helpers" + @${ECHO_MSG} "./mk_backup.sh /path/to/your/profilestatdir /path/to/backupdir" + @${ECHO_MSG} "*****************************************************" + @${ECHO_MSG} "" + post-patch: @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' -e 's,%%PORTNAME%%,${PORTNAME},' \ ${WRKSRC}/etc/nfsen-dist.conf - @${REINPLACE_CMD} -e 's,%%PERL%%,${PERL},' -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/install.pl @${RM} ${WRKSRC}/etc/nfsen-dist.conf.* + @${REINPLACE_CMD} -e 's,%%PERL%%,${PERL},' -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/install.pl do-install: @${MKDIR} ${PREFIX}/var/${PORTNAME}/profiles/live @${MKDIR} ${PREFIX}/libexec/${PORTNAME} ${INSTALL_DATA} ${WRKSRC}/installer-items/CopyRecursive.pm ${PREFIX}/libexec/${PORTNAME}/ - ${INSTALL_SCRIPT} ${WRKSRC}/install.pl ${PREFIX}/bin/nfsen-reconfigure - cd ${WRKSRC} ;${PERL} ${WRKSRC}/install.pl ${WRKSRC}/etc/nfsen-dist.conf - @${ECHO_MSG} "Configure your ${LOCALBASE}/etc/nfsen.conf to have necessary profiles "; - @${ECHO_MSG} "Then run 'nfsen-reconfigure ${LOCALBASE}/etc/nfsen.conf' to correctly setup profile files"; + ${INSTALL_DATA} ${WRKSRC}/installer-items/RRDconvertv1.pm ${PREFIX}/libexec/${PORTNAME}/ + ${INSTALL_SCRIPT} ${WRKDIR}/nfsen.sh ${PREFIX}/etc/rc.d/nfsen.sh.sample + @ if [ -f ${PREFIX}/etc/nfsen.conf ] ; then \ + ${ECHO_MSG} "installing with existing nfsen.conf"; \ + cd ${WRKSRC} ;${PERL} ${WRKSRC}/install.pl ${PREFIX}/etc/nfsen.conf; \ + else \ + ${ECHO_MSG} "installing with sample nfsen.conf"; \ + cd ${WRKSRC} ;${PERL} ${WRKSRC}/install.pl ${WRKSRC}/etc/nfsen-dist.conf; \ + fi + @${ECHO_MSG} "Configure your ${LOCALBASE}/etc/nfsen.conf to have necessary sources "; + @${ECHO_MSG} "Then run 'nfsen -R ${LOCALBASE}/etc/nfsen.conf' to correctly setup source, RRD, and profile files"; .include <bsd.port.post.mk> diff -ruN nfsen.orig/distinfo nfsen/distinfo --- nfsen.orig/distinfo Wed Mar 15 21:23:35 2006 +++ nfsen/distinfo Mon Apr 17 11:08:34 2006 @@ -1,3 +1,3 @@ -MD5 (nfsen-1.2.3.tar.gz) = bb18418d021526fea40bc3f88a837bc1 -SHA256 (nfsen-1.2.3.tar.gz) = dcd362f082d6a92b4400c69bf1784c3ee0c0e95a5c7c617ece36698ce7cba535 -SIZE (nfsen-1.2.3.tar.gz) = 3331295 +MD5 (nfsen-snapshot-20060412.tar.gz) = 9bec47c899d6d232479da57824725130 +SHA256 (nfsen-snapshot-20060412.tar.gz) = e34e1f28233a81b92ddb36129a7ff1072d5005208e1ce76231dd89029a93aa46 +SIZE (nfsen-snapshot-20060412.tar.gz) = 3357678 diff -ruN nfsen.orig/files/nfsen.sh.in nfsen/files/nfsen.sh.in --- nfsen.orig/files/nfsen.sh.in Thu Jan 1 01:00:00 1970 +++ nfsen/files/nfsen.sh.in Mon Apr 24 16:58:53 2006 @@ -0,0 +1,86 @@ +#! /bin/sh +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=%%PREFIX%%/bin/nfsen.rc +NAME=nfsen + +test -x $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $NAME" + $DAEMON start + echo "." + ;; + stop) + echo -n "Stopping $NAME " + $DAEMON stop + echo "." + ;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $NAME" + $DAEMON stop + sleep 1 + $DAEMON start + echo "." + ;; + *) + N=/tmp/nfsen-1.2.4.20060325/etc/rc.d/${NAME}.sh + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 +#! /bin/sh +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/local/bin/nfsen.rc +NAME=nfsen + +test -x $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $NAME" + $DAEMON start + echo "." + ;; + stop) + echo -n "Stopping $NAME " + $DAEMON stop + echo "." + ;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $NAME" + $DAEMON stop + sleep 1 + $DAEMON start + echo "." + ;; + *) + N=/tmp/nfsen-1.2.4.20060325/etc/rc.d/${NAME}.sh + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff -ruN nfsen.orig/files/patch-etc_nfsen-dist.conf nfsen/files/patch-etc_nfsen-dist.conf --- nfsen.orig/files/patch-etc_nfsen-dist.conf Fri Sep 9 15:48:43 2005 +++ nfsen/files/patch-etc_nfsen-dist.conf Mon Apr 24 17:43:09 2006 @@ -1,5 +1,5 @@ -$FreeBSD: ports/net-mgmt/nfsen/files/patch-etc_nfsen-dist.conf,v 1.2 2005/09/09 13:48:43 lawrance Exp $ +$FreeBSD$ --- etc/nfsen-dist.conf.orig +++ etc/nfsen-dist.conf @@ -17,7 +17,7 @@ # # Where to install the NfSen Perl modules -$LIBEXECDIR="${BASEDIR}/libexec"; -+$LIBEXECDIR="${BASEDIR}/libexec/%%PORTNAME%%/"; ++$LIBEXECDIR="${BASEDIR}/libexec/%%PORTNAME%%"; # # Where to install the config files @@ -26,7 +26,7 @@ # All php scripts will be installed here. # URL: Entry point for nfsen: http://<webserver>/nfsen/nfsen.php -$HTMLDIR = "/var/www/nfsen/"; -+$HTMLDIR = "%%PREFIX%%/www/%%PORTNAME%%/"; ++$HTMLDIR = "/%%PREFIX%%/www/%%PORTNAME%%/"; # # Where to install the docs @@ -55,6 +55,15 @@ # # Where go all the frontend plugins +@@ -73,7 +73,7 @@ + + # + # nfdump tools path +-$PREFIX = '/usr/local/bin'; ++$PREFIX = '%%PREFIX%%/bin'; + + # + # BASEDIR unrelated vars: @@ -82,7 +82,7 @@ # This may be a different or the same uid than your web server. # Note: This user must be in group $WWWGROUP, otherwise nfcapd @@ -64,10 +73,10 @@ # user and group of the web server process # All netflow processing will be done with this user -@@ -105,7 +105,7 @@ +@@ -106,7 +106,7 @@ %sources = ( - 'upstream1' => { 'port' => '9995', 'col' => '#0000ff' }, + 'upstream1' => { 'port' => '9995', 'col' => '#0000ff', 'type' => 'netflow' }, - 'peer1' => { 'port' => '9996', 'col' => '#ff0000' }, +# 'peer1' => { 'port' => '9996', 'col' => '#ff0000' }, ); diff -ruN nfsen.orig/files/patch-install.pl nfsen/files/patch-install.pl --- nfsen.orig/files/patch-install.pl Wed Mar 15 21:23:35 2006 +++ nfsen/files/patch-install.pl Mon Apr 24 16:38:47 2006 @@ -1,29 +1,29 @@ -$FreeBSD: ports/net-mgmt/nfsen/files/patch-install.pl,v 1.2 2006/03/15 13:35:54 mnag Exp $ +$FreeBSD$ --- install.pl.orig +++ install.pl @@ -1,4 +1,4 @@ --#!/usr/bin/perl -I installer-items +-#!/usr/bin/perl +#!%%PERL%% -I %%PREFIX%%/libexec/nfsen # # # Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung -@@ -56,33 +56,7 @@ +@@ -81,33 +81,7 @@ # Get Perl sub GetPerl { - my $whichperl; - my $ans; -- chomp($whichperl = `which perl`); -- if ( length $whichperl ) { +- $whichperl = FindCommand("perl"); +- if ( defined $whichperl ) { - print "Perl to use: [$whichperl] "; - chomp($ans = <STDIN>); - if ( length $ans ) { - $whichperl = $ans; - } - } else { -- print "No Perl found in PATH. Please specify where to find perl [] "; +- print "No Perl found in your PATH. Please specify where to find perl [] "; - chomp($whichperl = <STDIN>); - } - diff -ruN nfsen.orig/pkg-plist nfsen/pkg-plist --- nfsen.orig/pkg-plist Wed Mar 15 21:23:35 2006 +++ nfsen/pkg-plist Mon Apr 24 17:48:46 2006 @@ -1,21 +1,23 @@ bin/nfsen -bin/nfsen-reconfigure -bin/nfsen-run bin/nfsen.rc -bin/pid_check.pl +bin/nfsend bin/testPlugin +etc/rc.d/nfsen.sh.sample @unexec if cmp -s %D/etc/nfsen.conf %D/etc/nfsen-dist.conf; then rm -f %D/etc/nfsen.conf; fi -etc/nfsen-dist.conf @exec [ -f %D/etc/nfsen.conf ] || cp %D/etc/nfsen-dist.conf %D/etc/nfsen.conf -etc/nfsen-shell-param +etc/nfsen-dist.conf libexec/%%PORTNAME%%/CopyRecursive.pm libexec/%%PORTNAME%%/GenGraph.pl libexec/%%PORTNAME%%/Log.pm libexec/%%PORTNAME%%/NfConf.pm libexec/%%PORTNAME%%/NfProfile.pm libexec/%%PORTNAME%%/NfSen.pm +libexec/%%PORTNAME%%/NfSenRC.pm libexec/%%PORTNAME%%/NfSenRRD.pm +libexec/%%PORTNAME%%/Nfcomm.pm +libexec/%%PORTNAME%%/Nfsources.pm libexec/%%PORTNAME%%/Notification.pm +libexec/%%PORTNAME%%/RRDconvertv1.pm libexec/%%PORTNAME%%/plugins/demoplugin.pm www/%%PORTNAME%%/conf.php www/%%PORTNAME%%/EmptyGraph.gif @@ -47,7 +49,6 @@ www/%%PORTNAME%%/doc/InputEnd.png www/%%PORTNAME%%/doc/Navigating.png www/%%PORTNAME%%/doc/NewProfile.png -www/%%PORTNAME%%/doc/NfSen.html www/%%PORTNAME%%/doc/OutOfData.png www/%%PORTNAME%%/doc/ProcessingControls.png www/%%PORTNAME%%/doc/ProcessingOutput.png @@ -66,6 +67,7 @@ www/%%PORTNAME%%/doc/edit.png www/%%PORTNAME%%/doc/exiisting.png www/%%PORTNAME%%/doc/flows.png +www/%%PORTNAME%%/doc/index.html www/%%PORTNAME%%/doc/linegraph.png www/%%PORTNAME%%/doc/nfsen-options.png www/%%PORTNAME%%/doc/overview.png @@ -80,21 +82,7 @@ @dirrm www/%%PORTNAME%%/doc @dirrm www/%%PORTNAME%% @exec mkdir -p %D/var/%%PORTNAME%%/profiles/live/upstream1 -var/%%PORTNAME%%/profiles/live/flows.rrd -var/%%PORTNAME%%/profiles/live/flows_tcp.rrd -var/%%PORTNAME%%/profiles/live/flows_udp.rrd -var/%%PORTNAME%%/profiles/live/flows_icmp.rrd -var/%%PORTNAME%%/profiles/live/flows_other.rrd -var/%%PORTNAME%%/profiles/live/packets.rrd -var/%%PORTNAME%%/profiles/live/packets_tcp.rrd -var/%%PORTNAME%%/profiles/live/packets_udp.rrd -var/%%PORTNAME%%/profiles/live/packets_icmp.rrd -var/%%PORTNAME%%/profiles/live/packets_other.rrd -var/%%PORTNAME%%/profiles/live/traffic.rrd -var/%%PORTNAME%%/profiles/live/traffic_tcp.rrd -var/%%PORTNAME%%/profiles/live/traffic_udp.rrd -var/%%PORTNAME%%/profiles/live/traffic_icmp.rrd -var/%%PORTNAME%%/profiles/live/traffic_other.rrd +var/%%PORTNAME%%/profiles/live/upstream1.rrd var/%%PORTNAME%%/profiles/live/profile.dat @exec mkdir -p %D/var/%%PORTNAME%%/run @exec mkdir -p %D/var/%%PORTNAME%%/filters
State Changed From-To: feedback->closed Committed, thanks!