Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-plugins/
Date: Sun, 22 Oct 2017 19:59:48
Message-Id: 1508702138.49e5aa05dd7ec9c5e832c067ab4dadd5778ea464.mjo@gentoo
1 commit: 49e5aa05dd7ec9c5e832c067ab4dadd5778ea464
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 22 19:21:33 2017 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 22 19:55:38 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49e5aa05
7
8 net-analyzer/nagios-plugins: new revision adding radius support.
9
10 The nagios-plugins build system has automagic support for radius that
11 can be disabled via the --without-radius flag. Doing so allows (or
12 prevents) the check_radius plugin from being built. This new revision
13 adds "radius" to IUSE for nagios-plugins, and builds check_radius (and
14 pulls in its dependencies) only when USE=radius is set.
15
16 Thanks to Martin Samek who noticed the missing flag.
17
18 Bug: https://bugs.gentoo.org/634582
19 Package-Manager: Portage-2.3.8, Repoman-2.3.3
20
21 .../nagios-plugins/nagios-plugins-2.2.1-r1.ebuild | 116 +++++++++++++++++++++
22 1 file changed, 116 insertions(+)
23
24 diff --git a/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r1.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r1.ebuild
25 new file mode 100644
26 index 00000000000..c86bad6d681
27 --- /dev/null
28 +++ b/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r1.ebuild
29 @@ -0,0 +1,116 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +inherit user
36 +
37 +DESCRIPTION="Official plugins for Nagios"
38 +HOMEPAGE="http://nagios-plugins.org/"
39 +SRC_URI="http://nagios-plugins.org/download/${P}.tar.gz"
40 +
41 +LICENSE="GPL-2"
42 +SLOT="0"
43 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
44 +IUSE="ipv6 ldap libressl mysql nagios-dns nagios-ping nagios-game postgres radius samba selinux snmp ssh +ssl"
45 +
46 +# Most of the plugins use automagic dependencies, i.e. the plugin will
47 +# get built if the binary it uses is installed. For example, check_snmp
48 +# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
49 +# installed. End result: most of our runtime dependencies are required
50 +# at build time as well.
51 +#
52 +# REAL_DEPEND contains the dependencies that are actually needed to
53 +# build. DEPEND contains those plus the automagic dependencies.
54 +#
55 +REAL_DEPEND="dev-lang/perl
56 + ldap? ( net-nds/openldap )
57 + mysql? ( virtual/mysql )
58 + postgres? ( dev-db/postgresql:* )
59 + ssl? (
60 + !libressl? ( dev-libs/openssl:0 )
61 + libressl? ( dev-libs/libressl )
62 + )
63 + radius? ( net-dialup/freeradius-client )"
64 +
65 +DEPEND="${REAL_DEPEND}
66 + nagios-dns? ( net-dns/bind-tools )
67 + nagios-game? ( games-util/qstat )
68 + nagios-ping? ( net-analyzer/fping )
69 + samba? ( net-fs/samba )
70 + ssh? ( net-misc/openssh )
71 + snmp? ( dev-perl/Net-SNMP
72 + net-analyzer/net-snmp[-minimal] )"
73 +
74 +# Basically everything collides with nagios-plugins.
75 +RDEPEND="${DEPEND}
76 + !net-analyzer/monitoring-plugins
77 + selinux? ( sec-policy/selinux-nagios )"
78 +
79 +# At least one test is interactive.
80 +RESTRICT="test"
81 +
82 +DOCS=(
83 + ACKNOWLEDGEMENTS
84 + AUTHORS
85 + CODING
86 + ChangeLog
87 + FAQ
88 + NEWS
89 + README
90 + REQUIREMENTS
91 + SUPPORT
92 + THANKS
93 +)
94 +
95 +src_prepare() {
96 + default
97 +
98 + # Fix the path to our perl interpreter
99 + sed -i -e "1s:/usr/local/bin/perl:/usr/bin/perl:" \
100 + "${S}"/plugins-scripts/*.pl \
101 + || die 'failed to fix perl interpreter path'
102 +}
103 +
104 +src_configure() {
105 + # Use an array to prevent econf from mangling the ping args.
106 + local myconf=()
107 +
108 + if use ssl; then
109 + myconf+=( $(use_with ssl openssl /usr) )
110 + else
111 + myconf+=( --without-openssl )
112 + myconf+=( --without-gnutls )
113 + fi
114 +
115 + # The autodetection for these two commands can hang if localhost is
116 + # down or ICMP traffic is filtered. Bug #468296.
117 + myconf+=( --with-ping-command="/bin/ping -n -U -w %d -c %d %s" )
118 +
119 + if use ipv6; then
120 + myconf+=( --with-ping6-command="/bin/ping6 -n -U -w %d -c %d %s" )
121 + fi
122 +
123 + econf \
124 + $(use_with mysql) \
125 + $(use_with ipv6) \
126 + $(use_with ldap) \
127 + $(use_with postgres pgsql /usr) \
128 + $(use_with radius) \
129 + "${myconf[@]}" \
130 + --libexecdir="/usr/$(get_libdir)/nagios/plugins" \
131 + --sysconfdir="/etc/nagios"
132 +}
133 +
134 +pkg_preinst() {
135 + enewgroup nagios
136 + enewuser nagios -1 /bin/bash /var/nagios/home nagios
137 +}
138 +
139 +pkg_postinst() {
140 + elog "This ebuild has a number of USE flags that determine what you"
141 + elog "are able to monitor. Depending on what you want to monitor, some"
142 + elog "or all of these USE flags need to be set."
143 + elog
144 + elog "The plugins are installed in ${ROOT}usr/$(get_libdir)/nagios/plugins"
145 +}