source: trunk/dports/net/smokeping/Portfile

Last change on this file was 151856, checked in by mojca@…, 13 months ago

smokeping: switch to perl5.24 (#52081)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 151856 2016-08-23 12:24:32Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           perl5 1.0
6
7name                smokeping
8version             2.6.11
9revision            1
10license             GPL-2+
11categories          net perl
12maintainers         nomaintainer
13description         A deluxe latency logging and graphing system.
14long_description    SmokePing is a deluxe latency measurement tool. \
15                    It can measure, store, and display latency, latency \
16                    distribution, and packet loss. SmokePing uses RRDtool \
17                    to maintain a longterm data-store and to draw pretty \
18                    graphs, giving up to the minute information on the \
19                    state of each network connection.
20
21platforms           darwin
22homepage            http://oss.oetiker.ch/smokeping/
23master_sites        http://oss.oetiker.ch/smokeping/pub/
24
25checksums           rmd160  80722b7b30fa6ce589cc330fe8c657fc85cebc69 \
26                    sha256  f2b3c386e95a74af2b1e7aec6410d0a58852339f00e9963f3c770cfd85ba30dd
27
28patchfiles          patch-etc-config.dist.diff \
29                    patch-bin-smokeping.diff \
30                    patch-bin-tSmoke.diff \
31                    patch-bin-smokeinfo.diff \
32                    patch-bin-smokeping_cgi.diff
33
34perl5.branches      5.24
35
36depends_lib-append  port:perl${perl5.major} \
37                    port:p${perl5.major}-cgi \
38                    port:p${perl5.major}-cgi-fast \
39                    port:p${perl5.major}-fcgi \
40                    port:p${perl5.major}-libwww-perl \
41                    port:p${perl5.major}-socket6 \
42                    port:p${perl5.major}-net-snmp \
43                    port:p${perl5.major}-net-telnet \
44                    port:p${perl5.major}-net-dns \
45                    port:p${perl5.major}-net-openssh \
46                    port:p${perl5.major}-net-radius \
47                    port:p${perl5.major}-perl-ldap \
48                    port:p${perl5.major}-io-socket-ssl \
49                    port:p${perl5.major}-io-tty \
50                    port:p${perl5.major}-pathtools \
51                    port:p${perl5.major}-snmp_session \
52                    port:p${perl5.major}-config-grammar \
53                    port:mod_fastcgi \
54                    port:apache2 \
55                    port:rrdtool \
56                    port:fping \
57                    port:curl
58
59set smokeroot ${prefix}/lib/smokeping
60set smokedata ${prefix}/var/smokeping
61set smokeetc ${prefix}/etc
62set macports_apache_docroot ${prefix}/apache2/htdocs
63
64startupitem.create  yes
65startupitem.name    smokeping
66startupitem.executable \
67                    ${prefix}/bin/smokeping --nodaemon
68
69
70post-patch {
71    reinplace "s|__PREFIX__|${prefix}|g" \
72        ${worksrcpath}/bin/smokeping \
73        ${worksrcpath}/bin/tSmoke \
74        ${worksrcpath}/bin/smokeinfo \
75        ${worksrcpath}/bin/smokeping_cgi \
76        ${worksrcpath}/etc/config.dist
77
78    reinplace "s|__PERL5__ARCHLIB__|${perl5.archlib}|g" \
79        ${worksrcpath}/bin/smokeping \
80        ${worksrcpath}/bin/tSmoke \
81        ${worksrcpath}/bin/smokeinfo \
82        ${worksrcpath}/bin/smokeping_cgi
83
84    reinplace "s|/usr/bin/|${prefix}/bin/|g" \
85        ${worksrcpath}/lib/Smokeping.pm \
86        ${worksrcpath}/lib/Smokeping/Examples.pm \
87        ${worksrcpath}/lib/Smokeping/probes/Curl.pm \
88        ${worksrcpath}/lib/Smokeping/probes/RemoteFPing.pm \
89        ${worksrcpath}/lib/Smokeping/probes/SSH.pm \
90        ${worksrcpath}/lib/Smokeping/probes/FPing6.pm \
91        ${worksrcpath}/lib/Smokeping/probes/EchoPing.pm \
92        ${worksrcpath}/lib/Smokeping/probes/FPing.pm
93
94    reinplace "s|/usr/share/smokeping/etc|${smokeetc}|g" \
95        ${worksrcpath}/lib/Smokeping/probes/passwordchecker.pm
96}
97
98configure.perl      ${perl5.bin}
99# configure.env-append PERL5LIB=${perl5.lib}
100
101# TODO: smokeping violates the layout of the ports-filesystems!
102# configure.args-append --with-htdocs-dir=${prefix}/apache2/htdocs/smokeping
103
104post-destroot {
105
106# Create and retain the data directory
107
108    xinstall -m 755 -d ${destroot}${smokedata}/log
109    destroot.keepdirs ${destroot}${smokedata}/log
110}
111
112notes \
113"  #### To complete the Smokeping installation ####
114
1151) Enable mod_fastcgi (installed as a dependency of Smokeping) for MacPorts Apache 2.
116
117   -Rdd the line below to ${prefix}/apache2/conf/httpd.conf.
118
119        LoadModule fastcgi_module modules/mod_fastcgi.so
120
121
1222)  Changes to httpd.conf for Smokeping.
123
124   -Uncomment this line to enable the CGI script handler.
125
126        AddHandler cgi-script .cgi
127
128   -Add a directive for Smokeping's data directory and add
129    smokeping.cgi to DirectoryIndex for a simple /smokeping url.
130
131        Alias /smokeping \"${prefix}/var/smokeping\"
132        <Directory \"${prefix}/var/smokeping\">
133            Allow from all
134            Options ExecCGI
135        </Directory>
136
137        <IfModule dir_module>
138            DirectoryIndex index.html smokeping.cgi
139        </IfModule>
140
141
1423) Set Smokeping data directory permissions to the Apache user and group set
143   in httpd.conf.  The default Apache user and group for OS X is www.
144
145        sudo chown -R <smokeping-user>:<smokeping-group> ${smokedata}/
146
147
1484) Setup Smokeping logging.
149
150   -Add this statement to /etc/syslog.conf.
151
152   local1.*     ${smokedata}/log/smokeping.log
153
154   -Create a logfile to receive the log messages.
155
156        cd ${smokedata}/log
157        sudo touch smokeping.log
158        sudo chmod 600 smokeping.log
159        sudo chown root:admin smokeping.log
160
161   -Then restart the syslog facility.
162
163        sudo kill -HUP `cat /var/run/syslog.pid`
164
165
1665) Rename and edit the ${smokeetc}/config sample files, then test your config file.
167
168   -Remove the .dist extension from all files; do not change the filenames.
169
170        cd ${smokeetc}
171        sudo mv config.dist config
172
173   -Set the DNS names for the Smokeping config file url's \"imageurl\" and \"cgiurl\".
174    But you should leave all file paths alone -they are set by MacPorts.
175
176        imgurl   = http://myhost.mycompany.com/smokeping
177        cgiurl   = http://myhost.mycompany.com/smokeping/smokeping.cgi
178
179   -Customize variables.
180
181     * General * - owner, contact, and mailhost
182     * Alerts  * - to, from addresses
183
184   -Then clear the examples \(they have a leading '+'\) in the *** Targets ***
185    section and set your own.
186
187        + My Web Server
188           menu = MyWebServer
189           title = My Web Server
190           host = mywebserver.mydomain.com
191           alerts = bigloss,someloss,startloss
192
193    -See sample configurations and examples in ${prefix}/share/doc/smokeping/.
194
195    -Perform a config file test from a terminal window and correct any errors that
196     are reported.
197
198        smokeping --check
199
200
2016) Start Smokeping and verify it is running.  (Give it a minute to start)
202
203        sudo launchctl load -w /Library/LaunchDaemons/org.macports.smokeping.plist
204        ps -ax |grep smoke
205
206 1713  Ss 0:00.16 ${prefix}/bin/smokeping \[FPing\]
207 1753  Ss 0:00.18 ${prefix}/bin/speedy_backend -w ${prefix}/apache2/htdocs/smokeping/smokeping.cgi
208 1754  S  0:01.56 ${prefix}/bin/speedy_backend -w ${prefix}/apache2/htdocs/smokeping/smokeping.cgi
209
210
2117) Check the Smokeping graphs with a web browser.
212
213   Go to http://localhost/smokeping
214
215
2168) Add or remove targets from Smokeping.
217
218   After adding or removing targets from ${smokeetc}/config, you must reload
219   Smokeping from a terminal window.
220
221        sudo smokeping --reload"
Note: See TracBrowser for help on using the repository browser.