2011-07-05 23:19:40 +02:00
|
|
|
# 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"
|
2012-04-12 17:09:45 +02:00
|
|
|
IUSE="livestat +arbiter broker poller reactionner receiver scheduler"
|
2011-07-05 23:19:40 +02:00
|
|
|
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
|
|
|
|
RDEPEND="
|
|
|
|
dev-python/pyro:3
|
|
|
|
livestat? ( dev-python/simplejson
|
|
|
|
dev-python/pysqlite )
|
2012-04-12 17:09:45 +02:00
|
|
|
poller? ( net-analyzer/nagios-plugins )
|
2011-07-05 23:19:40 +02:00
|
|
|
"
|
2011-07-08 11:27:09 +02:00
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
!net-analyzer/nagios"
|
2011-07-05 23:19:40 +02:00
|
|
|
|
2012-04-12 17:09:45 +02:00
|
|
|
SHINKENMODULES="arbiter broker poller reactionner receiver scheduler"
|
2012-04-13 13:40:20 +02:00
|
|
|
CHOOSEN_MODULES=""
|
2011-07-05 23:19:40 +02:00
|
|
|
|
2012-04-12 17:09:45 +02:00
|
|
|
src_configure() {
|
|
|
|
local -i modnum=0
|
2011-07-05 23:19:40 +02:00
|
|
|
|
2012-04-12 17:09:45 +02:00
|
|
|
for mod in ${SHINKENMODULES}; do
|
|
|
|
if use $mod; then
|
|
|
|
let modnum++
|
2012-04-13 13:40:20 +02:00
|
|
|
CHOOSEN_MODULES="${CHOOSEN_MODULES}${PN}.${mod} "
|
2012-04-12 17:09:45 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [[ "${modnum}" -lt 1 ]]; then
|
|
|
|
eerror
|
|
|
|
eerror "No shinken module selected, aborting...."
|
|
|
|
ewarn "Supported modules are ${SHINKENMODULES}"
|
|
|
|
eerror
|
|
|
|
fi
|
2011-07-05 23:19:40 +02:00
|
|
|
}
|
|
|
|
|
2012-04-12 17:09:45 +02:00
|
|
|
src_compile() {
|
|
|
|
elog "nothing to compile."
|
2011-07-05 23:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2012-04-12 17:09:45 +02:00
|
|
|
distutils_src_install --root=${D}
|
2011-07-05 23:19:40 +02:00
|
|
|
# remove windows-specific configs
|
2011-07-19 13:31:40 +02:00
|
|
|
rm -rf ${D}$(python_get_sitedir)/skonf
|
2011-07-05 23:19:40 +02:00
|
|
|
|
2012-04-12 17:09:45 +02:00
|
|
|
# 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}"
|
2011-07-05 23:19:40 +02:00
|
|
|
fowners shinken:shinken "/var/lib/${PN}"
|
|
|
|
fperms 750 "/var/lib/${PN}"
|
2011-07-08 11:27:09 +02:00
|
|
|
keepdir "/var/run/${PN}"
|
2011-07-19 13:31:40 +02:00
|
|
|
fowners shinken:shinken "/var/run/${PN}"
|
|
|
|
keepdir "/var/log/${PN}"
|
|
|
|
fowners shinken:shinken "/var/log/${PN}"
|
|
|
|
fperms 750 "/var/log/${PN}"
|
|
|
|
|
2011-07-08 11:27:09 +02:00
|
|
|
insinto "/usr/lib/nagios/plugins"
|
|
|
|
doins libexec/*.sh libexec/*.py
|
|
|
|
dobin bin/nagios
|
2012-04-12 17:09:45 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2011-07-08 11:27:09 +02:00
|
|
|
for mod in $manpages; do
|
2012-04-12 17:09:45 +02:00
|
|
|
newman doc/man/shinken-${mod}.8shinken shinken-${mod}.8
|
2011-07-08 11:27:09 +02:00
|
|
|
done
|
|
|
|
|
2011-07-05 23:19:40 +02:00
|
|
|
newconfd ${FILESDIR}/${PN}.confd ${PN}
|
2012-04-12 17:09:45 +02:00
|
|
|
newinitd ${FILESDIR}/${PN}.initd ${PN}
|
2011-07-05 23:19:40 +02:00
|
|
|
cd ${D}/etc/init.d
|
|
|
|
for mod in ${SHINKENMODULES}; do
|
2012-04-12 17:09:45 +02:00
|
|
|
if use $mod; then
|
|
|
|
ln -s ${PN} ${PN}.${mod} || die
|
|
|
|
fi
|
2011-07-05 23:19:40 +02:00
|
|
|
done
|
2012-04-13 13:40:20 +02:00
|
|
|
# adding services dependency
|
|
|
|
sed -i -e "s:^\(SHINKENSERVICES=\).*:\1\"${CHOOSEN_MODULES}\":" \
|
|
|
|
${D}/etc/conf.d/${PN} || die
|
|
|
|
# fixing path
|
|
|
|
cd ${D}/etc/${PN}
|
|
|
|
sed -i -e "s:${D}:/:" \
|
|
|
|
*.cfg *d.ini || die
|
2011-07-05 23:19:40 +02:00
|
|
|
}
|
|
|
|
|
2012-04-12 17:09:45 +02:00
|
|
|
pkg_setup() {
|
|
|
|
python_pkg_setup
|
|
|
|
enewgroup shinken
|
|
|
|
enewuser shinken -1 -1 -1 shinken
|
|
|
|
}
|