1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils flag-o-matic multilib user
8 DESCRIPTION="50+ standard plugins for Icinga, Naemon, Nagios, Shinken, Sensu"
9 HOMEPAGE="https://www.monitoring-plugins.org/"
10 SRC_URI="https://www.monitoring-plugins.org/download/${P}.tar.gz"
14 KEYWORDS="amd64 ~arm ~arm64 ~sparc x86"
15 IUSE="gnutls ipv6 ldap libressl mysql dns fping game postgres radius samba snmp ssh +ssl"
17 # Most of the plugins use automagic dependencies, i.e. the plugin will
18 # get built if the binary it uses is installed. For example, check_snmp
19 # will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
20 # installed. End result: most of our runtime dependencies are required
21 # at build time as well.
23 # REAL_DEPEND contains the dependencies that are actually needed to
24 # build. DEPEND contains those plus the automagic dependencies.
26 REAL_DEPEND="dev-lang/perl
27 ldap? ( net-nds/openldap )
28 mysql? ( virtual/mysql )
29 postgres? ( dev-db/postgresql:= )
32 !libressl? ( dev-libs/openssl:0= )
33 libressl? ( dev-libs/libressl:= )
35 gnutls? ( net-libs/gnutls )
37 radius? ( net-dialup/freeradius-client )"
39 DEPEND="${REAL_DEPEND}
40 dns? ( net-dns/bind-tools )
41 game? ( games-util/qstat )
42 fping? ( net-analyzer/fping )
43 samba? ( net-fs/samba )
44 ssh? ( net-misc/openssh )
45 snmp? ( dev-perl/Net-SNMP
46 net-analyzer/net-snmp[-minimal] )"
48 # Basically everything collides with nagios-plugins.
50 !net-analyzer/nagios-plugins"
52 # At least one test is interactive.
55 PATCHES=( "${FILESDIR}/define-own-mysql-port-constant.patch" )
58 append-flags -fno-strict-aliasing
60 # Use an array to prevent econf from mangling the ping args.
64 myconf+=( $(use_with !gnutls openssl /usr)
65 $(use_with gnutls gnutls /usr) )
67 myconf+=( --without-openssl )
68 myconf+=( --without-gnutls )
71 # The autodetection for these two commands can hang if localhost is
72 # down or ICMP traffic is filtered. Bug #468296.
73 myconf+=( --with-ping-command="/bin/ping -n -U -w %d -c %d %s" )
76 myconf+=( --with-ping6-command="/bin/ping6 -n -U -w %d -c %d %s" )
83 $(use_with postgres pgsql /usr) \
86 --libexecdir="/usr/$(get_libdir)/nagios/plugins" \
87 --sysconfdir="/etc/nagios"
90 DOCS=( ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ \
91 NEWS README REQUIREMENTS SUPPORT THANKS )
95 enewuser nagios -1 /bin/bash /var/nagios/home nagios
99 elog "This ebuild has a number of USE flags that determine what you"
100 elog "are able to monitor. Depending on what you want to monitor, some"
101 elog "or all of these USE flags need to be set."
103 elog "The plugins are installed in ${EROOT%/}/usr/$(get_libdir)/nagios/plugins"