Ticket #38276: patch-nfsen-Portfile2

File patch-nfsen-Portfile2, 4.5 KB (added by jul_bsd@…, 11 years ago)
Line 
1--- ../../_orig/net/nfsen/Portfile      2013-07-15 12:03:06.000000000 -0400
2+++ Portfile    2014-03-06 16:36:23.000000000 -0500
3@@ -3,8 +3,8 @@
4 PortSystem      1.0
5 
6 name            nfsen
7-version         1.3
8-revision        3
9+version         1.3.6p1
10+revision        0
11 categories      net
12 maintainers     markd
13 license         BSD
14@@ -15,28 +15,35 @@
15 platforms       darwin
16 master_sites    sourceforge:project/nfsen/stable/nfsen-${version}
17 
18-checksums       md5 1c4f057bbb3766090b40bda3ab6b81d2
19+checksums           rmd160  b7a1c205bbde4276b8ab757c6fb1e69d23b28a5b \
20+                    sha256  810e95546338622756deb919d7ee6c39721bc9873bb75dc7ec411ec0b87e1265
21 
22-depends_lib     port:perl5.12 \
23+## rrdtool is 5.16 only, so
24+depends_lib     port:perl5.16 \
25                 port:rrdtool \
26-                port:p5.12-mailtools \
27-                port:p5.12-sys-syslog \
28+                port:p5.16-mailtools \
29+                port:p5.16-sys-syslog \
30+                port:p5.16-socket6 \
31                 port:nfdump
32 
33-patchfiles      patch-install.pl.diff \
34-                patch-etc-nfsen-dist.conf.diff \
35+startupitem.create      yes
36+startupitem.start       "${prefix}/bin/nfsen start"
37+startupitem.stop        "${prefix}/bin/nfsen stop"
38+startupitem.restart     "${prefix}/bin/nfsen reconfig"
39+
40+if {${subport} eq ${name}} {
41+
42+use_configure   no
43+build {}
44+
45+patchfiles      patch-etc-nfsen-dist.conf.diff \
46+                patch-install.pl.diff \
47                 patch-libexec-NfSenRC.pm.diff \
48                 patch-bin-nfsend.diff \
49                 patch-bin-nfsen.diff \
50                 patch-bin-testplugin.diff \
51                 patch-bin-RebuildHierarchy.pl.diff
52 
53-use_configure   no
54-build {}
55-
56-startupitem.create      yes
57-startupitem.executable  ${prefix}/bin/nfsen
58-
59 post-patch {
60 # Read the nfsen.conf comments for details on the use of these variables
61 
62@@ -58,7 +65,7 @@
63                 ${worksrcpath}/install.pl
64         eval reinplace "s|__PREFIX__|${prefix}|g" \
65                 [glob ${worksrcpath}/bin/*]
66-        eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.12|g" \
67+        eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.16|g" \
68                 [glob ${worksrcpath}/installer-items/*.pm]
69 }
70 
71@@ -79,7 +86,7 @@
72 # Set profiles-stat and profiles-data to destroot until install is done
73         reinplace "s|\${VARDIR}/profiles|${destroot}${prefix}/var/nfsen/profiles|g" \
74                 ${worksrcpath}/etc/nfsen-dist.conf
75-        system -W ${worksrcpath} "${prefix}/bin/perl5.12 ./install.pl ./etc/nfsen-dist.conf"
76+        system -W ${worksrcpath} "${prefix}/bin/perl5.16 ./install.pl ./etc/nfsen-dist.conf"
77 
78 # Replace the original .conf file
79         file rename -force ${destroot}${prefix}/etc/nfsen-dist.conf.org \
80@@ -90,10 +97,17 @@
81                 ${destroot}${prefix}/var/nfsen/tmp \
82                 ${destroot}${prefix}/var/nfsen/filters \
83                 ${destroot}${prefix}/var/nfsen/fmt
84+
85+       xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name}/
86+       copy ${filespath}/nginx-${name}.conf ${destroot}${prefix}/share/examples/${name}/nginx-${name}.conf.sample
87 }
88 
89 post-activate {
90 
91+       if ![file exists ${prefix}/etc/nginx/nginx-${name}.conf] {
92+               copy ${prefix}/share/examples/${name}/nginx-${name}.conf.sample ${prefix}/etc/nginx/nginx-${name}.conf
93+       }
94+
95 ui_msg "\n **** To complete the nfsen installation ****
96 
97 To complete the nfsen installation follow the steps below.  Read the documentation
98@@ -116,9 +130,40 @@
99 4) Start nfsen with the startup script after verifying configuration
100         sudo launchctl load -w /Library/LaunchDaemons/org.macports.nfsen.plist
101 
102-5) Check the nfsen web interface at http://localhost/nfsen/nfsen.php
103+5) Configure your webserver
104+       Apache
105+       Nginx: if not existing, a sample configuration has been copied to ${prefix}/etc/nginx
106+
107+6) Check the nfsen web interface at http://localhost/nfsen/nfsen.php
108 
109 \n"
110 }
111 
112+}
113+
114+
115+## Broken for now, was working in 5.12, not recognizing prefix now???
116+subport ${name}-devel {
117+
118+       PortGroup   perl5 1.0
119+
120+       fetch.type  svn
121+       svn.url   svn://svn.code.sf.net/p/nfsen/code/trunk
122+       worksrcdir  trunk
123+       ## using perl Module::Build now, need to decide which perl or multiple variant?
124+       ## +Config::IniHash
125+       depends_build-append    port:p5.16-module-build port:p5.16-file-which
126+
127+       patchfiles
128+       ## FIXME! can't reset the followings: post-patch & destroot?
129+       post-patch {}
130+       configure.cmd     perl5.16
131+       configure.args  Build.PL --install_base=${destroot}${prefix}
132+       build.cmd     Build
133+
134+       destroot.cmd     Build
135+       destroot.target  install
136+
137+}
138+
139 livecheck.regex /${name}-(\[0-9.\]+)${extract.suffix}