Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/monitoring-plugins/
Date: Fri, 28 Sep 2018 18:14:52
Message-Id: 1538158481.c975b53a53ba2c134a650ca570971d85cafda747.zlogene@gentoo
1 commit: c975b53a53ba2c134a650ca570971d85cafda747
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Fri Sep 28 08:00:45 2018 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 28 18:14:41 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c975b53a
7
8 net-analyzer/monitoring-plugins: replace virtual/mysql dependency
9
10 Closes: https://bugs.gentoo.org/665948
11 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
12 Package-Manager: Portage-2.3.50, Repoman-2.3.11
13 Closes: https://github.com/gentoo/gentoo/pull/9996
14
15 .../monitoring-plugins-2.2-r3.ebuild | 104 +++++++++++++++++++++
16 1 file changed, 104 insertions(+)
17
18 diff --git a/net-analyzer/monitoring-plugins/monitoring-plugins-2.2-r3.ebuild b/net-analyzer/monitoring-plugins/monitoring-plugins-2.2-r3.ebuild
19 new file mode 100644
20 index 00000000000..52ef5740c27
21 --- /dev/null
22 +++ b/net-analyzer/monitoring-plugins/monitoring-plugins-2.2-r3.ebuild
23 @@ -0,0 +1,104 @@
24 +# Copyright 1999-2018 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=6
28 +
29 +inherit eutils flag-o-matic multilib user
30 +
31 +DESCRIPTION="50+ standard plugins for Icinga, Naemon, Nagios, Shinken, Sensu"
32 +HOMEPAGE="https://www.monitoring-plugins.org/"
33 +SRC_URI="https://www.monitoring-plugins.org/download/${P}.tar.gz"
34 +
35 +LICENSE="GPL-3"
36 +SLOT="0"
37 +KEYWORDS="~amd64 ~arm ~arm64 ~sparc ~x86"
38 +IUSE="gnutls ipv6 ldap libressl mysql dns fping game postgres radius samba snmp ssh +ssl"
39 +
40 +# Most of the plugins use automagic dependencies, i.e. the plugin will
41 +# get built if the binary it uses is installed. For example, check_snmp
42 +# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
43 +# installed. End result: most of our runtime dependencies are required
44 +# at build time as well.
45 +#
46 +# REAL_DEPEND contains the dependencies that are actually needed to
47 +# build. DEPEND contains those plus the automagic dependencies.
48 +#
49 +REAL_DEPEND="dev-lang/perl
50 + ldap? ( net-nds/openldap )
51 + mysql? ( dev-db/mysql-connector-c:= )
52 + postgres? ( dev-db/postgresql:= )
53 + ssl? (
54 + !gnutls? (
55 + !libressl? ( dev-libs/openssl:0= )
56 + libressl? ( dev-libs/libressl:= )
57 + )
58 + gnutls? ( net-libs/gnutls )
59 + )
60 + radius? ( net-dialup/freeradius-client )"
61 +
62 +DEPEND="${REAL_DEPEND}
63 + dns? ( net-dns/bind-tools )
64 + game? ( games-util/qstat )
65 + fping? ( net-analyzer/fping )
66 + samba? ( net-fs/samba )
67 + ssh? ( net-misc/openssh )
68 + snmp? ( dev-perl/Net-SNMP
69 + net-analyzer/net-snmp[-minimal] )"
70 +
71 +# Basically everything collides with nagios-plugins.
72 +RDEPEND="${DEPEND}
73 + !net-analyzer/nagios-plugins"
74 +
75 +# At least one test is interactive.
76 +RESTRICT="test"
77 +
78 +PATCHES=( "${FILESDIR}/define-own-mysql-port-constant.patch" )
79 +
80 +src_configure() {
81 + append-flags -fno-strict-aliasing
82 +
83 + # Use an array to prevent econf from mangling the ping args.
84 + local myconf=()
85 +
86 + if use ssl; then
87 + myconf+=( $(use_with !gnutls openssl /usr)
88 + $(use_with gnutls gnutls /usr) )
89 + else
90 + myconf+=( --without-openssl )
91 + myconf+=( --without-gnutls )
92 + fi
93 +
94 + # The autodetection for these two commands can hang if localhost is
95 + # down or ICMP traffic is filtered. Bug #468296.
96 + myconf+=( --with-ping-command="/bin/ping -n -U -w %d -c %d %s" )
97 +
98 + if use ipv6; then
99 + myconf+=( --with-ping6-command="/bin/ping6 -n -U -w %d -c %d %s" )
100 + fi
101 +
102 + econf \
103 + $(use_with mysql) \
104 + $(use_with ipv6) \
105 + $(use_with ldap) \
106 + $(use_with postgres pgsql /usr) \
107 + $(use_with radius) \
108 + "${myconf[@]}" \
109 + --libexecdir="/usr/$(get_libdir)/nagios/plugins" \
110 + --sysconfdir="/etc/nagios"
111 +}
112 +
113 +DOCS=( ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ \
114 + NEWS README REQUIREMENTS SUPPORT THANKS )
115 +
116 +pkg_preinst() {
117 + enewgroup nagios
118 + enewuser nagios -1 /bin/bash /var/nagios/home nagios
119 +}
120 +
121 +pkg_postinst() {
122 + elog "This ebuild has a number of USE flags that determine what you"
123 + elog "are able to monitor. Depending on what you want to monitor, some"
124 + elog "or all of these USE flags need to be set."
125 + elog
126 + elog "The plugins are installed in ${EROOT%/}/usr/$(get_libdir)/nagios/plugins"
127 +}