diff options
author | 2012-08-23 21:27:08 +0000 | |
---|---|---|
committer | 2012-08-23 21:27:08 +0000 | |
commit | b562bfcc80663f61bde0a0f83a90b0303ebb27f5 (patch) | |
tree | de32c1d7884f1a68658f3e7e8a5ad5255069ca24 /net-analyzer/nsca/nsca-2.7.2-r103.ebuild | |
parent | Move nagios-nsca to just nsca. (diff) | |
download | gentoo-2-b562bfcc80663f61bde0a0f83a90b0303ebb27f5.tar.gz gentoo-2-b562bfcc80663f61bde0a0f83a90b0303ebb27f5.tar.bz2 gentoo-2-b562bfcc80663f61bde0a0f83a90b0303ebb27f5.zip |
Move from net-analyzer/nagios-nsca to net-analyzer/nsca, as the package work with Icinga just fine.
(Portage version: 2.2.0_alpha121/cvs/Linux x86_64, RepoMan options: --force)
Diffstat (limited to 'net-analyzer/nsca/nsca-2.7.2-r103.ebuild')
-rw-r--r-- | net-analyzer/nsca/nsca-2.7.2-r103.ebuild | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/net-analyzer/nsca/nsca-2.7.2-r103.ebuild b/net-analyzer/nsca/nsca-2.7.2-r103.ebuild new file mode 100644 index 000000000000..1880d143b597 --- /dev/null +++ b/net-analyzer/nsca/nsca-2.7.2-r103.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nsca/nsca-2.7.2-r103.ebuild,v 1.1 2012/08/23 21:27:08 flameeyes Exp $ + +EAPI=4 + +inherit multilib user eutils + +DESCRIPTION="Nagios NSCA - Nagios Service Check Acceptor" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="mirror://sourceforge/nagios/nsca-${PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="tcpd +crypt minimal" + +DEPEND="crypt? ( >=dev-libs/libmcrypt-2.5.1-r4 ) + !minimal? ( tcpd? ( sys-apps/tcp-wrappers ) )" + +RDEPEND="${DEPEND} + !minimal? ( || ( net-analyzer/icinga net-analyzer/nagios ) ) + sys-apps/openrc" + +S="${WORKDIR}/nsca-${PV}" + +pkg_setup() { + if ! use minimal; then + enewgroup nagios + enewgroup icinga + enewuser nagios -1 /bin/bash /var/nagios/home nagios + enewuser icinga -1 -1 /var/lib/icinga "icinga,nagios" + fi +} + +src_configure() { + use tcpd || export ac_cv_lib_wrap_main=no + use crypt || export ac_cv_path_LIBMCRYPT_CONFIG=/bin/false + + econf \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --with-nsca-user=nagios \ + --with-nsca-grp=nagios +} + +src_compile() { + emake -C src send_nsca $(usex !minimal nsca) + + # prepare the alternative configuration file + sed \ + -e '/ncsa_\(user\|group\)/s:nagios:icinga:' \ + -e '/ncsa_chroot/s:=.*:=/var/lib/icinga/rw:' \ + -e '/\(command\|alternate_dump\)_file/s:/var/nagios:/var/lib/icinga:' \ + "${S}"/sample-config/nsca.cfg > "${T}"/nsca.icinga.cfg +} + +src_install() { + dodoc LEGAL Changelog README SECURITY + + dobin src/send_nsca + + insinto /etc/nagios + doins "${S}"/sample-config/send_nsca.cfg + + if ! use minimal; then + exeinto /usr/libexec + doexe src/nsca + + newinitd "${FILESDIR}"/nsca.init nsca + newconfd "${FILESDIR}"/nsca.conf nsca + + insinto /etc/nagios + doins "${S}"/sample-config/nsca.cfg + + insinto /etc/icinga + newins "${T}"/nsca.icinga.cfg nsca.cfg + fi +} + +pkg_postinst() { + if ! use minimal; then + elog "If you are using the nsca daemon, remember to edit" + elog "the config file /etc/nagios/nsca.cfg" + elog "" + elog "If you intend to use nsca with Icinga, change the" + elog "configuration file path in /etc/conf.d/nsca so that" + elog "it will default to the correct paths and users." + fi +} |