2014-02-18 15:20:45 +01:00
|
|
|
# Copyright 1999-2011 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2017-02-22 10:55:24 +01:00
|
|
|
# $Header: $
|
2014-02-18 15:20:45 +01:00
|
|
|
|
|
|
|
EAPI=5
|
|
|
|
PYTHON_DEPEND="2:2.7"
|
|
|
|
RESTRICT_PYTHON_ABIS="3.* *-jython"
|
|
|
|
|
|
|
|
inherit distutils user
|
|
|
|
|
|
|
|
DESCRIPTION="Shinken is a new monitoring tool written in Python and compatible with Nagios."
|
|
|
|
HOMEPAGE="http://shinken-monitoring.org/"
|
2017-02-22 10:55:24 +01:00
|
|
|
SRC_URI="https://github.com/naparuba/shinken/archive/${PV}.tar.gz"
|
2014-02-18 15:20:45 +01:00
|
|
|
|
|
|
|
LICENSE="AGPLv3"
|
|
|
|
SLOT="0"
|
|
|
|
IUSE="livestat +arbiter broker poller reactionner receiver scheduler +webui"
|
|
|
|
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
|
|
|
|
RDEPEND="
|
|
|
|
dev-python/pyro:3
|
|
|
|
dev-python/pycurl
|
2017-02-22 10:55:24 +01:00
|
|
|
dev-python/cherrypy
|
2014-02-18 15:20:45 +01:00
|
|
|
webui? ( dev-python/pymongo )
|
2017-02-22 10:55:24 +01:00
|
|
|
livestat? ( dev-python/simplejson )
|
2014-02-18 15:20:45 +01:00
|
|
|
poller? ( net-analyzer/nagios-plugins )
|
|
|
|
"
|
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
!net-analyzer/nagios"
|
|
|
|
|
|
|
|
SHINKENMODULES="arbiter broker poller reactionner receiver scheduler"
|
|
|
|
|
|
|
|
pkg_setup() {
|
|
|
|
python_pkg_setup
|
|
|
|
ebegin "Creating shinken user and group"
|
|
|
|
enewgroup ${PN}
|
|
|
|
enewuser ${PN} -1 -1 -1 ${PN}
|
|
|
|
}
|
|
|
|
|
2017-02-22 10:55:24 +01:00
|
|
|
mkinitd() {
|
|
|
|
for mod in ${SHINKENMODULES}; do
|
|
|
|
if (use $mod) ; then
|
|
|
|
uMOD=$(awk '{print toupper($0)}' <<< $mod)
|
|
|
|
sed -e "s!xxMODULExx!$mod!g" \
|
|
|
|
-e "s!XXUMODXX!$uMOD!g" \
|
|
|
|
${FILESDIR}/shinken.initd > ${D}etc/init.d/shinken-$mod
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-02-18 15:20:45 +01:00
|
|
|
src_install() {
|
|
|
|
distutils_src_install --root=${D}
|
2017-02-22 10:55:24 +01:00
|
|
|
|
2014-02-18 15:20:45 +01:00
|
|
|
rmdir ${D}var/run/${PN}
|
2017-02-22 10:55:24 +01:00
|
|
|
rm ${D}etc/default/shinken
|
|
|
|
newconfd "${FILESDIR}"/shinken.confd shinken
|
2014-02-18 15:20:45 +01:00
|
|
|
|
|
|
|
keepdir "/var/log/${PN}"
|
2017-02-22 10:55:24 +01:00
|
|
|
mkinitd
|
2014-02-18 15:20:45 +01:00
|
|
|
|
2017-02-22 10:55:24 +01:00
|
|
|
cp -R "${S}/etc" "${D}/etc" || die "Install failed!"
|
|
|
|
mv ${D}/etc/etc ${D}/etc/${PN}
|
2014-02-18 15:20:45 +01:00
|
|
|
}
|