source: trunk/dports/net/smokeping/Portfile @ 129440

Last change on this file since 129440 was 129440, checked in by devans@…, 5 years ago

smokeping: fix build by explicitly configuring perl version, add license.

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