summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2009-02-10 15:51:43 +0000
committerPeter Volkov <pva@gentoo.org>2009-02-10 15:51:43 +0000
commit29ab2bab5630f94dd2a77e473e39ef1a7e918c4e (patch)
tree03ea275a0f187b01ca5628993d43f5a8e09709f6 /net-analyzer/smokeping
parentOpps, not netmon but me should maintain this package. (diff)
downloadgentoo-2-29ab2bab5630f94dd2a77e473e39ef1a7e918c4e.tar.gz
gentoo-2-29ab2bab5630f94dd2a77e473e39ef1a7e918c4e.tar.bz2
gentoo-2-29ab2bab5630f94dd2a77e473e39ef1a7e918c4e.zip
Version bump, bug #229275, Raúl Porcel for report. Quite rewrote ebuild: install manpages, smoketrace, separate files for cgi and htdocs, new USE flag speedy.
(Portage version: 2.1.6.7/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer/smokeping')
-rw-r--r--net-analyzer/smokeping/ChangeLog12
-rw-r--r--net-analyzer/smokeping/files/79_smokeping.conf15
-rw-r--r--net-analyzer/smokeping/files/smokeping.init.167
-rw-r--r--net-analyzer/smokeping/metadata.xml8
-rw-r--r--net-analyzer/smokeping/smokeping-2.4.2.ebuild157
5 files changed, 257 insertions, 2 deletions
diff --git a/net-analyzer/smokeping/ChangeLog b/net-analyzer/smokeping/ChangeLog
index 391a793b07ce..811641839e06 100644
--- a/net-analyzer/smokeping/ChangeLog
+++ b/net-analyzer/smokeping/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-analyzer/smokeping
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.23 2008/08/19 14:13:13 falco Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.24 2009/02/10 15:51:42 pva Exp $
+
+*smokeping-2.4.2 (10 Feb 2009)
+
+ 10 Feb 2009; Peter Volkov <pva@gentoo.org> +files/79_smokeping.conf,
+ +files/smokeping.init.1, metadata.xml, +smokeping-2.4.2.ebuild:
+ Version bump, bug #229275, Raúl Porcel for report. Quite rewrote ebuild:
+ install manpages, smoketrace, separate files for cgi and htdocs, new USE
+ flag speedy.
19 Aug 2008; Raphael Marichez <falco@gentoo.org> smokeping-2.3.5.ebuild:
Fix Config/Grammar Perl dependencies bug 221831
diff --git a/net-analyzer/smokeping/files/79_smokeping.conf b/net-analyzer/smokeping/files/79_smokeping.conf
new file mode 100644
index 000000000000..1e9361ba501a
--- /dev/null
+++ b/net-analyzer/smokeping/files/79_smokeping.conf
@@ -0,0 +1,15 @@
+###
+### Setup the smokeping image cache and perl cgi script
+###
+<IfModule mod_alias.c>
+ Alias "/.simg/" "/var/lib/smokeping/.simg/"
+ <IfModule mod_perl.c>
+ <Directory "/var/lib/smokeping/.simg/">
+ Options -Indexes MultiViews
+ AllowOverride None
+ Order deny,allow
+ Deny from all
+ Allow from 127.0.0.1
+ </Directory>
+ </IfModule>
+</IfModule>
diff --git a/net-analyzer/smokeping/files/smokeping.init.1 b/net-analyzer/smokeping/files/smokeping.init.1
new file mode 100644
index 000000000000..118348fb0605
--- /dev/null
+++ b/net-analyzer/smokeping/files/smokeping.init.1
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+opts="${opts} dump restore"
+
+depend() {
+ need net
+ use dns
+}
+
+checkconfig() {
+ if [ ! -f "/etc/smokeping/config" ] ; then
+ eerror "You need /etc/smokeping to run smokeping!"
+ return 1
+ fi
+ einfo "Please do not forget to configure smokeping at /etc/smokeping/config!"
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting smokeping"
+ LC_ALL=C \
+ start-stop-daemon --start --name smokeping \
+ --pidfile /var/run/smokeping/smokeping.pid \
+ --exec /usr/bin/smokeping \
+ --chuid smokeping:smokeping
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping smokeping"
+ start-stop-daemon --stop \
+ --pidfile /var/run/smokeping/smokeping.pid
+ eend $?
+}
+
+dump() {
+ ebegin "Dumping smokeping rrd files to XML for backup or upgrade use"
+ if service_started "${myservice}" ; then
+ eerror "You need to stop smokeping before dumping files!"
+ return 1
+ fi
+ for f in `find /var/lib/smokeping -name '*.rrd' -print` ; do
+ f_xml=`dirname $f`/`basename $f .rrd`.xml
+ rrdtool dump "$f" > "${f_xml}"
+ chown root:0 "${f_xml}"
+ done
+ eend $?
+}
+
+restore() {
+ ebegin "Restoring smokeping rrd files from XML dump files"
+ if service_started "${myservice}" ; then
+ eerror "You need to stop smokeping before restoring files!"
+ return 1
+ fi
+ for f in `find /var/lib/smokeping -name '*.xml' -print` ; do
+ f_rrd=`dirname $f`/`basename $f .xml`.rrd
+ mv -f "${f_rrd}" "${f_rrd}.bak"
+ chown root:0 "${f_rrd}.bak"
+ rrdtool restore "$f" "${f_rrd}"
+ chown smokeping:smokeping "${f_rrd}"
+ done
+ eend $?
+}
diff --git a/net-analyzer/smokeping/metadata.xml b/net-analyzer/smokeping/metadata.xml
index a55343406081..df8a3d5d07e6 100644
--- a/net-analyzer/smokeping/metadata.xml
+++ b/net-analyzer/smokeping/metadata.xml
@@ -3,7 +3,15 @@
<pkgmetadata>
<herd>no-herd</herd>
<maintainer>
+ <email>pva@gentoo.org</email>
+ <name>Peter Volkov</name>
+</maintainer>
+<maintainer>
<email>chtekk@gentoo.org</email>
<name>Luca Longinotti</name>
</maintainer>
+<use>
+ <flag name='speedy'>Use <pkg>dev-perl/SpeedyCGI</pkg> instead of perl to
+ speed up cgi scripts</flag>
+</use>
</pkgmetadata>
diff --git a/net-analyzer/smokeping/smokeping-2.4.2.ebuild b/net-analyzer/smokeping/smokeping-2.4.2.ebuild
new file mode 100644
index 000000000000..5ef2cca74744
--- /dev/null
+++ b/net-analyzer/smokeping/smokeping-2.4.2.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.4.2.ebuild,v 1.1 2009/02/10 15:51:42 pva Exp $
+
+EAPI="2"
+
+inherit perl-module eutils
+
+DESCRIPTION="A powerful latency measurement tool."
+HOMEPAGE="http://oss.oetiker.ch/smokeping/"
+SRC_URI="http://oss.oetiker.ch/smokeping/pub/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="apache2 speedy"
+
+DEPEND="dev-lang/perl
+ virtual/perl-libnet
+ >=net-analyzer/rrdtool-1.2[perl]
+ >=net-analyzer/fping-2.4_beta2-r2
+ dev-perl/Digest-HMAC
+ dev-perl/libwww-perl
+ dev-perl/Socket6
+ dev-perl/Net-DNS
+ speedy? ( dev-perl/SpeedyCGI )
+ !apache2? ( virtual/httpd-cgi )
+ apache2? ( >=www-apache/mod_perl-2.0.1 )"
+
+RDEPEND="${DEPEND}"
+
+pkg_preinst() {
+ enewgroup smokeping
+ enewuser smokeping -1 -1 /var/lib/smokeping smokeping
+}
+
+src_unpack() {
+ # perl-mod.eclass does not support EAPI=2.
+ unpack ${A}
+}
+
+src_prepare() {
+ # we depend on dev-perl/Digest-HMAC. No need for bundled version.
+ rm -rf lib/Digest
+ rm qooxdoo/qooxdoolink
+}
+
+src_compile() {
+ # There is a makefile we don't want to run so leave this here
+ einfo "Skip compile."
+}
+
+src_install() {
+ # First move all the perl modules into the vendor lib area of Perl
+ perlinfo
+ insinto ${VENDOR_LIB}/
+ doins -r lib/*
+
+ # Install the CGI webserver scripts
+ sed 's:^use lib:#use lib:g' -i htdocs/*.cgi.dist
+ if use speedy; then
+ sed '1{s:/usr/[^ ]*:/usr/bin/speedy:}' -i htdocs/*.cgi.dist
+ else
+ sed '1{s:/usr/[^ ]*:/usr/bin/perl:}' -i htdocs/*.cgi.dist
+ fi
+ sed 's:/home/oetiker.*/config.dist:/etc/smokeping/config:' \
+ -i htdocs/*.cgi.dist
+ exeinto /var/www/localhost/perl/
+ newexe htdocs/smokeping.cgi.dist smokeping.pl || die
+ exeinto /var/www/localhost/smokeping
+ newexe htdocs/tr.cgi.dist tr.cgi || die
+ rm htdocs/{tr,smokeping}.cgi.dist
+
+ # Install AJAX scripts
+ insinto /var/www/localhost/smokeping
+ doins -r htdocs/* || die
+
+ # Create the smokeping binaries
+ for bin in ${PN} tSmoke; do
+ newbin bin/${bin}.dist ${bin}
+ dosed 's:^use lib:#use lib:g' /usr/bin/${bin}
+ dosed 's:etc/config.dist:/etc/smokeping/config:' /usr/bin/${bin}
+ done
+
+ # Create the config files
+ insinto /etc/${PN}
+ for file in etc/*; do
+ config=${file/.dist}
+ newins ${file} ${config#*/}
+ done
+ sed -e '/^imgcache/{s:\(^imgcache[ \t]*=\).*:\1 /var/lib/smokeping/.simg:}' \
+ -e '/^imgurl/{s:\(^imgurl[ \t]*=\).*:\1 ../.simg:}' \
+ -e '/^datadir/{s:\(^datadir[ \t]*=\).*:\1 /var/lib/smokeping:}' \
+ -e '/^piddir/{s:\(^piddir[ \t]*=\).*:\1 /var/run/smokeping:}' \
+ -e '/^cgiurl/{s#\(^cgiurl[ \t]*=\).*#\1 http://some.place.xyz/perl/smokeping.pl#}' \
+ -e '/^smokemail/{s:\(^smokemail[ \t]*=\).*:\1 /etc/smokeping/smokemail:}' \
+ -e '/^tmail/{s:\(^tmail[ \t]*=\).*:\1 /etc/smokeping/tmail:}' \
+ -e '/^secrets/{s:\(^secrets[ \t]*=\).*:\1 /etc/smokeping/smokeping_secrets:}' \
+ -e '/^template/{s:\(^template[ \t]*=\).*:\1 /etc/smokeping/basepage.html:}' \
+ -i "${D}/etc/${PN}/config" || die
+ sed -e '/^<script/{s:cropper/:/cropper/:}' -i "${D}/etc/${PN}/basepage.html"
+ fperms 700 /etc/${PN}/smokeping_secrets
+
+ newinitd "${FILESDIR}/${PN}.init.1" ${PN} || die
+
+ if use apache2 ; then
+ insinto /etc/apache2/modules.d
+ doins "${FILESDIR}/79_${PN}.conf" || die
+ fi
+
+ # Create the files in /var for rrd file storage
+ keepdir /var/lib/${PN}/.simg
+ fowners smokeping:smokeping /var/lib/${PN}
+ if use apache2 ; then
+ fowners apache:apache /var/lib/${PN}/.simg
+ else
+ fowners smokeping:smokeping /var/lib/${PN}/.simg
+ fi
+ fperms 775 /var/lib/${PN} /var/lib/${PN}/.simg
+ keepdir /var/run/${PN} # for pid files
+ fowners smokeping:smokeping /var/run/${PN}
+
+ # Install documentation.
+ insinto "/usr/share/doc/${PF}"
+ doins -r doc/examples
+ dodoc CHANGES CONTRIBUTORS README TODO || die
+ doman doc/{smokeping{.1,.cgi.1,_config.5},Smokeping.3,smokeping_examples.7} \
+ doc/{smokeping_{extend,install,master_slave,upgrade}.7,smoketrace.7} \
+ doc/{tSmoke.1,Smokeping/Smokeping::{Examples,RRDtools}.3} || die
+}
+
+pkg_postinst() {
+ chown smokeping:smokeping "${ROOT}/var/lib/${PN}"
+ chmod 755 "${ROOT}/var/lib/${PN}"
+ elog
+ elog "Additional steps are needed to get ${PN} up & running:"
+ elog
+ elog "First you need to edit /etc/${PN}/config. After that"
+ elog "you can start ${PN} with '/etc/init.d/${PN} start'."
+ elog
+ if use apache2 ; then
+ elog "For web interface make sure to add -D PERL to APACHE2_OPTS in"
+ elog "/etc/conf.d/apache2 and to restart apache2. To access site from"
+ elog "other places check permissions at /etc/apache2/modules.d/79_${PN}.conf"
+ elog
+ else
+ elog "For web interface configure your web server to serve perl cgi"
+ elog "script at /var/www/localhost/perl/"
+ fi
+ elog "To make cropper working you just need to copy /var/www/localhost/smokeping/cropper"
+ elog "into you htdocs (or create symlink and allow webserver to follow symlinks)."
+ elog
+ elog "We install all files required for smoketrace, but you have to"
+ elog "configure it manually. Just read 'man smoketrace'. Also you need to"
+ elog "'emerge traceroute'."
+ elog
+}