# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/smokeping/smokeping-2.6.8.ebuild,v 1.1 2012/08/29 08:26:37 klausman Exp $ EAPI="4" inherit 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" # dropping hppa and sparc because of way too may dependencies not having # keywords in those architectures. KEYWORDS="" IUSE="apache2 curl dig echoping fcgi ipv6 ldap telnet" DEPEND="!apache2? ( virtual/httpd-cgi ) >=dev-lang/perl-5.8.8-r8 >=dev-perl/SNMP_Session-1.13 >=net-analyzer/fping-2.4_beta2-r2 >=net-analyzer/rrdtool-1.2[perl] apache2? ( >=www-apache/mod_perl-2.0.1 www-apache/mod_fcgid ) curl? ( >=net-misc/curl-7.21.4 ) dev-perl/CGI-Session dev-perl/Config-Grammar dev-perl/Digest-HMAC fcgi? ( dev-perl/FCGI ) dev-perl/IO-Socket-SSL dev-perl/Net-DNS dev-perl/libwww-perl dig? ( net-dns/bind-tools ) echoping? ( >=net-analyzer/echoping-6.0.2 ) ipv6? ( >=dev-perl/Socket6-0.20 ) ldap? ( dev-perl/perl-ldap ) telnet? ( dev-perl/Net-Telnet ) virtual/perl-libnet" RDEPEND="${DEPEND}" pkg_setup() { enewgroup smokeping enewuser smokeping -1 -1 /var/lib/smokeping smokeping } src_prepare() { rm -r lib/{BER.pm,SNMP_Session.pm,SNMP_util.pm} # dev-perl/SNMP_Session epatch "${FILESDIR}/smokeping_fping-3.3.patch" } src_configure() { econf \ --sysconfdir=/etc/smokeping \ --with-htdocs-dir=/var/www/localhost/smokeping } src_compile() { emake } src_install() { emake DESTDIR="${D}" install || die "emake install failed" newinitd "${FILESDIR}/${PN}.init.3" ${PN} || die mv "${D}/etc/smokeping/basepage.html.dist" "${D}/etc/smokeping/basepage.html" mv "${D}/etc/smokeping/config.dist" "${D}/etc/smokeping/config" mv "${D}/etc/smokeping/smokemail.dist" "${D}/etc/smokeping/smokemail" mv "${D}/etc/smokeping/smokeping_secrets.dist" "${D}/etc/smokeping/smokeping_secrets" mv "${D}/etc/smokeping/tmail.dist" "${D}/etc/smokeping/tmail" 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 '/^