public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/jmbsvicetto:master commit in: net-analyzer/nagios-plugins/files/, net-analyzer/nagios-plugins/
@ 2013-05-14  1:29 Jorge Manuel B. S. Vicetto
  0 siblings, 0 replies; only message in thread
From: Jorge Manuel B. S. Vicetto @ 2013-05-14  1:29 UTC (permalink / raw
  To: gentoo-commits

commit:     230fcbc6873d2b71a33ebf2cde2c2d1a93d35a3d
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Tue May 14 01:26:33 2013 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Tue May 14 01:26:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/jmbsvicetto.git;a=commit;h=230fcbc6

[net-analyzer/nagios-plugins] Add nagios-plugins to the overlay and apply a patch to replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS to
fix the build of the package.

---
 net-analyzer/nagios-plugins/Manifest               |    2 +
 .../files/nagios-plugins-1.4.16-fix-ac-macro.patch |   12 ++
 net-analyzer/nagios-plugins/metadata.xml           |   59 +++++++++
 .../nagios-plugins/nagios-plugins-1.4.16-r3.ebuild |  137 ++++++++++++++++++++
 4 files changed, 210 insertions(+), 0 deletions(-)

diff --git a/net-analyzer/nagios-plugins/Manifest b/net-analyzer/nagios-plugins/Manifest
new file mode 100644
index 0000000..574152a
--- /dev/null
+++ b/net-analyzer/nagios-plugins/Manifest
@@ -0,0 +1,2 @@
+DIST nagios-plugins-1.4.16-patches-2.tar.xz 8972 SHA256 e553c6a13aa56d826e113008ab87b6eee2d676fb2a09aa5433211ebfea6cd7c9 SHA512 48352873396274b4063bf8e58530df7c8cf6cfefe5e581ad31bd44a54b295bac634688d33de98e4f90723b0e1652192762cfcb6664fc0ce5bee797d6716584f8 WHIRLPOOL 3e397e8a2e1cd98ac646d4b419a38b0eadb7b6ea42a593de86fc8300ff802a9ad560b4ad0c73fed914c326afc48da178884470495e23eacc3521e0a4dd9b6214
+DIST nagios-plugins-1.4.16.tar.gz 2087089 SHA256 b0caf07e0084e9b7f10fdd71cbd3ebabcd85ad78df64da360b51233b0e73b2bd SHA512 7a1401964b881c3db3e1e3f2a49dcf517ff7214724cc05c3ad629651b7e3eeb823b02abe0c6379d29996ac1e8a1208d918fd12e36cca46c7d36d9b1ebacdb2b3 WHIRLPOOL 3cb3b5d5f7f18e7eb5babde6f7bdd82ba167de4b875825c195d3abf7a14926102940616278769a8127a5c3269d475325145799c1414e6cc22eb208319fd2e879

diff --git a/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.16-fix-ac-macro.patch b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.16-fix-ac-macro.patch
new file mode 100644
index 0000000..6b28655
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.16-fix-ac-macro.patch
@@ -0,0 +1,12 @@
+diff -ur nagios-plugins-1.4.16-old/configure.in nagios-plugins-1.4.16/configure.in
+--- nagios-plugins-1.4.16-old/configure.in	2013-05-14 01:04:01.395679847 +0000
++++ nagios-plugins-1.4.16/configure.in	2013-05-14 01:05:42.705271900 +0000
+@@ -6,7 +6,7 @@
+ 	nagios-plugins.spec])
+ AC_CONFIG_AUX_DIR(build-aux)
+ AM_INIT_AUTOMAKE([1.8.3])
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ AC_CANONICAL_HOST
+ 
+ RELEASE=1

