alpha-quadrant/net-analyzer/shinken/shinken-1.0.1.ebuild

120 lines
2.7 KiB
Bash
Raw Normal View History

# 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 )
"
2011-07-08 11:27:09 +02:00
DEPEND="${RDEPEND}
!net-analyzer/nagios"
SHINKENMODULES="arbiter broker poller reactionner receiver scheduler"
2012-04-13 13:40:20 +02:00
CHOOSEN_MODULES=""
src_configure() {
local -i modnum=0
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} "
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}"
2011-07-08 11:27:09 +02:00
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}"
2011-07-08 11:27:09 +02:00
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
2011-07-08 11:27:09 +02:00
for mod in $manpages; do
newman doc/man/shinken-${mod}.8shinken shinken-${mod}.8
2011-07-08 11:27:09 +02:00
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
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
}
pkg_setup() {
python_pkg_setup
enewgroup shinken
enewuser shinken -1 -1 -1 shinken
}