Revision: 129020 https://trac.macports.org/changeset/129020 Author: devans@macports.org Date: 2014-12-03 08:16:35 -0800 (Wed, 03 Dec 2014) Log Message: ----------- nfsen: add mode line and retab, white space only. Modified Paths: -------------- trunk/dports/net/nfsen/Portfile trunk/dports/net/nfsen/files/patch-etc-nfsen-dist.conf.diff trunk/dports/net/nfsen/files/patch-install.pl.diff Added Paths: ----------- trunk/dports/net/nfsen/files/patch-libexec-NfProfile.pm.diff Modified: trunk/dports/net/nfsen/Portfile =================================================================== --- trunk/dports/net/nfsen/Portfile 2014-12-03 15:39:35 UTC (rev 129019) +++ trunk/dports/net/nfsen/Portfile 2014-12-03 16:16:35 UTC (rev 129020) @@ -1,37 +1,38 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ -PortSystem 1.0 +PortSystem 1.0 -name nfsen -version 1.3 -revision 3 -categories net -maintainers nomaintainer -license BSD +name nfsen +version 1.3 +revision 3 +categories net +maintainers nomaintainer +license BSD -description Web based frontend to nfdump netflow collector -long_description ${description} -homepage http://nfsen.sourceforge.net/ -platforms darwin -master_sites sourceforge:project/nfsen/stable/nfsen-${version} +description Web based frontend to nfdump netflow collector +long_description ${description} +homepage http://nfsen.sourceforge.net/ +platforms darwin +master_sites sourceforge:project/nfsen/stable/nfsen-${version} -checksums md5 1c4f057bbb3766090b40bda3ab6b81d2 +checksums md5 1c4f057bbb3766090b40bda3ab6b81d2 -depends_lib port:perl5.12 \ - port:rrdtool \ - port:p5.12-mailtools \ - port:p5.12-sys-syslog \ - port:nfdump +depends_lib port:perl5.12 \ + port:rrdtool \ + port:p5.12-mailtools \ + port:p5.12-sys-syslog \ + port:nfdump -patchfiles patch-install.pl.diff \ - patch-etc-nfsen-dist.conf.diff \ - patch-libexec-NfSenRC.pm.diff \ - patch-bin-nfsend.diff \ - patch-bin-nfsen.diff \ - patch-bin-testplugin.diff \ - patch-bin-RebuildHierarchy.pl.diff +patchfiles patch-install.pl.diff \ + patch-etc-nfsen-dist.conf.diff \ + patch-libexec-NfSenRC.pm.diff \ + patch-bin-nfsend.diff \ + patch-bin-nfsen.diff \ + patch-bin-testplugin.diff \ + patch-bin-RebuildHierarchy.pl.diff -use_configure no +use_configure no build {} startupitem.create yes @@ -40,26 +41,25 @@ post-patch { # Read the nfsen.conf comments for details on the use of these variables -set netflowuser "www" -set wwwuser "www" -set wwwgroup "www" +set netflowuser "www" +set wwwuser "www" +set wwwgroup "www" - reinplace "s|__NETFLOWUSER__|${netflowuser}|g" \ - ${worksrcpath}/etc/nfsen-dist.conf \ - ${worksrcpath}/libexec/NfSenRC.pm - reinplace "s|__WWWUSER__|${wwwuser}|g" \ - ${worksrcpath}/etc/nfsen-dist.conf - reinplace "s|__WWWGROUP__|${wwwgroup}|g" \ - ${worksrcpath}/etc/nfsen-dist.conf - - reinplace "s|__PREFIX__|${prefix}|g" \ - ${worksrcpath}/install.pl - reinplace "s|__DESTDIR__|${destroot}|g" \ - ${worksrcpath}/install.pl - eval reinplace "s|__PREFIX__|${prefix}|g" \ - [glob ${worksrcpath}/bin/*] - eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.12|g" \ - [glob ${worksrcpath}/installer-items/*.pm] + reinplace "s|__NETFLOWUSER__|${netflowuser}|g" \ + ${worksrcpath}/etc/nfsen-dist.conf \ + ${worksrcpath}/libexec/NfSenRC.pm + reinplace "s|__WWWUSER__|${wwwuser}|g" \ + ${worksrcpath}/etc/nfsen-dist.conf + reinplace "s|__WWWGROUP__|${wwwgroup}|g" \ + ${worksrcpath}/etc/nfsen-dist.conf + reinplace "s|__PREFIX__|${prefix}|g" \ + ${worksrcpath}/install.pl + reinplace "s|__DESTDIR__|${destroot}|g" \ + ${worksrcpath}/install.pl + eval reinplace "s|__PREFIX__|${prefix}|g" \ + [glob ${worksrcpath}/bin/*] + eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.12|g" \ + [glob ${worksrcpath}/installer-items/*.pm] } destroot { @@ -69,27 +69,27 @@ # to point to destroot, and after the install replace the previous .conf file that points to profiles in PREFIX. # Yuch! I've asked the developers to add DESTDIR support in a future version. - reinplace "s|__PREFIX__|${prefix}|g" \ - ${worksrcpath}/etc/nfsen-dist.conf + reinplace "s|__PREFIX__|${prefix}|g" \ + ${worksrcpath}/etc/nfsen-dist.conf # Backup the .conf file - file copy ${worksrcpath}/etc/nfsen-dist.conf \ - ${worksrcpath}/etc/nfsen-dist.conf.org + copy ${worksrcpath}/etc/nfsen-dist.conf \ + ${worksrcpath}/etc/nfsen-dist.conf.org # Set profiles-stat and profiles-data to destroot until install is done - reinplace "s|\${VARDIR}/profiles|${destroot}${prefix}/var/nfsen/profiles|g" \ - ${worksrcpath}/etc/nfsen-dist.conf - system -W ${worksrcpath} "${prefix}/bin/perl5.12 ./install.pl ./etc/nfsen-dist.conf" + reinplace "s|\${VARDIR}/profiles|${destroot}${prefix}/var/nfsen/profiles|g" \ + ${worksrcpath}/etc/nfsen-dist.conf + system -W ${worksrcpath} "${prefix}/bin/perl5.12 ./install.pl ./etc/nfsen-dist.conf" # Replace the original .conf file - file rename -force ${destroot}${prefix}/etc/nfsen-dist.conf.org \ - ${destroot}${prefix}/etc/nfsen-dist.conf + file rename -force ${destroot}${prefix}/etc/nfsen-dist.conf.org \ + ${destroot}${prefix}/etc/nfsen-dist.conf - destroot.keepdirs \ - ${destroot}${prefix}/var/nfsen/run \ - ${destroot}${prefix}/var/nfsen/tmp \ - ${destroot}${prefix}/var/nfsen/filters \ - ${destroot}${prefix}/var/nfsen/fmt + destroot.keepdirs \ + ${destroot}${prefix}/var/nfsen/run \ + ${destroot}${prefix}/var/nfsen/tmp \ + ${destroot}${prefix}/var/nfsen/filters \ + ${destroot}${prefix}/var/nfsen/fmt } post-activate { @@ -121,4 +121,4 @@ \n" } -livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix} +livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix} Modified: trunk/dports/net/nfsen/files/patch-etc-nfsen-dist.conf.diff =================================================================== --- trunk/dports/net/nfsen/files/patch-etc-nfsen-dist.conf.diff 2014-12-03 15:39:35 UTC (rev 129019) +++ trunk/dports/net/nfsen/files/patch-etc-nfsen-dist.conf.diff 2014-12-03 16:16:35 UTC (rev 129020) @@ -1,5 +1,5 @@ ---- etc/nfsen-dist.conf.org 2007-11-20 04:27:39.000000000 -0800 -+++ etc/nfsen-dist.conf 2008-02-12 14:50:04.000000000 -0800 +--- etc/nfsen-dist.conf.orig 2011-12-29 04:38:38.000000000 -0800 ++++ etc/nfsen-dist.conf 2014-12-03 07:31:47.000000000 -0800 @@ -18,7 +18,7 @@ # @@ -34,9 +34,9 @@ -$VARDIR="${BASEDIR}/var"; +$VARDIR="${BASEDIR}/var/nfsen"; - # # 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 @@ -55,7 +55,7 @@ # # Where go all the frontend plugins -@@ -69,7 +69,7 @@ +@@ -76,7 +76,7 @@ # # nfdump tools path @@ -64,7 +64,7 @@ # # nfsend communication socket -@@ -81,12 +81,12 @@ +@@ -88,12 +88,12 @@ # 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! @@ -80,12 +80,14 @@ # Receive buffer size for nfcapd - see man page nfcapd(1) $BUFFLEN = 200000; -@@ -136,7 +136,7 @@ +@@ -158,8 +158,8 @@ %sources = ( - 'upstream1' => { 'port' => '9995', 'col' => '#0000ff', 'type' => 'netflow' }, -- 'peer1' => { 'port' => '9996', 'col' => '#ff0000' }, -+# 'peer1' => { 'port' => '9996', 'col' => '#ff0000' }, + 'upstream1' => { 'port' => '9995', 'col' => '#0000ff', 'type' => 'netflow' }, +- 'peer1' => { 'port' => '9996', 'IP' => '172.16.17.18' }, +- 'peer2' => { 'port' => '9996', 'IP' => '172.16.17.19' }, ++# 'peer1' => { 'port' => '9996', 'IP' => '172.16.17.18' }, ++# 'peer2' => { 'port' => '9996', 'IP' => '172.16.17.19' }, ); # Modified: trunk/dports/net/nfsen/files/patch-install.pl.diff =================================================================== --- trunk/dports/net/nfsen/files/patch-install.pl.diff 2014-12-03 15:39:35 UTC (rev 129019) +++ trunk/dports/net/nfsen/files/patch-install.pl.diff 2014-12-03 16:16:35 UTC (rev 129020) @@ -1,77 +1,78 @@ ---- install.pl.org 2007-11-21 01:12:04.000000000 -0800 -+++ install.pl 2008-02-09 20:52:23.000000000 -0800 +--- install.pl.orig 2011-12-30 06:23:35.000000000 -0800 ++++ install.pl 2014-12-03 07:26:35.000000000 -0800 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -+#!__PREFIX__/bin/perl -I __PREFIX__/libexec/nfsen -I __DESTDIR____PREFIX__/libexec/nfsen ++#!__PREFIX__/bin/perl5.16 -I __PREFIX__/libexec/nfsen -I __DESTDIR____PREFIX__/libexec/nfsen # # # Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung -@@ -283,8 +283,8 @@ +@@ -277,8 +277,8 @@ sub PatchAllScripts { my %GlobList = ( -- "bin/*" => "$NfConf::BINDIR", -- "libexec/*" => "$NfConf::LIBEXECDIR" +- "bin/*" => "$NfConf::INSTPREFIX$NfConf::BINDIR", +- "libexec/*" => "$NfConf::INSTPREFIX$NfConf::LIBEXECDIR" + "bin/*" => "__DESTDIR____PREFIX__/bin", + "libexec/*" => "__DESTDIR____PREFIX__/libexec/nfsen" ); foreach my $glob_list ( keys %GlobList ) { -@@ -334,15 +334,14 @@ +@@ -328,16 +328,15 @@ my ( $nfsen_uid, $www_gid ) = @_; print "Setup php and html files.\n"; -- mkdir "$NfConf::HTMLDIR" unless -d "$NfConf::HTMLDIR"; -- die "Could not create HTMl directory '$NfConf::HTMLDIR': $!\n" unless -d $NfConf::HTMLDIR; -+ mkdir "__DESTDIR____PREFIX__/www/nfsen"; +- mkpath("$NfConf::INSTPREFIX$NfConf::HTMLDIR", 1, 0755) unless -d "$NfConf::INSTPREFIX$NfConf::HTMLDIR"; +- die "Could not create HTMl directory '$NfConf::INSTPREFIX$NfConf::HTMLDIR': $!\n" unless -d "$NfConf::INSTPREFIX$NfConf::HTMLDIR"; ++ mkdir "__DESTDIR____PREFIX__/www/nfsen"; $CopyRecursive::CopyLink = 1; $CopyRecursive::MODE = 0644; $CopyRecursive::UID = 0; $CopyRecursive::GID = $www_gid; -- CopyRecursive::dircopy("html", "$NfConf::HTMLDIR"); -- open CONF, ">$NfConf::HTMLDIR/conf.php" || die "Can't open conf.php for writing: $!\n"; -+ CopyRecursive::dircopy("html", "__DESTDIR____PREFIX__/www/nfsen"); -+ open CONF, ">__DESTDIR____PREFIX__/www/nfsen/conf.php" || die "Can't open conf.php for writing: $!\n"; - print CONF "<?\n"; - print CONF "/* This file was automatically created by the NfSen install.pl script */\n\n"; +- CopyRecursive::dircopy("html", "$NfConf::INSTPREFIX$NfConf::HTMLDIR"); +- open CONF, ">$NfConf::INSTPREFIX$NfConf::HTMLDIR/conf.php" || die "Can't open conf.php for writing: $!\n"; +- print CONF "<?php\n"; ++ CopyRecursive::dircopy("html", "__DESTDIR____PREFIX__/www/nfsen"); ++ open CONF, ">__DESTDIR____PREFIX__/www/nfsen/conf.php" || die "Can't open conf.php for writing: $!\n"; ++ print CONF "<?php\n"; + print CONF "/* This file was automatically created by the NfSen $nfsen_version install.pl script */\n\n"; print CONF "\$COMMSOCKET = \"$NfConf::COMMSOCKET\";\n"; -@@ -362,11 +361,11 @@ + print CONF "\n\$DEBUG=0;\n"; +@@ -356,11 +355,11 @@ umask 0002; print "\nSetup diretories:\n"; my @dirs = ( -- "$NfConf::VARDIR", -- "$NfConf::PIDDIR", -- "$NfConf::VARDIR/tmp", -- "$NfConf::VARDIR/filters", -- "$NfConf::VARDIR/fmt", -+ "__DESTDIR____PREFIX__/var/nfsen", -+ "__DESTDIR____PREFIX__/var/nfsen/run", -+ "__DESTDIR____PREFIX__/var/nfsen/tmp", -+ "__DESTDIR____PREFIX__/var/nfsen/filters", -+ "__DESTDIR____PREFIX__/var/nfsen/fmt", - "$NfConf::PROFILESTATDIR", - "$NfConf::PROFILESTATDIR/live", - "$NfConf::PROFILEDATADIR", -@@ -585,21 +584,15 @@ +- "$NfConf::INSTPREFIX$NfConf::VARDIR", +- "$NfConf::INSTPREFIX$NfConf::VARDIR/tmp", +- "$NfConf::INSTPREFIX$NfConf::PIDDIR", +- "$NfConf::INSTPREFIX$NfConf::FILTERDIR", +- "$NfConf::INSTPREFIX$NfConf::FORMATDIR", ++ "__DESTDIR____PREFIX__/var/nfsen", ++ "__DESTDIR____PREFIX__/var/nfsen/tmp", ++ "__DESTDIR____PREFIX__/var/nfsen/run", ++ "__DESTDIR____PREFIX__/var/nfsen/filters", ++ "__DESTDIR____PREFIX__/var/nfsen/fmt", + "$NfConf::INSTPREFIX$NfConf::PROFILESTATDIR", + "$NfConf::INSTPREFIX$NfConf::PROFILESTATDIR/live", + "$NfConf::INSTPREFIX$NfConf::PROFILEDATADIR", +@@ -579,20 +578,14 @@ $CopyRecursive::UID = 0; $CopyRecursive::GID = $www_gid; $CopyRecursive::MODE = 0755; - unlink "$NfConf::BINDIR/nfsen.rc"; -- CopyRecursive::dircopy("bin", "$NfConf::BINDIR"); -- CopyRecursive::dircopy("libexec", "$NfConf::LIBEXECDIR"); -+ unlink "__DESTDIR____PREFIX__/bin/nfsen.rc"; -+ CopyRecursive::dircopy("bin", "__DESTDIR____PREFIX__/bin"); -+ CopyRecursive::dircopy("libexec", "__DESTDIR____PREFIX__/libexec/nfsen"); - $CopyRecursive::MODE = 0644; -- CopyRecursive::dircopy("etc", "$NfConf::CONFDIR"); -- CopyRecursive::dircopy("plugins/backend", "$NfConf::BACKEND_PLUGINDIR"); -- CopyRecursive::dircopy("plugins/frontend", "$NfConf::FRONTEND_PLUGINDIR"); -- CopyRecursive::dircopy("doc", "$NfConf::DOCDIR"); -+ CopyRecursive::dircopy("etc", "__DESTDIR____PREFIX__/etc"); -+ CopyRecursive::dircopy("plugins/backend", "__DESTDIR____PREFIX__/libexec/nfsen/plugins"); -+ CopyRecursive::dircopy("plugins/frontend", "__DESTDIR____PREFIX__/www/nfsen/plugins"); -+ CopyRecursive::dircopy("doc", "__DESTDIR____PREFIX__/www/nfsen/doc"); +- CopyRecursive::dircopy("bin", "$NfConf::INSTPREFIX$NfConf::BINDIR"); +- CopyRecursive::dircopy("libexec", "$NfConf::INSTPREFIX$NfConf::LIBEXECDIR"); +- $CopyRecursive::MODE = 0644; +- CopyRecursive::dircopy("etc", "$NfConf::INSTPREFIX$NfConf::CONFDIR"); +- CopyRecursive::dircopy("plugins/backend", "$NfConf::INSTPREFIX$NfConf::BACKEND_PLUGINDIR"); +- CopyRecursive::dircopy("plugins/frontend", "$NfConf::INSTPREFIX$NfConf::FRONTEND_PLUGINDIR"); ++ unlink "__DESTDIR____PREFIX__/bin/nfsen.rc"; ++ CopyRecursive::dircopy("bin", "__DESTDIR____PREFIX__/bin"); ++ CopyRecursive::dircopy("libexec", "__DESTDIR____PREFIX__/libexec/nfsen"); ++ $CopyRecursive::MODE = 0644; ++ CopyRecursive::dircopy("etc", "__DESTDIR____PREFIX__/etc"); ++ CopyRecursive::dircopy("plugins/backend", "__DESTDIR____PREFIX__/libexec/nfsen/plugins"); ++ CopyRecursive::dircopy("plugins/frontend", "__DESTDIR____PREFIX__/www/nfsen/plugins"); - if ( $ConfigFile eq "$NfConf::CONFDIR/nfsen.conf" ) { - print "Keep config file '$ConfigFile'\n"; @@ -82,7 +83,7 @@ print "\n"; } # End of CopyAllFiles -@@ -669,12 +662,6 @@ +@@ -663,12 +656,6 @@ exit 1; } @@ -92,6 +93,6 @@ - die "Extra nfsen.conf file in etc directory found. Remove errornous file first" -} - + Log::LogInit(); + my $hints = NfSen::LoadHints(); - if ( $$$hints{'version'} == -1 ) { - # initial NfSen install or upgrade from old version without hints Added: trunk/dports/net/nfsen/files/patch-libexec-NfProfile.pm.diff =================================================================== --- trunk/dports/net/nfsen/files/patch-libexec-NfProfile.pm.diff (rev 0) +++ trunk/dports/net/nfsen/files/patch-libexec-NfProfile.pm.diff 2014-12-03 16:16:35 UTC (rev 129020) @@ -0,0 +1,10 @@ +--- libexec/NfProfile.pm.orig 2014-12-03 08:02:49.000000000 -0800 ++++ libexec/NfProfile.pm 2014-12-03 08:03:33.000000000 -0800 +@@ -41,6 +41,7 @@ + use Fcntl qw(:DEFAULT :flock); + + use NfSen; ++use NfSync; + use NfSenRRD; + use Log; +
participants (1)
-
devans@macports.org