diff --git a/net-analyzer/nagios-plugins/metadata.xml b/net-analyzer/nagios-plugins/metadata.xml
new file mode 100644
index 0000000..1173385
--- /dev/null
+++ b/net-analyzer/nagios-plugins/metadata.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <herd>sysadmin</herd>
+  <use>
+    <flag name='nagios-dns'>
+      Install <pkg>net-dns/bind-tools</pkg> required for monitoring
+      DNS servers. Disabling the flag does not remove any plugin file.
+    </flag>
+    <flag name='nagios-game'>
+      Install <pkg>games-util/qstat</pkg> required for monitoring FPS
+      servers. Disabling the flag does not remove any plugin file.
+    </flag>
+    <flag name='nagios-ntp'>
+      Install <pkg>net-misc/ntp</pkg> required for monitoring NTP
+      servers and drifts. Disabling the flag does not remove any
+      plugin file.
+    </flag>
+    <flag name='nagios-ping'>
+      Install <pkg>net-analyzer/fping</pkg> required for fancy ping
+      monitoring. Disabling the flag does not remove any plugin file.
+    </flag>
+    <flag name='nagios-ssh'>
+      Install <pkg>net-misc/openssh</pkg> required for monitoring SSH
+      servers. Disabling the flag does not remove any plugin file.
+    </flag>
+    <flag name='ups'>
+      Install <pkg>sys-power/nut</pkg> required for monitoring
+      compatible UPS units. Disabling the flag does not remove any
+      plugin file.
+    </flag>
+    <flag name='jabber'>
+      Install the script for sending IM notifications over Jabber with
+      Nagios.
+    </flag>
+    <flag name='snmp' restrict='&gt;=net-analyzer/nagios-plugins-1.4.16-r1'>
+      Install <pkg>dev-perl/Net-SNMP</pkg> required for monitoring
+      SNMP values. Disabling the flag does not remove any plugin file.
+    </flag>
+    <flag name='suid'>
+      Give root privileges to the ICMP, DHCP and IDE S.M.A.R.T. check
+      binaries. This allows them to ignore the access controls that
+      would disallow the nagios user from running the check.
+    </flag>
+    <flag name='sudo'>
+      Install a file to allow the nagios user to execute some commands
+      via <pkg>app-admin/sudo</pkg>, so that the scripts can access
+      devices and features that wouldn't be otherwise allowed by
+      nagios.
+    </flag>
+    <flag name='smart'>
+      Install <pkg>sys-apps/smartmontools</pkg> required for
+      S.M.A.R.T. disk monitoring. Disabling the flag removes the
+      plugin file. This plugin also requires the sudo flag to be
+      enable.
+    </flag>
+  </use>
+</pkgmetadata>
+

