Ticket #38276: patch-nfsen-Portfile.diff
File patch-nfsen-Portfile.diff, 6.7 KB (added by jul_bsd@…, 10 years ago) |
---|
-
net/nfsen//Portfile
old new 1 # -*- 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 1 2 # $Id: Portfile 87391 2011-11-19 06:25:15Z ryandesign@macports.org $ 2 3 3 4 PortSystem 1.0 4 5 5 6 name nfsen 6 version 1.3 7 revision 37 version 1.3.6p1 8 revision 0 8 9 categories net 9 10 maintainers markd 10 11 license BSD … … 15 16 platforms darwin 16 17 master_sites sourceforge:project/nfsen/stable/nfsen-${version} 17 18 18 checksums md5 1c4f057bbb3766090b40bda3ab6b81d2 19 checksums rmd160 b7a1c205bbde4276b8ab757c6fb1e69d23b28a5b \ 20 sha256 810e95546338622756deb919d7ee6c39721bc9873bb75dc7ec411ec0b87e1265 19 21 20 depends_lib port:perl5.12 \ 22 ## rrdtool is 5.16 only, so 23 depends_lib port:perl5.16 \ 21 24 port:rrdtool \ 22 port:p5.12-mailtools \ 23 port:p5.12-sys-syslog \ 25 port:p5.16-mailtools \ 26 port:p5.16-sys-syslog \ 27 port:p5.16-socket6 \ 24 28 port:nfdump 25 29 26 patchfiles patch-install.pl.diff \ 27 patch-etc-nfsen-dist.conf.diff \ 30 startupitem.create yes 31 startupitem.start "${prefix}/bin/nfsen start" 32 startupitem.stop "${prefix}/bin/nfsen stop" 33 startupitem.restart "${prefix}/bin/nfsen reconfig" 34 35 if {${subport} eq ${name}} { 36 37 use_configure no 38 build {} 39 40 patchfiles patch-etc-nfsen-dist.conf.diff \ 41 patch-install.pl.diff \ 28 42 patch-libexec-NfSenRC.pm.diff \ 29 43 patch-bin-nfsend.diff \ 30 44 patch-bin-nfsen.diff \ 31 45 patch-bin-testplugin.diff \ 32 46 patch-bin-RebuildHierarchy.pl.diff 33 34 use_configure no 35 build {} 36 37 startupitem.create yes 38 startupitem.executable ${prefix}/bin/nfsen 47 # patch-nfsen_php.diff 39 48 40 49 post-patch { 41 50 # Read the nfsen.conf comments for details on the use of these variables … … 58 67 ${worksrcpath}/install.pl 59 68 eval reinplace "s|__PREFIX__|${prefix}|g" \ 60 69 [glob ${worksrcpath}/bin/*] 61 eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.1 2|g" \70 eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.16|g" \ 62 71 [glob ${worksrcpath}/installer-items/*.pm] 63 72 } 64 73 74 destroot.asroot yes 65 75 destroot { 66 76 # Ugly hack because libexec/NfProfile.pm needs to be rewritten before a DESTDIR variable will work in install.pl. 67 77 # But unlike the perl modules, the profiles have no embedded path information so to solve the problem I made … … 79 89 # Set profiles-stat and profiles-data to destroot until install is done 80 90 reinplace "s|\${VARDIR}/profiles|${destroot}${prefix}/var/nfsen/profiles|g" \ 81 91 ${worksrcpath}/etc/nfsen-dist.conf 82 system -W ${worksrcpath} "${prefix}/bin/perl5.12 ./install.pl ./etc/nfsen-dist.conf" 92 ## need root 93 system -W ${worksrcpath} "${prefix}/bin/perl5.16 ./install.pl ./etc/nfsen-dist.conf" 83 94 84 95 # Replace the original .conf file 96 xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name}/ 85 97 file rename -force ${destroot}${prefix}/etc/nfsen-dist.conf.org \ 86 ${destroot}${prefix}/ etc/nfsen-dist.conf98 ${destroot}${prefix}/share/examples/${name}/nfsen-dist.conf 87 99 88 100 destroot.keepdirs \ 89 101 ${destroot}${prefix}/var/nfsen/run \ 90 102 ${destroot}${prefix}/var/nfsen/tmp \ 91 103 ${destroot}${prefix}/var/nfsen/filters \ 92 104 ${destroot}${prefix}/var/nfsen/fmt 105 106 copy ${filespath}/nginx-${name}.conf ${destroot}${prefix}/share/examples/${name}/nginx-${name}.conf.sample 107 108 ## patch stuff badly installed ... 109 delete ${destroot}${prefix}/bin/nfsend.orig ${destroot}${prefix}/etc/nfsen-dist.conf.orig ${destroot}${prefix}/libexec/nfsen/NfSenRC.pm.orig 93 110 } 94 111 95 112 post-activate { 96 113 97 ui_msg "\n **** To complete the nfsen installation **** 114 if ![file exists ${prefix}/etc/nfsen.conf] { 115 copy ${prefix}/share/examples/${name}/nfsen-dist.conf ${prefix}/etc/nfsen.conf 116 } 117 if ![file exists ${prefix}/etc/nginx/nginx-${name}.conf] { 118 copy ${prefix}/share/examples/${name}/nginx-${name}.conf.sample ${prefix}/etc/nginx/nginx-${name}.conf 119 } 120 121 notes " 122 **** To complete the nfsen installation **** 98 123 99 124 To complete the nfsen installation follow the steps below. Read the documentation 100 125 at http://nfsen.sourceforge.net for operational instructions. 101 126 102 127 103 1) Install PHP (not covered) .128 1) Install PHP (not covered) w php*-sockets. 104 129 105 2) In ${prefix}/etc, rename the file nfsen-dist.conf to nfsen.conf to make it ready106 for use; the file paths are already set for MacPorts. Edit it and insert the130 2) In ${prefix}/etc, if not existing, a default nfsen.conf has been created. 131 The file paths are already set for MacPorts. Edit it and insert the 107 132 netflow sources you need, and run this command to setup source, RRD, and profiles: 108 133 nfsen reconfig 109 134 … … 116 141 4) Start nfsen with the startup script after verifying configuration 117 142 sudo launchctl load -w /Library/LaunchDaemons/org.macports.nfsen.plist 118 143 119 5) Check the nfsen web interface at http://localhost/nfsen/nfsen.php 144 5) Configure your webserver 145 Apache 146 Nginx: if not existing, a sample configuration has been copied to ${prefix}/etc/nginx 147 148 6) Check the nfsen web interface at http://localhost/nfsen/nfsen.php 149 If you get a permission error, you may need to 150 # chmod 666 ${prefix}/var/nfsen/run/nfsen.comm 151 152 " 153 } 154 155 } 156 157 158 ## Broken for now, was working in 5.12, not recognizing prefix now??? 159 subport ${name}-devel { 160 161 PortGroup perl5 1.0 120 162 121 \n" 163 fetch.type svn 164 svn.url svn://svn.code.sf.net/p/nfsen/code/trunk 165 svn.revision r27 166 worksrcdir trunk 167 ## using perl Module::Build now, need to decide which perl or multiple variant? 168 ## +Config::IniHash 169 depends_build-append port:p5.16-module-build port:p5.16-file-which 170 171 patchfiles 172 ## FIXME! can't reset the followings: post-patch & destroot? 173 post-patch {} 174 configure.cmd perl5.16 175 configure.pre_args 176 configure.args Build.PL --install_base=${destroot}${prefix} 177 build.cmd ./Build 178 build.target 179 180 destroot.cmd ./Build 181 destroot.target install 182 183 post-destroot { 184 move ${destroot}${prefix}/man/man1/nfsen-admin.1pm ${destroot}${prefix}/share/man/man1/ 185 foreach f [glob -directory ${destroot}${prefix}/man/man3 *] { 186 move ${f} ${destroot}${prefix}/share/man/man3/ 187 } 188 } 122 189 } 123 190 124 191 livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix}