summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2011-04-01 15:57:16 +0000
committerPeter Volkov <pva@gentoo.org>2011-04-01 15:57:16 +0000
commit565d3bc544a675a712a3d4d616e2973ebd0115e3 (patch)
treeeda3fbe5cead5c9be1a855a1966b20102c9cd500 /net-analyzer
parentSmokeping #358389 fixed, unmask dev-perl/Config-Grammar. (diff)
downloadgentoo-2-565d3bc544a675a712a3d4d616e2973ebd0115e3.tar.gz
gentoo-2-565d3bc544a675a712a3d4d616e2973ebd0115e3.tar.bz2
gentoo-2-565d3bc544a675a712a3d4d616e2973ebd0115e3.zip
Finally fix blockers with JSON and use in-tree Config-Grammar, bug #358389, thank Torsten Veller for this job. Drop old.
(Portage version: 2.1.9.45/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/smokeping/ChangeLog11
-rw-r--r--net-analyzer/smokeping/files/78_smokeping.conf17
-rw-r--r--net-analyzer/smokeping/files/smokeping.init70
-rw-r--r--net-analyzer/smokeping/files/smokeping.init.173
-rw-r--r--net-analyzer/smokeping/smokeping-2.2.4.ebuild112
-rw-r--r--net-analyzer/smokeping/smokeping-2.3.5.ebuild115
-rw-r--r--net-analyzer/smokeping/smokeping-2.4.2-r3.ebuild3
-rw-r--r--net-analyzer/smokeping/smokeping-2.4.2-r4.ebuild167
8 files changed, 179 insertions, 389 deletions
diff --git a/net-analyzer/smokeping/ChangeLog b/net-analyzer/smokeping/ChangeLog
index c83d9decc9b9..9e358cd21456 100644
--- a/net-analyzer/smokeping/ChangeLog
+++ b/net-analyzer/smokeping/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-analyzer/smokeping
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.35 2011/03/13 20:38:53 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/ChangeLog,v 1.36 2011/04/01 15:57:16 pva Exp $
+
+*smokeping-2.4.2-r4 (01 Apr 2011)
+
+ 01 Apr 2011; Peter Volkov <pva@gentoo.org> -files/78_smokeping.conf,
+ -smokeping-2.2.4.ebuild, -smokeping-2.3.5.ebuild,
+ smokeping-2.4.2-r3.ebuild, +smokeping-2.4.2-r4.ebuild,
+ -files/smokeping.init, -files/smokeping.init.1:
+ Finally fix blockers with JSON and use in-tree Config-Grammar, bug
+ #358389, thank Torsten Veller for this job. Drop old.
13 Mar 2011; Peter Volkov <pva@gentoo.org> -smokeping-2.4.2-r1.ebuild,
-smokeping-2.4.2-r2.ebuild, smokeping-2.4.2-r3.ebuild:
diff --git a/net-analyzer/smokeping/files/78_smokeping.conf b/net-analyzer/smokeping/files/78_smokeping.conf
deleted file mode 100644
index e710ae822342..000000000000
--- a/net-analyzer/smokeping/files/78_smokeping.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-###
-### Setup the smokeping image cache
-###
-<IfModule mod_alias.c>
- Alias "/.simg/" "/var/lib/smokeping/.simg/"
- <IfModule mod_perl.c>
- <Directory "/var/lib/smokeping/.simg/">
- Options -Indexes MultiViews
- AllowOverride None
- <IfModule mod_access.c>
- Order deny,allow
- Deny from all
- Allow from 127.0.0.1
- </IfModule>
- </Directory>
- </IfModule>
-</IfModule>
diff --git a/net-analyzer/smokeping/files/smokeping.init b/net-analyzer/smokeping/files/smokeping.init
deleted file mode 100644
index 6ccb34a8c3f5..000000000000
--- a/net-analyzer/smokeping/files/smokeping.init
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/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 [[ ! -e "/usr/bin/smokeping" ]] ; then
- eerror "You need /usr/bin/smokeping to run smokeping!"
- return 1
- fi
- if [[ ! -e "/etc/smokeping" ]] ; then
- eerror "You need /etc/smokeping to run smokeping!"
- return 1
- fi
- einfo "Please remember to setup smokeping at /etc/smokeping!"
-}
-
-start() {
- checkconfig || return 1
-
- ebegin "Starting smokeping"
- LC_ALL=C \
- start-stop-daemon --start --name smokeping \
- --exec /usr/bin/smokeping \
- --chuid smokeping:smokeping
- eend $?
-}
-
-stop() {
- ebegin "Stopping smokeping"
- start-stop-daemon --stop \
- --pidfile /var/lib/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/files/smokeping.init.1 b/net-analyzer/smokeping/files/smokeping.init.1
deleted file mode 100644
index 0222964c6ee9..000000000000
--- a/net-analyzer/smokeping/files/smokeping.init.1
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-opts="${opts} dump reload 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 $?
-}
-
-reload() {
- ebegin "Reloading smokeping"
- /usr/bin/smokeping --reload 1>/dev/null 2>&1
- 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/smokeping-2.2.4.ebuild b/net-analyzer/smokeping/smokeping-2.2.4.ebuild
deleted file mode 100644
index 7f16697ab4a9..000000000000
--- a/net-analyzer/smokeping/smokeping-2.2.4.ebuild
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.2.4.ebuild,v 1.4 2008/04/21 09:40:47 chtekk Exp $
-
-inherit perl-module eutils
-
-KEYWORDS="amd64 sparc x86"
-
-DESCRIPTION="A powerful latency measurement tool."
-SRC_URI="http://oss.oetiker.ch/smokeping/pub/${P}.tar.gz"
-HOMEPAGE="http://oss.oetiker.ch/smokeping/"
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="apache2"
-
-DEPEND="dev-lang/perl
- virtual/perl-libnet
- >=net-analyzer/rrdtool-1.2
- net-analyzer/fping
- dev-perl/libwww-perl
- dev-perl/Net-DNS
- apache2? ( >=www-apache/mod_perl-2.0.1 )"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- if ! built_with_use '>=net-analyzer/rrdtool-1.2' perl ; then
- eerror "You must build net-analyzer/rrdtool with the"
- eerror "'perl' USE flag turned on!"
- die "net-analyzer/rrdtool installed with 'perl' USE flag disabled"
- fi
-
- enewgroup smokeping
- enewuser smokeping -1 -1 /var/lib/smokeping smokeping
-}
-
-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 lib/*.pm
- insinto ${VENDOR_LIB}/Config
- doins lib/Config/*.pm
- insinto ${VENDOR_LIB}/Smokeping
- doins lib/Smokeping/*.pm
- insinto ${VENDOR_LIB}/Smokeping/matchers
- doins lib/Smokeping/matchers/*.pm
- insinto ${VENDOR_LIB}/Smokeping/probes
- doins lib/Smokeping/probes/*.pm
- insinto ${VENDOR_LIB}/Smokeping/sorters
- doins lib/Smokeping/sorters/*.pm
-
- # 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
-
- # Install the CGI webserver script
- exeinto /var/www/localhost/perl
- newexe htdocs/${PN}.cgi.dist ${PN}.pl
- dosed 's:^use lib:#use lib:g' /var/www/localhost/perl/${PN}.pl
- dosed 's:/usr/sepp/bin/speedy:/usr/bin/perl:' /var/www/localhost/perl/${PN}.pl
- dosed 's:/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config:/etc/smokeping:' \
- /var/www/localhost/perl/${PN}.pl
-
- # Install AJAX scripts
- insinto /var/www/localhost/perl
- doins -r htdocs/cropper
-
- # Create the binary
- newbin bin/${PN}.dist ${PN}
- dosed 's:^use lib:#use lib:g' /usr/bin/${PN}
- dosed 's:/usr/sepp/bin/perl-5.8.4:/usr/bin/perl:' /usr/bin/${PN}
- dosed 's:etc/config.dist:/etc/smokeping:' /usr/bin/${PN}
-
- # Create the config files
- insinto /etc
- newins "${FILESDIR}/config.dist" ${PN}
- newins etc/basepage.html.dist ${PN}.template
- doins etc/smokemail.dist
- newinitd "${FILESDIR}/${PN}.init" ${PN}
- if use apache2 ; then
- insinto /etc/apache2/modules.d
- doins "${FILESDIR}/78_${PN}.conf"
- fi
-}
-
-pkg_postinst() {
- chown smokeping:smokeping "${ROOT}/var/lib/${PN}"
- chmod 755 "${ROOT}/var/lib/${PN}"
- elog
- elog "Four more steps are needed to get ${PN} up&running:"
- elog "1) You need to edit /etc/${PN}"
- elog "2) You need to edit the template at /etc/${PN}.template"
- elog "3) You need to make the fping binary setuid root:"
- elog " # chmod 4755 /usr/sbin/fping"
- if use apache2 ; then
- elog "4) Make sure to add -D PERL to APACHE2_OPTS in /etc/conf.d/apache2"
- elog " and to restart apache2."
- fi
- elog "You can now start ${PN} with '/etc/init.d/${PN} start'."
- elog
-}
diff --git a/net-analyzer/smokeping/smokeping-2.3.5.ebuild b/net-analyzer/smokeping/smokeping-2.3.5.ebuild
deleted file mode 100644
index a663dfc65002..000000000000
--- a/net-analyzer/smokeping/smokeping-2.3.5.ebuild
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.3.5.ebuild,v 1.3 2008/08/19 14:13:13 falco Exp $
-
-inherit perl-module eutils
-
-KEYWORDS="~amd64 ~hppa ~sparc ~x86"
-
-DESCRIPTION="A powerful latency measurement tool."
-SRC_URI="http://oss.oetiker.ch/smokeping/pub/${P}.tar.gz"
-HOMEPAGE="http://oss.oetiker.ch/smokeping/"
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="apache2"
-
-DEPEND="dev-lang/perl
- virtual/perl-libnet
- >=net-analyzer/rrdtool-1.2
- net-analyzer/fping
- dev-perl/libwww-perl
- dev-perl/Socket6
- dev-perl/Net-DNS
- apache2? ( >=www-apache/mod_perl-2.0.1 )"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- if ! built_with_use '>=net-analyzer/rrdtool-1.2' perl ; then
- eerror "You must build net-analyzer/rrdtool with the"
- eerror "'perl' USE flag turned on!"
- die "net-analyzer/rrdtool installed with 'perl' USE flag disabled"
- fi
-
- enewgroup smokeping
- enewuser smokeping -1 -1 /var/lib/smokeping smokeping
-}
-
-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 lib/*.pm
- insinto ${VENDOR_LIB}/Config
- doins lib/Config/*.pm
- insinto ${VENDOR_LIB}/Config/Grammar
- doins lib/Config/Grammar/*.pm
- insinto ${VENDOR_LIB}/Smokeping
- doins lib/Smokeping/*.pm
- insinto ${VENDOR_LIB}/Smokeping/matchers
- doins lib/Smokeping/matchers/*.pm
- insinto ${VENDOR_LIB}/Smokeping/probes
- doins lib/Smokeping/probes/*.pm
- insinto ${VENDOR_LIB}/Smokeping/sorters
- doins lib/Smokeping/sorters/*.pm
-
- # 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
-
- # Install the CGI webserver script
- exeinto /var/www/localhost/perl
- newexe htdocs/${PN}.cgi.dist ${PN}.pl
- dosed 's:^use lib:#use lib:g' /var/www/localhost/perl/${PN}.pl
- dosed 's:/usr/sepp/bin/speedy:/usr/bin/perl:' /var/www/localhost/perl/${PN}.pl
- dosed 's:/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config:/etc/smokeping:' \
- /var/www/localhost/perl/${PN}.pl
-
- # Install AJAX scripts
- insinto /var/www/localhost/perl
- doins -r htdocs/cropper
-
- # Create the binary
- newbin bin/${PN}.dist ${PN}
- dosed 's:^use lib:#use lib:g' /usr/bin/${PN}
- dosed 's:/usr/sepp/bin/perl-5.8.4:/usr/bin/perl:' /usr/bin/${PN}
- dosed 's:etc/config.dist:/etc/smokeping:' /usr/bin/${PN}
-
- # Create the config files
- insinto /etc
- newins "${FILESDIR}/config.dist" ${PN}
- newins etc/basepage.html.dist ${PN}.template
- doins etc/smokemail.dist
- newinitd "${FILESDIR}/${PN}.init" ${PN}
- if use apache2 ; then
- insinto /etc/apache2/modules.d
- doins "${FILESDIR}/78_${PN}.conf"
- fi
-}
-
-pkg_postinst() {
- chown smokeping:smokeping "${ROOT}/var/lib/${PN}"
- chmod 755 "${ROOT}/var/lib/${PN}"
- elog
- elog "Four more steps are needed to get ${PN} up&running:"
- elog "1) You need to edit /etc/${PN}"
- elog "2) You need to edit the template at /etc/${PN}.template"
- elog "3) You need to make the fping binary setuid root:"
- elog " # chmod 4755 /usr/sbin/fping"
- if use apache2 ; then
- elog "4) Make sure to add -D PERL to APACHE2_OPTS in /etc/conf.d/apache2"
- elog " and to restart apache2."
- fi
- elog "You can now start ${PN} with '/etc/init.d/${PN} start'."
- elog
-}
diff --git a/net-analyzer/smokeping/smokeping-2.4.2-r3.ebuild b/net-analyzer/smokeping/smokeping-2.4.2-r3.ebuild
index b5d14c827587..d062cb4814d9 100644
--- a/net-analyzer/smokeping/smokeping-2.4.2-r3.ebuild
+++ b/net-analyzer/smokeping/smokeping-2.4.2-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 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-r3.ebuild,v 1.5 2011/03/13 20:38:53 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.4.2-r3.ebuild,v 1.6 2011/04/01 15:57:16 pva Exp $
EAPI="2"
@@ -30,6 +30,7 @@ DEPEND="dev-lang/perl
speedy? ( dev-perl/SpeedyCGI )
!apache2? ( virtual/httpd-cgi )
apache2? ( >=www-apache/mod_perl-2.0.1 )
+ !dev-perl/Config-Grammar
!dev-perl/JSON
!perl-core/JSON-PP"
diff --git a/net-analyzer/smokeping/smokeping-2.4.2-r4.ebuild b/net-analyzer/smokeping/smokeping-2.4.2-r4.ebuild
new file mode 100644
index 000000000000..8ce757bcb009
--- /dev/null
+++ b/net-analyzer/smokeping/smokeping-2.4.2-r4.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2011 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-r4.ebuild,v 1.1 2011/04/01 15:57:16 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"
+
+# dev-perl/JSON-1.x is bundled and is incompatible with version 2.x wich is in
+# the tree. See http://bugs.gentoo.org/show_bug.cgi?id=260170#c2
+DEPEND="dev-lang/perl
+ virtual/perl-libnet
+ >=net-analyzer/rrdtool-1.2[perl]
+ >=net-analyzer/fping-2.4_beta2-r2
+ dev-perl/Config-Grammar
+ dev-perl/Digest-HMAC
+ dev-perl/libwww-perl
+ dev-perl/CGI-Session
+ >=dev-perl/SNMP_Session-1.13
+ >=dev-perl/Socket6-0.20
+ dev-perl/Net-DNS
+ speedy? ( dev-perl/SpeedyCGI )
+ !apache2? ( virtual/httpd-cgi )
+ apache2? ( >=www-apache/mod_perl-2.0.1 )"
+
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup smokeping
+ enewuser smokeping -1 -1 /var/lib/smokeping smokeping
+}
+
+src_prepare() {
+ rm -rf lib/Digest # provided by dev-perl/Digest-HMAC
+ rm -rf lib/CGI # provided by dev-perl/CGI-Session
+ rm -rf lib/Config # provided by dev-perl/Config-Grammar
+ rm -r lib/{BER.pm,SNMP_Session.pm,SNMP_util.pm} # dev-perl/SNMP_Session
+ rm qooxdoo/qooxdoolink
+
+ PERL5SMOKEPING="/usr/share/${PN}/perl5"
+ sed -i "/^use strict;/a\use lib '${PERL5SMOKEPING}';" \
+ "${S}"/lib/Qooxdoo/JSONRPC.pm || die
+}
+
+src_compile() {
+ # There is a makefile we don't want to run so leave this here
+ einfo "Skip compile."
+}
+
+src_install() {
+ # Install JSON-1 outside of perl's @INC path
+ insinto ${PERL5SMOKEPING}
+ doins lib/JSON.pm
+ insinto ${PERL5SMOKEPING}/JSON
+ doins -r lib/JSON/*
+ rm -r lib/JSON lib/JSON.pm
+ # Install the remaining 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.2" ${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
+
+ # 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
+}