[21540] trunk/dports

source_changes at macosforge.org source_changes at macosforge.org
Sat Jan 27 16:48:00 PST 2007


Revision: 21540
          http://trac.macosforge.org/projects/macports/changeset/21540
Author:   markd at macports.org
Date:     2007-01-27 16:48:00 -0800 (Sat, 27 Jan 2007)

Log Message:
-----------
New port.  Smokeping 2.09.

Added Paths:
-----------
    trunk/dports/smokeping/
    trunk/dports/smokeping/Portfile
    trunk/dports/smokeping/files/
    trunk/dports/smokeping/files/patch-bin-smokeping.dist
    trunk/dports/smokeping/files/patch-bin-tSmoke.dist
    trunk/dports/smokeping/files/patch-etc-config.dist
    trunk/dports/smokeping/files/patch-htdocs-smokeping.cgi.dist

Added: trunk/dports/smokeping/Portfile
===================================================================
--- trunk/dports/smokeping/Portfile	                        (rev 0)
+++ trunk/dports/smokeping/Portfile	2007-01-28 00:48:00 UTC (rev 21540)
@@ -0,0 +1,201 @@
+# $Id: Portfile
+
+PortSystem 1.0
+name			smokeping
+version			2.0.9
+categories		net
+maintainers		markd at macports.org
+description		A deluxe latency logging and graphing system.
+long_description	SmokePing is a deluxe latency measurement tool. \
+			It can measure, store, and display latency, latency \
+			distribution, and packet loss. SmokePing uses RRDtool \
+			to maintain a longterm data-store and to draw pretty \
+			graphs, giving up to the minute information on the \
+			state of each network connection.
+
+platforms		darwin
+homepage                http://oss.oetiker.ch/smokeping/
+master_sites		http://oss.oetiker.ch/smokeping/pub/
+checksums		md5 512c0bc38176451df7d664050b1283d9
+
+patchfiles		patch-bin-smokeping.dist \
+			patch-bin-tSmoke.dist \
+			patch-etc-config.dist \
+			patch-htdocs-smokeping.cgi.dist
+
+depends_lib		port:rrdtool \
+			port:p5-cgi-speedycgi \
+			port:p5-cgi.pm \
+			port:p5-net-snmp \
+			port:p5-socket6 \
+			port:p5-net-telnet \
+			port:p5-net-dns \
+			port:p5-perl-ldap \
+			port:p5-io-socket-ssl \
+			port:fping \
+			port:echoping \
+			port:curl
+#			port:p5-net-radius
+
+set smokeroot ${prefix}/lib/smokeping
+set smokedata ${prefix}/var/smokeping
+set smokeetc ${prefix}/etc/smokeping
+set smokedoc ${prefix}/share/doc/smokeping
+
+	startupitem.create	yes
+	startupitem.name	smokeping
+	startupitem.executable	${prefix}/bin/smokeping
+
+use_configure		no
+build {}
+
+post-patch {
+	eval reinplace "s|__PREFIX__|${prefix}|g" \
+		[glob ${worksrcpath}/bin/*.dist] \
+		[glob ${worksrcpath}/etc/*.dist] \
+		[glob ${worksrcpath}/htdocs/*.dist]
+
+	eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl|g" \
+                [glob ${worksrcpath}/bin/*.dist] \
+                [glob ${worksrcpath}/etc/*.dist] \
+                [glob ${worksrcpath}/htdocs/*.dist]
+
+	reinplace "s|/usr/bin/|${prefix}|g" \
+		${worksrcpath}/lib/Smokeping.pm \
+		${worksrcpath}/lib/Smokeping/Examples.pm \
+		${worksrcpath}/lib/Smokeping/probes/Curl.pm \
+		${worksrcpath}/lib/Smokeping/probes/IOSPing.pm \
+		${worksrcpath}/lib/Smokeping/probes/DNS.pm \
+		${worksrcpath}/lib/Smokeping/probes/RemoteFPing.pm \
+		${worksrcpath}/lib/Smokeping/probes/SSH.pm \
+		${worksrcpath}/lib/Smokeping/probes/FPing6.pm \
+		${worksrcpath}/lib/Smokeping/probes/EchoPing.pm \
+		${worksrcpath}/lib/Smokeping/probes/FPing.pm
+
+	reinplace "s|/usr/share/smokeping/etc/|${prefix}/etc/smokeping|g" \
+		${worksrcpath}/lib/Smokeping/probes/passwordchecker.pm
+}
+
+destroot {
+# bin
+	xinstall -m 755 -d ${destroot}${prefix}/bin
+	xinstall -m 755 ${worksrcpath}/bin/smokeping.dist ${destroot}${prefix}/bin/smokeping
+	xinstall -m 755 ${worksrcpath}/bin/tSmoke.dist ${destroot}${prefix}/bin/tSmoke
+
+# doc
+	xinstall -m 755 -d ${destroot}${smokedoc}
+	system "cp -R ${worksrcpath}/doc/ ${destroot}${smokedoc}"
+	file copy ${worksrcpath}/README ${destroot}${smokedoc}
+	file copy ${worksrcpath}/TODO ${destroot}${smokedoc}
+
+# etc
+	xinstall -m 755 -d ${destroot}${smokeetc}
+	file copy ${worksrcpath}/etc/basepage.html.dist ${destroot}${smokeetc}/basepage.html
+	file copy ${worksrcpath}/etc/config.dist ${destroot}${smokeetc}/config
+	file copy ${worksrcpath}/etc/smokemail.dist ${destroot}${smokeetc}/smokemail
+	file copy ${worksrcpath}/etc/tmail.dist ${destroot}${smokeetc}/tmail
+
+# lib
+	system "cp -R ${worksrcpath}/lib/ ${destroot}${smokeroot}"
+
+# Smokeping data directory that needs to be symlinked to Apache docroot
+	xinstall -m 755 -d ${destroot}${smokedata}/img
+
+# Smokeping log directory
+	xinstall -m 755 -d ${destroot}${smokedata}/log
+
+# htdocs (smokeping.cgi)
+        xinstall -m 755 ${worksrcpath}/htdocs/smokeping.cgi.dist \
+                ${destroot}${smokedata}/smokeping.cgi
+
+# Retain these empty directories
+	destroot.keepdirs ${destroot}${smokedata}/img \
+		destroot.keepdirs ${destroot}${smokedata}/log
+}
+
+post-activate {
+ui_msg "\n  #### To complete the Smokeping installation ####
+
+1) Enable SpeedyCGI (installed as a dependency of Smokeping) for Apache.
+
+   -For MacPorts Apache 2, add the line below to ${prefix}/apache2/conf/httpd.conf.
+
+	LoadModule speedycgi_module modules/mod_speedycgi.so
+
+   -For Apple's Apache 1, manually copy mod_speedycgi.so and smokeping.cgi into place ...
+
+	sudo cp ${prefix}/share/doc/speedycgi/mod_speedycgi.so /usr/libexec/httpd
+	sudo cp ${prefix}${smokedata}/smokeping.cgi /<apache-docroot>/cgi-bin
+
+   ... and add the lines below to /etc/httpd/httpd.conf
+
+	LoadModule speedycgi_module libexec/mod_speedycgi.so
+        AddModule mod_speedycgi.c
+
+
+2) Now set Apache for Smokeping by making a symlink and then adding a directive to httpd.conf.
+
+	sudo ln -s ${prefix}/var/smokeping  /<apache-docroot>/smokeping
+
+   <Directory ${prefix}/apache2/htdocs/smokeping> 
+       Options ExecCGI
+   </Directory>
+
+
+3) Set Smokeping permissions.
+
+	sudo chown -R www:www ${prefix}/var/smokeping/
+
+
+4) Edit ${prefix}/etc/smokeping/config.
+
+   -Paths are set by MacPorts, leave them alone.
+
+   -Customize variables
+     * General * - owner, contact, and mailhost
+     * Alerts  * - to, from addresses
+
+   -Then clear the examples \(they have a leading '+'\) in the *** Targets *** section
+    and set your own.
+
+	+ My Web Server
+	   menu = MyWebServer
+	   title = My Web Server
+	   host = mywebserver.mydomain.com
+	   alerts = bigloss,someloss,startloss
+
+    -See sample configurations and  examples in ${prefix}/share/doc/smokeping/
+
+
+5) Setup Smokeping logging.
+
+   -Add this statement to /etc/syslog.conf.
+
+   local1.*	${prefix}/var/smokeping/smokeping.log
+
+   -Create a logfile to receive the log messages.
+
+	sudo touch ${smokedata}/log/smokeping.log
+	sudo chmod 600 ${smokedata}/log/smokeping.log
+	sudo chown root:admin ${smokedata}/log/smokeping.log
+
+   -Then restart the syslog facility.
+
+	sudo kill -HUP `cat /var/run/syslog.pid`
+
+
+5) Start Smokeping and verify it is running.  (Give it a minute to start)
+
+	sudo launchctl load -w /Library/LaunchDaemons/org.macports.smokeping.plist
+	ps -ax |grep smoke
+
+ 1713  ??  Ss     0:00.16 ${prefix}/bin/smokeping \[FPing\]
+ 1753  ??  Ss     0:00.18 ${prefix}/bin/speedy_backend -w ${prefix}/apache2/htdocs/smokeping/smokeping.cgi
+ 1754  ??  S      0:01.56 ${prefix}/bin/speedy_backend -w ${prefix}/apache2/htdocs/smokeping/smokeping.cgi
+
+
+6) Check the Smokeping graphs with a web browser.
+
+   Go to http://localhost/smokeping/smokeping.cgi
+\n"
+}


Property changes on: trunk/dports/smokeping/Portfile
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Added: trunk/dports/smokeping/files/patch-bin-smokeping.dist
===================================================================
--- trunk/dports/smokeping/files/patch-bin-smokeping.dist	                        (rev 0)
+++ trunk/dports/smokeping/files/patch-bin-smokeping.dist	2007-01-28 00:48:00 UTC (rev 21540)
@@ -0,0 +1,43 @@
+--- bin/smokeping.dist.org.dist	2006-07-14 04:17:59.000000000 -0700
++++ bin/smokeping.dist	2007-01-27 12:31:41.000000000 -0800
+@@ -1,12 +1,12 @@
+-#!/usr/sepp/bin/perl-5.8.4 -w
++#!__PREFIX__/bin/perl -w
+ # -*-perl-*-
+ 
+-use lib qw(/usr/pack/rrdtool-1.0.49-to/lib/perl);
+-use lib qw(lib);
++use lib qw(__PREFIX__/lib/perl5/site_perl/5.8.8/darwin-2level/auto/RRDs);
++use lib qw(__PREFIX__/lib/smokeping);
+ 
+ use Smokeping 2.000009;
+  
+-Smokeping::main("etc/config.dist");
++Smokeping::main("__PREFIX__/etc/smokeping/config");
+ 
+ =head1 NAME
+ 
+@@ -112,22 +112,7 @@
+ 
+ =head1 SETUP
+ 
+-When installing SmokePing, this file has to be adjusted to fit your
+-local system. Three paths have to be entered.
+-
+-One pointing to your B<rrdtool> installation
+-
+- use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
+-
+-One pointing to the place where you have installed the SmokePing libraries
+-
+- use lib qw(/home/oetiker/public_html/smokeping/lib);
+-
+-The third path is the argument to the Smokeping::main command. It points to
+-the SmokePing configuration file.
+-
+- use Smokeping;
+- Smokeping::main("/home/oetiker/.smokeping/config");
++Paths for this file are set by MacPorts for the local system so they do not need to be modified.
+ 
+ =head1 COPYRIGHT
+ 

Added: trunk/dports/smokeping/files/patch-bin-tSmoke.dist
===================================================================
--- trunk/dports/smokeping/files/patch-bin-tSmoke.dist	                        (rev 0)
+++ trunk/dports/smokeping/files/patch-bin-tSmoke.dist	2007-01-28 00:48:00 UTC (rev 21540)
@@ -0,0 +1,65 @@
+--- bin/tSmoke.dist.org.dist	2006-07-14 04:17:59.000000000 -0700
++++ bin/tSmoke.dist	2007-01-26 23:29:51.000000000 -0800
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!__PREFIX__/bin/perl
+ #
+ #-----------------------------------------------
+ # tSmoke.pl
+@@ -50,8 +50,8 @@
+ # -- Getopt::Long
+ #
+ # Point the lib variables to your implementation
+-use lib qw(lib);
+-use lib "/usr/local/rrdtool-1.0.39/lib/perl";
++use lib qw(__PREFIX__/lib/smokeping/lib);
++use lib "__PREFIX__/lib/perl5/site_perl/5.8.8/darwin-2level/auto/RRDs";
+ 
+ use Smokeping 2.000009;
+ use Net::SMTP;
+@@ -60,7 +60,7 @@
+ use RRDs;
+ 
+ # Point to your Smokeping config file
+-my $cfgfile = "etc/config.dist";
++my $cfgfile = "__PREFIX__/etc/smokeping/config";
+ 
+ # global variables
+ my $cfg;
+@@ -466,35 +466,7 @@
+  # Weekly report on the percent availability of network systems with no detail
+  0 8 * * * /usr/local/smokeping/bin/tSmoke.pl --q --to=mailbox at company.com.invalid --weekly --detail=0
+ 
+-=head1 SETUP
+-
+-When installing tSmoke, some variables must be adjusted to fit your local system.
+-
+-We need to use the following B<libraries>:
+-
+-=over
+-
+-=item Smokeping
+-
+-=item RRDTool Perl bindings
+-
+-=item Getopt::Long
+-
+-=back
+-
+-Set up your libraries:
+-
+- use lib "/usr/local/smokeping/lib";
+- use lib "/usr/local/rrdtool-1.0.39/lib/perl";
+-
+-Point to your Smokeping B<config> file
+-
+- my $cfgfile = "/usr/local/smokeping/etc/config";
+-
+-Modify the Smokeping config file to include a path for tmail in the
+-General section:
+-
+- tmail = /usr/local/smokeping/etc/tmail
++Paths for this file are set by MacPorts for the local system so they do not need to be modified.
+ 
+ =head1 COPYRIGHT
+ 

Added: trunk/dports/smokeping/files/patch-etc-config.dist
===================================================================
--- trunk/dports/smokeping/files/patch-etc-config.dist	                        (rev 0)
+++ trunk/dports/smokeping/files/patch-etc-config.dist	2007-01-28 00:48:00 UTC (rev 21540)
@@ -0,0 +1,46 @@
+--- etc/config.dist.org.dist	2006-03-24 08:51:02.000000000 -0800
++++ etc/config.dist	2007-01-26 23:21:44.000000000 -0800
+@@ -7,16 +7,16 @@
+ owner    = Joe Random
+ contact  = joe at some.place.xyz
+ mailhost = smtp.mailhost.abc
+-sendmail = /usr/lib/sendmail
+-imgcache = /home/oetiker/public_html/.simg
+-imgurl   = ../.simg
+-datadir  = /home/oetiker/data/projects/AADJ-smokeping/dist/var
+-piddir  = /home/oetiker/data/projects/AADJ-smokeping/dist/var
+-cgiurl   = http://people.ee.ethz.ch/~oetiker/smokeping/smokeping.cgi
+-smokemail = /home/oetiker/data/projects/AADJ-smokeping/dist/etc/smokemail.dist
+-tmail = /home/oetiker/data/projects/AADJ-smokeping/dist/etc/tmail.dist
++sendmail = /usr/sbin/sendmail
++imgcache = __PREFIX__/apache2/htdocs/smokeping/img
++imgurl   = http://localhost/smokeping/img
++datadir  = __PREFIX__/var/smokeping
++piddir  = /var/run
++cgiurl   = http://localhost/smokeping/smokeping.cgi
++smokemail = __PREFIX__/etc/smokeping/smokemail
++tmail = __PREFIX__/etc/smokeping/tmail
+ # specify this to get syslog logging
+-syslogfacility = local0
++syslogfacility = local1
+ # each probe is now run in its own process
+ # disable this to revert to the old behaviour
+ # concurrentprobes = no
+@@ -66,7 +66,7 @@
+ 
+ *** Presentation ***
+ 
+-template = /home/oetiker/data/projects/AADJ-smokeping/dist/etc/basepage.html.dist
++template = __PREFIX__/etc/smokeping/basepage.html
+ 
+ + overview 
+ 
+@@ -89,7 +89,7 @@
+ 
+ + FPing
+ 
+-binary = /usr/sepp/bin/fping
++binary = __PREFIX__/sbin/fping
+ 
+ *** Targets ***
+ 

Added: trunk/dports/smokeping/files/patch-htdocs-smokeping.cgi.dist
===================================================================
--- trunk/dports/smokeping/files/patch-htdocs-smokeping.cgi.dist	                        (rev 0)
+++ trunk/dports/smokeping/files/patch-htdocs-smokeping.cgi.dist	2007-01-28 00:48:00 UTC (rev 21540)
@@ -0,0 +1,45 @@
+--- htdocs/smokeping.cgi.dist.org.dist	2006-07-14 04:17:59.000000000 -0700
++++ htdocs/smokeping.cgi.dist	2007-01-27 12:25:23.000000000 -0800
+@@ -1,13 +1,13 @@
+-#!/usr/sepp/bin/speedy -w
++#!__PREFIX__/bin/speedy -w
+ # -*-perl-*-
+ 
+-use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
+-use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);
++use lib qw(__PREFIX__/lib/perl5/site_perl/5.8.8/darwin-2level/auto/RRDs);
++use lib qw(__PREFIX__/lib/smokeping);
+ use CGI::Carp qw(fatalsToBrowser);
+ 
+ use Smokeping 2.000009;
+ 
+-Smokeping::cgi("/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config");
++Smokeping::cgi("__PREFIX__/etc/smokeping/config");
+ 
+ =head1 NAME
+ 
+@@ -34,23 +34,7 @@
+ 
+ =head1 SETUP
+ 
+-When installing SmokePing, this file has to be adjusted to fit your
+-local system. Three paths have to be entered.
+-
+- use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
+-
+-One pointing to your B<rrdtool> installation
+-
+- use lib qw(/home/oetiker/public_html/smokeping/lib);
+-
+-One pointing to the place where you have installed the SmokePing libraries
+-
+- use Smokeping;
+-
+- Smokeping::cgi("/home/oetiker/.smokeping/config");
+-
+-The third path is the argument to the Smokeping::cgi command. It points to
+-the SmokePing configuration file.
++Paths for this file are set by MacPorts for the local system so they do not need to be modified.
+ 
+ =head1 COPYRIGHT
+ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070127/755d9158/attachment.html


More information about the macports-changes mailing list