diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2006-04-25 18:22:23 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2006-04-25 18:22:23 +0000 |
commit | d1ace2a653bf5db51c75e5ca7531326cbac60e93 (patch) | |
tree | cf2fe6194d61e6074da16d952ac28f04572a8329 /net-mgmt/nfsen-devel | |
parent | 502affb309685a9af275800f068c3a6a029a1ba1 (diff) | |
download | ports-d1ace2a653bf5db51c75e5ca7531326cbac60e93.tar.gz ports-d1ace2a653bf5db51c75e5ca7531326cbac60e93.zip |
Notes
Diffstat (limited to 'net-mgmt/nfsen-devel')
-rw-r--r-- | net-mgmt/nfsen-devel/Makefile | 39 | ||||
-rw-r--r-- | net-mgmt/nfsen-devel/distinfo | 6 | ||||
-rw-r--r-- | net-mgmt/nfsen-devel/files/nfsen.sh.in | 86 | ||||
-rw-r--r-- | net-mgmt/nfsen-devel/files/patch-etc_nfsen-dist.conf | 15 | ||||
-rw-r--r-- | net-mgmt/nfsen-devel/files/patch-install.pl | 10 | ||||
-rw-r--r-- | net-mgmt/nfsen-devel/pkg-plist | 29 |
6 files changed, 140 insertions, 45 deletions
diff --git a/net-mgmt/nfsen-devel/Makefile b/net-mgmt/nfsen-devel/Makefile index 5ea22e564604..9ec08c4dc08a 100644 --- a/net-mgmt/nfsen-devel/Makefile +++ b/net-mgmt/nfsen-devel/Makefile @@ -6,28 +6,25 @@ # 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 +RUN_DEPENDS= ${SITE_PERL}/RRDp.pm:${PORTSDIR}/net/rrdtool \ + nfdump:${PORTSDIR}/net-mgmt/nfdump USE_ICONV= yes USE_PERL5= yes USE_PHP= session pcre NO_BUILD= yes PLIST_SUB+= PORTNAME=${PORTNAME} +USE_RC_SUBR= nfsen.sh .include <bsd.port.pre.mk> @@ -35,19 +32,35 @@ PLIST_SUB+= PORTNAME=${PORTNAME} 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}/ + @ 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 --git a/net-mgmt/nfsen-devel/distinfo b/net-mgmt/nfsen-devel/distinfo index c5efbfcb18ce..091718d0eed7 100644 --- a/net-mgmt/nfsen-devel/distinfo +++ b/net-mgmt/nfsen-devel/distinfo @@ -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 --git a/net-mgmt/nfsen-devel/files/nfsen.sh.in b/net-mgmt/nfsen-devel/files/nfsen.sh.in new file mode 100644 index 000000000000..83ecfc335215 --- /dev/null +++ b/net-mgmt/nfsen-devel/files/nfsen.sh.in @@ -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 --git a/net-mgmt/nfsen-devel/files/patch-etc_nfsen-dist.conf b/net-mgmt/nfsen-devel/files/patch-etc_nfsen-dist.conf index 999891b1f352..0d260cabe3a4 100644 --- a/net-mgmt/nfsen-devel/files/patch-etc_nfsen-dist.conf +++ b/net-mgmt/nfsen-devel/files/patch-etc_nfsen-dist.conf @@ -17,7 +17,7 @@ $FreeBSD$ # # Where to install the NfSen Perl modules -$LIBEXECDIR="${BASEDIR}/libexec"; -+$LIBEXECDIR="${BASEDIR}/libexec/%%PORTNAME%%/"; ++$LIBEXECDIR="${BASEDIR}/libexec/%%PORTNAME%%"; # # Where to install the config files @@ -55,6 +55,15 @@ $FreeBSD$ # # 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 @@ $FreeBSD$ # 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 --git a/net-mgmt/nfsen-devel/files/patch-install.pl b/net-mgmt/nfsen-devel/files/patch-install.pl index dd144f62fb55..4b4113a85cc1 100644 --- a/net-mgmt/nfsen-devel/files/patch-install.pl +++ b/net-mgmt/nfsen-devel/files/patch-install.pl @@ -4,26 +4,26 @@ $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 --git a/net-mgmt/nfsen-devel/pkg-plist b/net-mgmt/nfsen-devel/pkg-plist index 561603d08ca1..b52d4652cec5 100644 --- a/net-mgmt/nfsen-devel/pkg-plist +++ b/net-mgmt/nfsen-devel/pkg-plist @@ -1,21 +1,22 @@ bin/nfsen -bin/nfsen-reconfigure -bin/nfsen-run bin/nfsen.rc -bin/pid_check.pl +bin/nfsend bin/testPlugin @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 +48,6 @@ www/%%PORTNAME%%/doc/DisabledSources.png 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 +66,7 @@ www/%%PORTNAME%%/doc/dirstruct.png 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 +81,7 @@ www/%%PORTNAME%%/doc/views.png @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 |