megacoffee.net Gentoo overlay - legacy mirror
We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.
comparison net-analyzer/nrpe/nrpe-2.14.ebuild @ 54:90a7a9dbfafb
importing net-analyzer/nrpe-2.14 from official portage tree
author | Daniel Neugebauer <dneuge@energiequant.de> |
---|---|
date | Mon, 17 Mar 2014 16:09:30 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
53:5cc622037103 | 54:90a7a9dbfafb |
---|---|
1 # Copyright 1999-2013 Gentoo Foundation | |
2 # Distributed under the terms of the GNU General Public License v2 | |
3 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/nrpe/nrpe-2.14.ebuild,v 1.8 2013/03/09 19:09:06 ago Exp $ | |
4 | |
5 EAPI=4 | |
6 | |
7 inherit eutils toolchain-funcs multilib user autotools | |
8 | |
9 DESCRIPTION="Nagios Remote Plugin Executor" | |
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 hppa ppc ppc64 sparc x86" | |
16 IUSE="command-args ssl tcpd minimal" | |
17 | |
18 DEPEND="ssl? ( dev-libs/openssl ) | |
19 !minimal? ( tcpd? ( sys-apps/tcp-wrappers ) )" | |
20 RDEPEND="${DEPEND} | |
21 !minimal? ( >=net-analyzer/nagios-plugins-1.3.0 )" | |
22 | |
23 pkg_setup() { | |
24 enewgroup nagios | |
25 enewuser nagios -1 /bin/bash /dev/null nagios | |
26 | |
27 elog "If you plan to use \"nrpe_check_control\" then you may want to specify" | |
28 elog "different command and services files. You can override the defaults" | |
29 elog "through the \"NAGIOS_COMMAND_FILE\" and \"NAGIOS_SERVICES_FILE\" environment variables." | |
30 elog "NAGIOS_COMMAND_FILE=${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}" | |
31 elog "NAGIOS_SERVICES_FILE=${NAGIOS_SERVICES_FILE:-/etc/services.cfg}" | |
32 } | |
33 | |
34 src_prepare() { | |
35 # Add support for large output, | |
36 # http://opsview-blog.opsera.com/dotorg/2008/08/enhancing-nrpe.html | |
37 epatch "${FILESDIR}"/${P}-multiline.patch | |
38 # fix configure, among others #326367, #397603 | |
39 epatch "${FILESDIR}"/${P}-tcpd-et-al.patch | |
40 | |
41 sed -i -e '/define \(COMMAND\|SERVICES\)_FILE/d' contrib/nrpe_check_control.c || die | |
42 | |
43 # change the default location of the pid file | |
44 sed -i -e '/pid_file/s:/var/run:/run:' sample-config/nrpe.cfg.in || die | |
45 | |
46 # fix TFU handling of autoheader | |
47 sed -i -e '/#undef/d' include/config.h.in || die | |
48 | |
49 eautoreconf | |
50 } | |
51 | |
52 src_configure() { | |
53 local myconf | |
54 if use minimal; then | |
55 myconf="--disable-tcp-wrapper --disable-command-args" | |
56 else | |
57 myconf="$(use_enable tcpd tcp-wrapper) $(use_enable command-args)" | |
58 fi | |
59 | |
60 econf \ | |
61 --libexecdir=/usr/$(get_libdir)/nagios/plugins \ | |
62 --localstatedir=/var/nagios \ | |
63 --sysconfdir=/etc/nagios \ | |
64 --with-nrpe-user=nagios \ | |
65 --with-nrpe-group=nagios \ | |
66 $(use_enable ssl) \ | |
67 ${myconf} | |
68 } | |
69 | |
70 src_compile() { | |
71 emake -C src check_nrpe $(use minimal || echo nrpe) | |
72 | |
73 # Add nifty nrpe check tool | |
74 $(tc-getCC) ${CPPFLAGS} ${CFLAGS} \ | |
75 -DCOMMAND_FILE=\"${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}\" \ | |
76 -DSERVICES_FILE=\"${NAGIOS_SERVICES_FILE:-/etc/services.cfg}\" \ | |
77 ${LDFLAGS} -o nrpe_check_control contrib/nrpe_check_control.c || die | |
78 } | |
79 | |
80 src_install() { | |
81 dodoc LEGAL Changelog README SECURITY \ | |
82 contrib/README.nrpe_check_control \ | |
83 $(use ssl && echo README.SSL) | |
84 | |
85 exeinto /usr/$(get_libdir)/nagios/plugins | |
86 doexe src/check_nrpe nrpe_check_control | |
87 | |
88 use minimal && return 0 | |
89 | |
90 ## NON-MINIMAL INSTALL FOLLOWS ## | |
91 | |
92 insinto /etc/nagios | |
93 newins sample-config/nrpe.cfg nrpe.cfg | |
94 fowners root:nagios /etc/nagios/nrpe.cfg | |
95 fperms 0640 /etc/nagios/nrpe.cfg | |
96 | |
97 exeinto /usr/libexec | |
98 doexe src/nrpe | |
99 | |
100 newinitd "${FILESDIR}"/nrpe.init nrpe | |
101 | |
102 insinto /etc/xinetd.d/ | |
103 newins "${FILESDIR}/nrpe.xinetd.2" nrpe | |
104 | |
105 if use tcpd; then | |
106 sed -i -e '/^reload()/, /^}/ d' -e '/extra_started_commands/s:reload::' \ | |
107 "${D}"/etc/init.d/nrpe | |
108 fi | |
109 } | |
110 | |
111 pkg_postinst() { | |
112 elog "If you are using the nrpe daemon, remember to edit" | |
113 elog "the config file /etc/nagios/nrpe.cfg" | |
114 | |
115 if use command-args ; then | |
116 ewarn "" | |
117 ewarn "You have enabled command-args for NRPE. This enables" | |
118 ewarn "the ability for clients to supply arguments to commands" | |
119 ewarn "which should be run. " | |
120 ewarn "THIS IS CONSIDERED A SECURITY RISK!" | |
121 ewarn "Please read /usr/share/doc/${PF}/SECURITY.bz2 for more info" | |
122 fi | |
123 } |