diff --git a/net-analyzer/ndoutils/Manifest b/net-analyzer/ndoutils/Manifest new file mode 100644 index 0000000000000000000000000000000000000000..49d46a73732de3b2fb5990d39bf59bca67b1901b --- /dev/null +++ b/net-analyzer/ndoutils/Manifest @@ -0,0 +1,2 @@ +DIST ndoutils-1.5.2.tar.gz 2142271 SHA256 fe80b5d23291b780741f223efe807f690e3414e706844e993bc40913bd09c7f7 SHA512 3aac9917b8a557f8a7a3cd3cc5460e27617cdf0aab6f007da96a0ffecc4b3bbf3b2c08ef57d7daab8f4b6c5ff172b7d11ef74c84b3e84ae67460731209582ca1 WHIRLPOOL b49a4cc2c78010534cc2219b7cec14866a9bf72595e407eecf8b49487e1f4046132dc309d8a706b0eb688509d6a2983edb68a777da7e1ae019344a8dfac4feb1 +EBUILD ndoutils-1.5.2.ebuild 1214 SHA256 a8d977e80db98e16ab0028bbff120f38bcbe4b62dce407340e42bba8ac58edc8 SHA512 a455f7d14d216e16c8644e79d00ee7e17e698f62236ef2dc4bad5faaf62d7abb7369b78cd957630ec87b2f5f3766af76dfd260f93d22f715a65c5c556ebf2dc7 WHIRLPOOL 28481354c7fcdb3aabab492a68d9cacdcbbd4939b97fc3094987c0a1aa8462539e0aca6f40506f19f269331cef29bc29340992a21f2e8a213a7beca3d8cc25ff diff --git a/net-analyzer/ndoutils/files/ndo2db.init-nagios3 b/net-analyzer/ndoutils/files/ndo2db.init-nagios3 new file mode 100644 index 0000000000000000000000000000000000000000..eab5ac378c0a0fc6d0f3ec780f57cc35caff2df5 --- /dev/null +++ b/net-analyzer/ndoutils/files/ndo2db.init-nagios3 @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depends() { + before nagios + need mysql +} + +start() { + ebegin "Starting ndo2db" + if [ -S /var/nagios/ndo.sock ] ; then + rm -f /var/nagios/ndo.sock + fi + start-stop-daemon --start --quiet --exec /usr/bin/ndo2db \ + -- -c /etc/nagios/ndo2db.cfg + eend $? +} + +stop() { + ebegin "Stopping ndo2db" + start-stop-daemon --stop --quiet --exec /usr/bin/ndo2db + eend $? +} diff --git a/net-analyzer/ndoutils/files/ndoutils-1.4_beta9-asprintf.patch b/net-analyzer/ndoutils/files/ndoutils-1.4_beta9-asprintf.patch new file mode 100644 index 0000000000000000000000000000000000000000..146132c21de39b81bb10372ab4190628088cc562 --- /dev/null +++ b/net-analyzer/ndoutils/files/ndoutils-1.4_beta9-asprintf.patch @@ -0,0 +1,10 @@ +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -9,6 +9,7 @@ + #ifndef _CONFIG_H + #define _CONFIG_H + ++#define _GNU_SOURCE + #include + #include + diff --git a/net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch b/net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch new file mode 100644 index 0000000000000000000000000000000000000000..61694baee9e311a6a3196f680241b6184e000334 --- /dev/null +++ b/net-analyzer/ndoutils/files/ndoutils-2.0.0-sleep.patch @@ -0,0 +1,10 @@ +--- a/src/queue.c ++++ b/src/queue.c +@@ -8,6 +8,7 @@ + #include "../include/queue.h" + #include + #include ++#include /* sleep() */ + + #define RETRY_LOG_INTERVAL 600 /* Seconds */ + #define MAX_RETRIES 20 /* Max number of times to retry sending message */ diff --git a/net-analyzer/ndoutils/ndoutils-1.5.2.ebuild b/net-analyzer/ndoutils/ndoutils-1.5.2.ebuild new file mode 100644 index 0000000000000000000000000000000000000000..dcb3a2470102a6432ced01a866a8da4f613f5c47 --- /dev/null +++ b/net-analyzer/ndoutils/ndoutils-1.5.2.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +inherit eutils user + +DESCRIPTION="Nagios addon to store Nagios data in a MySQL database" +HOMEPAGE="http://www.nagios.org" +SRC_URI="mirror://sourceforge/nagios/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~ppc" + +DEPEND=" + dev-perl/DBD-mysql + dev-perl/DBI + virtual/mysql +" +RDEPEND=" + ${DEPEND} + >=net-analyzer/nagios-core-3.0 +" + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +src_prepare() { + epatch \ + "${FILESDIR}"/${PN}-1.4_beta9-asprintf.patch \ + "${FILESDIR}"/${PN}-2.0.0-sleep.patch +} + +src_configure() { + econf \ + --sysconfdir=/etc/nagios \ + --enable-mysql +} + +DOCS=( + 'docs/NDOUTILS DB Model.pdf' + 'docs/NDOUtils Documentation.pdf' + Changelog + README + REQUIREMENTS + TODO + UPGRADING +) + +src_install() { + default + emake DESTDIR="${D}" install-config + + newinitd "${FILESDIR}"/ndo2db.init-nagios3 ndo2db +} + +pkg_postinst() { + elog "To include NDO in your Nagios setup you'll need to activate the NDO broker module" + elog "in /etc/nagios/nagios.cfg:" + elog "\tbroker_module=/usr/bin/ndomod-3x.o config_file=/etc/nagios/ndomod.cfg" +}