1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 DESCRIPTION="Official plugins for Nagios"
7 HOMEPAGE="http://nagios-plugins.org/"
8 SRC_URI="http://nagios-plugins.org/download/${P}.tar.gz"
12 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
13 IUSE="ipv6 ldap libressl mysql nagios-dns nagios-ping nagios-game postgres radius samba selinux snmp ssh +ssl"
15 # Most of the plugins use automagic dependencies, i.e. the plugin will
16 # get built if the binary it uses is installed. For example, check_snmp
17 # will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
18 # installed. End result: most of our runtime dependencies are required
19 # at build time as well.
21 nagios-dns? ( net-dns/bind-tools )
22 nagios-game? ( games-util/qstat )
23 nagios-ping? ( net-analyzer/fping )
24 samba? ( net-fs/samba )
25 ssh? ( net-misc/openssh )
26 snmp? ( dev-perl/Net-SNMP
27 net-analyzer/net-snmp[-minimal] )"
29 # Perl really needs to run during the build...
30 BDEPEND="${AUTOMAGIC_DEPEND}
34 ldap? ( net-nds/openldap )
35 mysql? ( dev-db/mysql-connector-c )
36 postgres? ( dev-db/postgresql:* )
38 !libressl? ( dev-libs/openssl:0 )
39 libressl? ( dev-libs/libressl )
41 radius? ( net-dialup/freeradius-client )"
43 # Basically everything in net-analyzer/monitoring-plugins collides with
44 # nagios-plugins. Perl (from BDEPEND) is needed at runtime, too.
47 !net-analyzer/monitoring-plugins
48 selinux? ( sec-policy/selinux-nagios )"
50 # At least one test is interactive.
66 PATCHES=( "${FILESDIR}/define-own-mysql-port-constant.patch" )
71 # Fix the path to our perl interpreter
72 sed -i -e "1s:/usr/local/bin/perl:/usr/bin/perl:" \
73 "${S}"/plugins-scripts/*.pl \
74 || die 'failed to fix perl interpreter path'
78 # Use an array to prevent econf from mangling the ping args.
82 myconf+=( $(use_with ssl openssl /usr) )
84 myconf+=( --without-openssl )
85 myconf+=( --without-gnutls )
88 # The autodetection for these two commands can hang if localhost is
89 # down or ICMP traffic is filtered. Bug #468296.
90 myconf+=( --with-ping-command="/bin/ping -n -U -w %d -c %d %s" )
93 myconf+=( --with-ping6-command="/bin/ping6 -n -U -w %d -c %d %s" )
100 $(use_with postgres pgsql /usr) \
103 --libexecdir="/usr/$(get_libdir)/nagios/plugins" \
104 --sysconfdir="/etc/nagios"
108 elog "This ebuild has a number of USE flags that determine what you"
109 elog "are able to monitor. Depending on what you want to monitor, some"
110 elog "or all of these USE flags need to be set."
112 elog "The plugins are installed in ${ROOT}/usr/$(get_libdir)/nagios/plugins"