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