/[gentoo-x86]/net-analyzer/nsca/nsca-2.7.2-r103.ebuild
Gentoo

Contents of /net-analyzer/nsca/nsca-2.7.2-r103.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Oct 14 18:42:57 2012 UTC (23 months, 2 weeks ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +2 -2 lines
alpha/sparc/x86 stable wrt #436740

(Portage version: 2.1.11.16/cvs/Linux ia64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/nsca/nsca-2.7.2-r103.ebuild,v 1.7 2012/10/11 06:13:34 blueness Exp $
4
5 EAPI=4
6
7 inherit multilib user eutils
8
9 DESCRIPTION="Nagios Service Check Acceptor"
10 HOMEPAGE="http://www.nagios.org/"
11 SRC_URI="mirror://sourceforge/nagios/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="alpha amd64 ppc ppc64 sparc x86"
16 IUSE="tcpd +crypt minimal"
17
18 DEPEND="crypt? ( >=dev-libs/libmcrypt-2.5.1-r4 )
19 !minimal? ( tcpd? ( sys-apps/tcp-wrappers ) )"
20
21 RDEPEND="${DEPEND}
22 !minimal? ( || ( net-analyzer/icinga net-analyzer/nagios ) )
23 sys-apps/openrc"
24
25 pkg_setup() {
26 if ! use minimal; then
27 enewgroup nagios
28 enewgroup icinga
29 enewuser nagios -1 /bin/bash /var/nagios/home nagios
30 enewuser icinga -1 -1 /var/lib/icinga "icinga,nagios"
31 fi
32 }
33
34 src_configure() {
35 use tcpd || export ac_cv_lib_wrap_main=no
36 use crypt || export ac_cv_path_LIBMCRYPT_CONFIG=/bin/false
37
38 econf \
39 --localstatedir=/var/nagios \
40 --sysconfdir=/etc/nagios \
41 --with-nsca-user=nagios \
42 --with-nsca-grp=nagios
43 }
44
45 src_compile() {
46 emake -C src send_nsca $(use minimal || echo nsca)
47
48 # prepare the alternative configuration file
49 sed \
50 -e '/nsca_\(user\|group\)/s:nagios:icinga:' \
51 -e '/nsca_chroot/s:=.*:=/var/lib/icinga/rw:' \
52 -e '/\(command\|alternate_dump\)_file/s:/var/nagios:/var/lib/icinga:' \
53 "${S}"/sample-config/nsca.cfg > "${T}"/nsca.icinga.cfg
54 }
55
56 src_install() {
57 dodoc LEGAL Changelog README SECURITY
58
59 dobin src/send_nsca
60
61 insinto /etc/nagios
62 doins "${S}"/sample-config/send_nsca.cfg
63
64 if ! use minimal; then
65 exeinto /usr/libexec
66 doexe src/nsca
67
68 newinitd "${FILESDIR}"/nsca.init nsca
69 newconfd "${FILESDIR}"/nsca.conf nsca
70
71 insinto /etc/nagios
72 doins "${S}"/sample-config/nsca.cfg
73
74 insinto /etc/icinga
75 newins "${T}"/nsca.icinga.cfg nsca.cfg
76 fi
77 }
78
79 pkg_postinst() {
80 if ! use minimal; then
81 elog "If you are using the nsca daemon, remember to edit"
82 elog "the config file /etc/nagios/nsca.cfg"
83 elog ""
84 elog "If you intend to use nsca with Icinga, change the"
85 elog "configuration file path in /etc/conf.d/nsca so that"
86 elog "it will default to the correct paths and users."
87 fi
88 }

  ViewVC Help
Powered by ViewVC 1.1.20