diff --git a/net-analyzer/nagios-plugins/nagios-plugins-1.4.16-r3.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-1.4.16-r3.ebuild
new file mode 100644
index 0000000..5d60dc3
--- /dev/null
+++ b/net-analyzer/nagios-plugins/nagios-plugins-1.4.16-r3.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-plugins/nagios-plugins-1.4.16-r3.ebuild,v 1.2 2012/11/21 18:31:35 flameeyes Exp $
+
+EAPI=4
+
+PATCHSET=2
+
+inherit autotools eutils multilib user
+
+DESCRIPTION="Nagios $PV plugins - Pack of plugins to make Nagios work properly"
+HOMEPAGE="http://www.nagios.org/"
+SRC_URI="mirror://sourceforge/nagiosplug/${P}.tar.gz
+	http://dev.gentoo.org/~flameeyes/${PN}/${P}-patches-${PATCHSET}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="+ssl samba mysql postgres ldap snmp nagios-dns nagios-ntp nagios-ping nagios-ssh nagios-game ups ipv6 radius +suid jabber gnutls sudo smart"
+
+DEPEND="ldap? ( >=net-nds/openldap-2.0.25 )
+	mysql? ( virtual/mysql )
+	postgres? ( dev-db/postgresql-base )
+	ssl? (
+		!gnutls? ( >=dev-libs/openssl-0.9.6g )
+		gnutls? ( net-libs/gnutls )
+	)
+	radius? ( >=net-dialup/radiusclient-0.3.2 )"
+
+# tests try to ssh into the box itself
+RESTRICT="test"
+
+RDEPEND="${DEPEND}
+	>=dev-lang/perl-5.6.1-r7
+	samba? ( >=net-fs/samba-2.2.5-r1 )
+	snmp? ( >=dev-perl/Net-SNMP-4.0.1-r1 )
+	mysql? ( dev-perl/DBI
+			 dev-perl/DBD-mysql )
+	nagios-dns? ( >=net-dns/bind-tools-9.2.2_rc1 )
+	nagios-ntp? ( >=net-misc/ntp-4.1.1a )
+	nagios-ping? ( >=net-analyzer/fping-2.4_beta2-r1 )
+	nagios-ssh? ( >=net-misc/openssh-3.5_p1 )
+	ups? ( >=sys-power/nut-1.4 )
+	nagios-game? ( >=games-util/qstat-2.6 )
+	jabber? ( >=dev-perl/Net-Jabber-2.0 )
+	sudo? ( >=app-admin/sudo-1.8.5 )
+	smart? ( sys-apps/smartmontools )"
+
+REQUIRED_USE="smart? ( sudo )"
+
+pkg_setup() {
+	enewgroup nagios
+	enewuser nagios -1 /bin/bash /var/nagios/home nagios
+}
+
+src_prepare() {
+	epatch "${FILESDIR}/${P}-fix-ac-macro.patch"
+	epatch "${WORKDIR}"/patches/*.patch
+
+	eautoreconf
+}
+
+src_configure() {
+	local myconf
+	if use ssl; then
+		myconf+="
+			$(use_with !gnutls openssl /usr)
+			$(use_with gnutls gnutls /usr)"
+	else
+		myconf+=" --without-openssl --without-gnutls"
+	fi
+
+	econf \
+		$(use_with mysql) \
+		$(use_with ipv6) \
+		$(use_with ldap) \
+		$(use_with radius) \
+		$(use_with postgres pgsql /usr) \
+		${myconf} \
+		--libexecdir=/usr/$(get_libdir)/nagios/plugins \
+		--sysconfdir=/etc/nagios
+}
+
+DOCS=( ACKNOWLEDGEMENTS AUTHORS BUGS CODING ChangeLog FAQ NEWS README REQUIREMENTS SUPPORT THANKS )
+
+src_install() {
+	default
+
+	local nagiosplugindir=/usr/$(get_libdir)/nagios/plugins
+
+	if use sudo; then
+		cat - > "${T}"/50${PN} <<EOF
+# we add /bin/false so that we don't risk causing syntax errors if all USE flags
+# are off as we'd end up with an empty set
+Cmnd_Alias NAGIOS_PLUGINS_CMDS = /bin/false $(use smart && echo ", /usr/sbin/smartctl")
+User_Alias NAGIOS_PLUGINS_USERS = nagios, icinga
+
+NAGIOS_PLUGINS_USERS ALL=(root) NOPASSWD: NAGIOS_PLUGINS_CMDS
+EOF
+
+		insinto /etc/sudoers.d
+		doins "${T}"/50${PN}
+	fi
+
+	cd contrib/
+	dodoc *README*
+
+	# remove stuff that is way too broken to fix, or for which the USE
+	# flag has been removed.
+	rm -r tarballs aix \
+		check_compaq_insight.pl *.c *README* \
+		$(usex !jabber nagios_sendim.pl) \
+		$(usex !smart check_smart.pl)
+
+	# fix perl interpreter
+	sed -i -e '1s:/usr/local/bin/perl:/usr/bin/perl:' \
+		"${S}"/contrib/* || die
+
+	exeinto ${nagiosplugindir}/contrib
+	doexe *
+
+	dosym ../utils.sh ${nagiosplugindir}/contrib/utils.sh
+	dosym ../utils.pm ${nagiosplugindir}/contrib/utils.pm
+
+	# enforce permissions/owners (seem to trigger only in some case)
+	chown -R root:nagios "${D}${nagiosplugindir}" || die
+	chmod -R o-rwx "${D}${nagiosplugindir}" || die
+
+	use suid && fperms 04710 ${nagiosplugindir}/check_{icmp,ide_smart,dhcp}
+}
+
+pkg_postinst() {
+	elog "This ebuild has a number of USE flags which determines what nagios is able to monitor."
+	elog "Depending on what you want to monitor with nagios, some or all of these USE"
+	elog "flags need to be set for nagios to function correctly."
+	elog "contrib plugins are installed into /usr/$(get_libdir)/nagios/plugins/contrib"
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-05-14  1:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14  1:29 [gentoo-commits] dev/jmbsvicetto:master commit in: net-analyzer/nagios-plugins/files/, net-analyzer/nagios-plugins/ Jorge Manuel B. S. Vicetto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox