# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ 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/" SRC_URI="https://github.com/naparuba/shinken/archive/${PV}.tar.gz" LICENSE="AGPLv3" SLOT="0" IUSE="livestat +arbiter broker poller reactionner receiver scheduler +webui" KEYWORDS="~amd64 ~x86" RDEPEND=" dev-python/pyro:3 dev-python/pycurl dev-python/cherrypy webui? ( dev-python/pymongo ) livestat? ( dev-python/simplejson ) 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} } 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 } src_install() { distutils_src_install --root=${D} rmdir ${D}var/run/${PN} rm ${D}etc/default/shinken newconfd "${FILESDIR}"/shinken.confd shinken keepdir "/var/log/${PN}" mkinitd cp -R "${S}/etc" "${D}/etc" || die "Install failed!" mv ${D}/etc/etc ${D}/etc/${PN} }