alpha-quadrant/net-analyzer/shinken/shinken-1.0.1.ebuild
2012-04-12 17:09:45 +02:00

111 lines
2.5 KiB
Bash

# 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 +arbiter broker poller reactionner receiver scheduler"
KEYWORDS="~amd64 ~x86"
RDEPEND="
dev-python/pyro:3
livestat? ( dev-python/simplejson
dev-python/pysqlite )
poller? ( net-analyzer/nagios-plugins )
"
DEPEND="${RDEPEND}
!net-analyzer/nagios"
SHINKENMODULES="arbiter broker poller reactionner receiver scheduler"
src_configure() {
local -i modnum=0
for mod in ${SHINKENMODULES}; do
if use $mod; then
let modnum++
fi
done
if [[ "${modnum}" -lt 1 ]]; then
eerror
eerror "No shinken module selected, aborting...."
ewarn "Supported modules are ${SHINKENMODULES}"
eerror
fi
}
src_compile() {
elog "nothing to compile."
}
src_install() {
distutils_src_install --root=${D}
# remove windows-specific configs
rm -rf ${D}$(python_get_sitedir)/skonf
# remove windows-specific configs
rm ${D}etc/${PN}/*-windows.ini
rm ${D}etc/${PN}/*-windows.cfg
# cleanup files not needed.
rm ${D}etc/init.d/*
rm -rf ${D}etc/default
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
for mod in ${SHINKENMODULES}; do
if ! use $mod; then
rm -f ${D}/etc/${PN}/${mod}d.ini
[ $mod != 'arbiter' ] && rm -f ${D}/usr/bin/${PN}-${mod}
fi
done
manpages="discovery"
for mod in ${SHINKENMODULES}; do
if use $mod; then
manpages="${manpages} $mod"
fi
done
for mod in $manpages; do
newman doc/man/shinken-${mod}.8shinken shinken-${mod}.8
done
newconfd ${FILESDIR}/${PN}.confd ${PN}
newinitd ${FILESDIR}/${PN}.initd ${PN}
cd ${D}/etc/init.d
for mod in ${SHINKENMODULES}; do
if use $mod; then
ln -s ${PN} ${PN}.${mod} || die
fi
done
}
pkg_setup() {
python_pkg_setup
enewgroup shinken
enewuser shinken -1 -1 -1 shinken
}