# -*- 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 PortGroup perl5 1.0 # port is broken, see https://trac.macports.org/ticket/38276 name nfsen version 1.3.7 revision 1 categories net maintainers nomaintainer license BSD supported_archs noarch 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 rmd160 60981d49f6fa4de434c8849ff326b6568fb17937 \ sha256 635ba97564fe81cbeee0a3950735b9651677b69e1f53a67c654ddd5b00db469d perl5.branches 5.24 depends_lib port:perl${perl5.major} \ port:p${perl5.major}-mailtools \ port:p${perl5.major}-socket6 \ port:p${perl5.major}-sys-syslog \ port:rrdtool \ 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 use_configure no build {} startupitem.create yes startupitem.executable ${prefix}/bin/nfsen post-patch { # Read the nfsen.conf comments for details on the use of these variables 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|${perl5.bin}|g" \ [glob ${worksrcpath}/installer-items/*.pm] } destroot { # Ugly hack because libexec/NfProfile.pm needs to be rewritten before a DESTDIR variable will work in install.pl. # But unlike the perl modules, the profiles have no embedded path information so to solve the problem I made # no modifications to install.pl in profile sections. I just backup the .conf file, set the profile directories # 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 # Backup the .conf file 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} "${perl5.bin} ./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 destroot.keepdirs \ ${destroot}${prefix}/var/nfsen/run \ ${destroot}${prefix}/var/nfsen/tmp \ ${destroot}${prefix}/var/nfsen/filters \ ${destroot}${prefix}/var/nfsen/fmt } notes " To complete the nfsen installation follow the steps below. Read the documentation\ at ${homepage} for operational instructions. 1) Install PHP (not covered). 2) In ${prefix}/etc, copy the file nfsen-dist.conf to nfsen.conf to make it ready\ for use; the file paths are already set for MacPorts. Edit it and insert the\ netflow sources you need, and run this command to setup source, RRD, and profiles: nfsen reconfig 3) Start nfsen manually to test the configuration. nfsen start NOTE: nfsen starts nfcapd (nfdump utility) automatically to capture netflows from your devices\ based on the sources listed in nfsen.conf. 4) Start nfsen with the startup script after verifying configuration sudo port load ${name} 5) Check the nfsen web interface at http://localhost/nfsen/nfsen.php " livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix}