# -*- 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 name nfsen version 1.3.6 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 4399b0fe1807b9aeea1c4bcff094e2c8a0235e80 \ sha256 c5809505544ea2cf5bac69a9829b7d7d78649b67a772519aa8a191b1a25fd918 depends_lib port:perl5.16 \ port:rrdtool \ port:p5.16-mailtools \ port:p5.16-socket6 \ port:p5.16-sys-syslog \ port:nfdump patchfiles patch-install.pl.diff \ patch-etc-nfsen-dist.conf.diff \ patch-libexec-NfProfile.pm.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|${prefix}/bin/perl5.16|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} "${prefix}/bin/perl5.16 ./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}