# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/www-apps/shinken/shinken-0.12.2.ebuild,v 1.4 2011/03/15 21:34:31 xarthisius Exp $ EAPI=3 PYTHON_DEPEND="2:2.6" RESTRICT_PYTHON_ABIS="3.* *-jython" inherit distutils eutils python DESCRIPTION="Shinken is a new monitoring tool written in Python and compatible with Nagios." HOMEPAGE="http://shinken-monitoring.org/" SRC_URI="http://shinken-monitoring.org/pub/${P}.tar.gz" LICENSE="AGPLv3" SLOT="0" IUSE="livestat" KEYWORDS="~amd64 ~x86" RDEPEND=" dev-python/pyro:3 livestat? ( dev-python/simplejson dev-python/pysqlite ) " DEPEND="${RDEPEND} !net-analyzer/nagios" SHINKENMODULES="scheduler poller reactionner broker" src_unpack() { unpack ${A} cd ${S} epatch "${FILESDIR}/${P}.patch" } pkg_setup() { python_pkg_setup enewgroup shinken enewuser shinken -1 -1 -1 shinken } src_prepare() { # remove unneded doubletts rm bin/*.py # fixing path sed -i \ -e "s:^\(# \?\)\?local_log=\(%(workdir)s/\)\?\(.\+\):local_log=/var/log/${PN}/\3:" \ -e "s:^\(# \?\)\?workdir=\(.\+\):local_log=/var/lib/${PN}:" \ -e "s:^\(# \?\)\?pidfile=\(%(workdir)s/\)\?\(.\+\):pidfile=/var/run/${PN}/\3:" \ -e "s:^\(# \?\)\?user=\([^ ]\+\)\(.\+\)\?:user=\2:" \ -e "s:^\(# \?\)\?group=\([^ ]\+\)\(.\+\)\?:group=\2:" \ etc/*d.ini || die } src_install() { distutils_src_install # remove windows-specific configs rm ${D}/etc/${PN}/*-windows.ini rm -rf ${D}$(python_get_sitedir)/skonf keepdir /var/lib/${PN} fowners shinken:shinken "/var/lib/${PN}" fperms 750 "/var/lib/${PN}" keepdir "/var/run/${PN}" fowners shinken:shinken "/var/run/${PN}" keepdir "/var/log/${PN}" fowners shinken:shinken "/var/log/${PN}" fperms 750 "/var/log/${PN}" insinto "/usr/lib/nagios/plugins" doins libexec/*.sh libexec/*.py dobin bin/nagios manpages="scheduler receiver reactionner poller discovery broker arbiter" for mod in $manpages; do newman for_debian/man/shinken-${mod}.8shinken shinken-${mod}.8 done newconfd ${FILESDIR}/${PN}.confd ${PN} newinitd ${FILESDIR}/${PN}.initd ${PN}.arbiter cd ${D}/etc/init.d for mod in ${SHINKENMODULES}; do ln -s ${PN}.arbiter ${PN}.${mod} || die done }