]> gitweb.michael.orlitzky.com - mjo-overlay.git/commitdiff
net-analyzer/pnp4nagios: add gentoo package.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 3 Jan 2015 21:03:50 +0000 (16:03 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 3 Jan 2015 21:03:50 +0000 (16:03 -0500)
net-analyzer/pnp4nagios/Manifest [new file with mode: 0644]
net-analyzer/pnp4nagios/files/98_pnp4nagios.conf [new file with mode: 0644]
net-analyzer/pnp4nagios/files/npcd [new file with mode: 0644]
net-analyzer/pnp4nagios/files/npcd.initd [new file with mode: 0644]
net-analyzer/pnp4nagios/files/pnp4nagios-0.6.14-makefile.patch [new file with mode: 0644]
net-analyzer/pnp4nagios/metadata.xml [new file with mode: 0644]
net-analyzer/pnp4nagios/pnp4nagios-0.6.24.ebuild [new file with mode: 0644]

diff --git a/net-analyzer/pnp4nagios/Manifest b/net-analyzer/pnp4nagios/Manifest
new file mode 100644 (file)
index 0000000..e620875
--- /dev/null
@@ -0,0 +1,30 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+AUX 98_pnp4nagios.conf 1025 SHA256 d4860e09c66e1d20e342a4ab997988ae825e6f4561a9631fd6c608f1c5420a5f SHA512 ac7f4cd92951e856c5af44eb8cfa0c75a867364b6d3d76ed5fb2479631f9ae20587f2d0a09ff4810602665558210232ab41ce6abf53859884a956826cbb5bfc2 WHIRLPOOL d28394eb0f63bd02f71c3ddd6c651f06c69354e2c9fd6fbd0bf65433d4721087078d06aa93df795c80f43a422b35f563b763ed7895891c603d6abbf359a197b1
+AUX npcd 759 SHA256 ea4c71df5c0a6bb410c44b08fc5c5428a3adf8c5daa7a12fe1068eaf71613be5 SHA512 54ccf3da9831b407d7a6b21d3409f7a8c854a32ec6eeda6036997059551bcec52e01b2b63a59e5269fef00c1c859dc856c4c6feb2323ff7fb328dd546c576a80 WHIRLPOOL 4e79bc6ee46a3aad0724488f4fa364b2e6916e30065ff8aed834c2e38929d6fd363210870fb3e4868ee65b0e7073b0d736c954f76415eec37aaa4efe62738454
+AUX npcd.initd 477 SHA256 eb1d5bdf589867136aaefa2f47bd808ef41109860d07d3862fd308585b6d7cff SHA512 c7c0ad6a94820f7327561e779968dc73104bf104bfc3077e952866522e89e7db69c2e289c7e4d61fce978416ef1a8e6d10e3f997fb498ce2157a3c23a869da4d WHIRLPOOL 7ff2db763dc3ee6cf24b0d720e1dd58235681ee1580d44aebbac406631c7c22366d871937eda7d64b4f07448fc28737650e42904aa69a687b7dbf0ab7a0672ab
+AUX pnp4nagios-0.6.14-makefile.patch 1057 SHA256 71fac5f40ba133258754bdd42d503024a7a64da7ae37b96bf6ed20a3c367f2ef SHA512 a67e4b66b0f24db25f9b67d982d99a90c20ad229d404537c9963b2e9f1c5df39a46faa34ecdeb1a9e69b46efd96104d97a39a7e326a01d1c2d09dcc149171602 WHIRLPOOL 7e6725dfef952a97f5d682af955560c88895ae71e5aae9a3bb4842b3696d2f6009e6239c0860991d86fe68d64b4bf7c1e668a5059751cbba4b33850f2bc7584f
+DIST pnp4nagios-0.6.24.tar.gz 2919182 SHA256 87412ef01257c6096aa5c84fdb47db950b851c596e1306180be8ba45401793cf SHA512 7e8c32e0ac69ab747a57e8ab6cc59fddfb63e16598fda9c1e6270d6309ff0885cd1bd0876d05aa1d30bffa76b281d41dc8fbe59e430778bf4d3bdddc4a7bee9f WHIRLPOOL 4f48b406a7d82a4370701ede2625ed2c247bb933a9197d3417c4eb18f18b879465aeb4775e9a0f0300ac1140159df6c6130466b5434c0b33bccb7fff04de86f8
+EBUILD pnp4nagios-0.6.24.ebuild 2090 SHA256 9bbb4b82fee3508615da92f46381d24d759704c0146f787ebe32ee868516603a SHA512 1ba51aedc02b5103ec5ae4e5f42995a285182bd01508559072c4b6d201f4c03f861a11e4ceb7b3418d4be71732b7444823f97c72133d4fe109fa9b2c5c8cc8a2 WHIRLPOOL bb8686244a1a9517bb846c5971f1b4e688ee6ce92c78c3320d67e18151886badfcab5edc04a1ba5b5bb6ec9678f6e20eeac565790e45bf42e08002078890cfd8
+MISC ChangeLog 9540 SHA256 aacad009c732fc64069a73a79dd9af28300f44887342a2c684f0d3927864a3b5 SHA512 7da91e6a91dcec2f808d95def588e5d2e684c08651e81fde52e8b3413c95426f9c70e3b68d86a14ec3be361d12ae43c987b50bfdd014ad0d6be13781836d2e57 WHIRLPOOL 57861add7d44bed281b7d04f33bf75e0926e31a1aef053d5e2fc46cde991ea3ba2e736ee1c6c305dbf384928ef7d0589d79267c8031259ad9812a7da77ed0da4
+MISC metadata.xml 163 SHA256 a8aa48f63dab89c2af1f961029dea0ebf68a618dba59ac4661ea915dc85e18f0 SHA512 1744b806c2ddddbeee4d2b1e23c7f1ccf0d9427f679a65bd22cde617399d3a5bb30aada17ba5b648a3a46d9e1169b9d30ede4551fb8756dffc4e3e9306b199cf WHIRLPOOL b5af95c50999aaf066e6466928866baa34c6425459a580ab0712ba3e3ea518dc37a4082007043307ff169b1f8efe4f6a632d27d016b6fd307bf463cb47b78d55
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0
+
+iQJ8BAEBCgBmBQJUYMOhXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyQ0JDQjFGMzBDQ0UxMjFGNENDNDgxMDdC
+OUQ0RjIzMUJEMTU1OEFCAAoJELnU8jG9FVirNzoP/ApkkSAlXXh28hGQLA1Nf7wv
+WD+3uZ55qU82fHSpiNCuitYN/yUs8RWuH/PN3oOJmtuxPECNhyNQrtoAaQ1si674
+FIY+vOZrAOx2bd08FSqIEJxMDgmhr1GBmYXhUeVjztj+0skPv6SWbHMHPVDyd0yr
+gYBf58aMCSvQl7cC+A3t/TmfuNrL/GlUVEA9QMl75VUmFNFMQ3fm+x0WsgcwJRCJ
+eSCsBlQspPKydJztWGkysavEIzEdVGPmVEWMqGYlEu6OrC+tSBNAbYT06kd0tYU3
+ts3RqHIGgfuqpd/jeGUT91+loh1A/WVrAhf7OYSB2LsdMmAP0w3HAEr1pHbXR3BK
+PekVwtT98EQN3T03Hb/4xLK3eErldve/iUdzIP3i8REbg+TZvcIZAumVGCHwuZJ5
+0y6p3n/YvhN2IglNkHEqjYqxWZcuuGMpa7Nm9qL6kbTy/4oeF7hpekgsPCd69yGx
+JhyBXkqxlmhsBIOmQw4tAy3qhZNgNiloc4J+POrvZJ8ts+Pg+qcgzTGKRidhBxda
+5yousoqaQxXlyxamEmlkEzYUTvrjPfv4i8ObDj6mQrCHi2XZ9A7ZBp3lcsPgRQec
+FtvVAyZ/ewcsRjimQk77fcArAzPYM92Pn39lcrMg1MXXu8zWHkl585R/tZR9t5jM
+WxN3FT+easVElvSRnk9G
+=0tQf
+-----END PGP SIGNATURE-----
diff --git a/net-analyzer/pnp4nagios/files/98_pnp4nagios.conf b/net-analyzer/pnp4nagios/files/98_pnp4nagios.conf
new file mode 100644 (file)
index 0000000..4879779
--- /dev/null
@@ -0,0 +1,22 @@
+<IfDefine PNP>
+        Alias /pnp4nagios /usr/share/pnp/
+        <Directory /usr/share/pnp>
+                AllowOverride AuthConfig
+                Order allow,deny
+                Allow from all
+                <IfModule mod_rewrite.c>
+                        # Turn on URL rewriting
+                        RewriteEngine On
+                        Options FollowSymLinks
+                        # Installation directory
+                        RewriteBase /pnp4nagios
+                        # Protect application and system files from being viewed
+                        RewriteRule ^(application|modules|system) - [F,L]
+                        # Allow any files or directories that exist to be displayed directly
+                        RewriteCond %{REQUEST_FILENAME} !-f
+                        RewriteCond %{REQUEST_FILENAME} !-d
+                        # Rewrite all other URLs to index.php/URL
+                        RewriteRule .* index.php/$0 [PT,L]
+                </IfModule>
+        </Directory>
+</IfDefine>
diff --git a/net-analyzer/pnp4nagios/files/npcd b/net-analyzer/pnp4nagios/files/npcd
new file mode 100644 (file)
index 0000000..9158c18
--- /dev/null
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pnp4nagios/files/npcd,v 1.2 2010/10/20 16:37:27 dertobi123 Exp $
+
+opts="${opts} reload"
+
+depend() {
+       need net
+}
+
+start() {
+       ebegin "Starting npcd"
+       start-stop-daemon --start --exec /usr/bin/npcd \
+               -- -f /etc/pnp/npcd.cfg \
+               -d
+       eend $? "Failed to Start npcd"
+}
+
+stop() {
+       ebegin "Stopping npcd"
+       start-stop-daemon --stop --quiet -n npcd
+       eend $? "Failed to Stop npcd"
+}
+
+reload() {
+        ebegin "Reloading npcd"
+        kill -HUP `pgrep npcd`
+        eend $? "Failed to reload npcd"
+}
+
+restart() {
+       ebegin "Restarting npcd"
+       svc_stop
+       svc_start
+       eend $? "Failed to Restart npcd"
+}
diff --git a/net-analyzer/pnp4nagios/files/npcd.initd b/net-analyzer/pnp4nagios/files/npcd.initd
new file mode 100644 (file)
index 0000000..abf7aeb
--- /dev/null
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pnp4nagios/files/npcd.initd,v 1.1 2012/07/22 21:45:07 idl0r Exp $
+
+extra_started_commands="reload"
+
+command="/usr/bin/npcd"
+command_args="-f /etc/pnp/npcd.cfg -d"
+
+depend() {
+       need net
+}
+
+reload() {
+        ebegin "Reloading npcd"
+        kill -HUP `pgrep npcd`
+        eend $? "Failed to reload npcd"
+}
diff --git a/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.14-makefile.patch b/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.14-makefile.patch
new file mode 100644 (file)
index 0000000..469389d
--- /dev/null
@@ -0,0 +1,32 @@
+diff -Naur pnp4nagios-0.6.14.orig/src/Makefile.in pnp4nagios-0.6.14/src/Makefile.in
+--- pnp4nagios-0.6.14.orig/src/Makefile.in     2011-08-10 17:18:46.000000000 +0200
++++ pnp4nagios-0.6.14/src/Makefile.in  2011-08-10 17:19:51.000000000 +0200
+@@ -83,7 +83,7 @@
+ #
+ ###############################
+ npcd: npcd.c $(NPCDOBJS) $(NPCDHEAD)
+-      $(CC) $(CFLAGS) -o $@ npcd.c $(NPCDOBJS) -lpthread
++      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ npcd.c $(NPCDOBJS) -lpthread
+ ###############################
+ #
+@@ -118,7 +118,6 @@
+ install:
+       $(MAKE) install-basic
+-      $(MAKE) strip-post-install
+ install-unstripped:
+       $(MAKE) install-basic
+diff -Naur pnp4nagios-0.6.14.orig/configure pnp4nagios-0.6.14/configure
+--- pnp4nagios-0.6.14.orig/configure   2011-08-12 09:01:12.000000000 +0200
++++ pnp4nagios-0.6.14/configure        2011-08-12 09:03:32.000000000 +0200
+@@ -5565,7 +5565,7 @@
+               PERFDATA_LOG="${localstatedir}/perfdata.log"
+               PERFDATA_DIR="${localstatedir}/perfdata"
+               PERFDATA_SPOOL_DIR="${localstatedir}/spool"
+-              mandir="\${prefix}/man"
++              mandir="/usr/share/man"
+       ;;
+ esac
diff --git a/net-analyzer/pnp4nagios/metadata.xml b/net-analyzer/pnp4nagios/metadata.xml
new file mode 100644 (file)
index 0000000..d7649f4
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <herd>sysadmin</herd>
+</pkgmetadata>
diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.24.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.24.ebuild
new file mode 100644 (file)
index 0000000..b94e1a1
--- /dev/null
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/pnp4nagios/pnp4nagios-0.6.24.ebuild,v 1.5 2014/11/10 13:51:44 ago Exp $
+
+EAPI=5
+
+inherit depend.apache eutils
+
+DESCRIPTION="A performance data analyzer for nagios"
+HOMEPAGE="http://www.pnp4nagios.org"
+SRC_URI="mirror://sourceforge/${PN}/PNP-0.6/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+KEYWORDS="amd64 ppc ppc64 ~sparc x86"
+
+DEPEND="
+       dev-lang/php[json,simplexml,zlib,xml,filter]
+       >=dev-lang/php-5.3
+       >=net-analyzer/rrdtool-1.2[graph,perl]
+       || ( net-analyzer/nagios-core net-analyzer/icinga net-analyzer/icinga2 )"
+RDEPEND="${DEPEND}
+       virtual/perl-Getopt-Long
+       virtual/perl-Time-HiRes
+       media-fonts/dejavu
+       apache2? ( www-servers/apache[apache2_modules_rewrite] )"
+
+want_apache2
+
+pkg_setup() {
+       depend.apache_pkg_setup
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${PN}-0.6.14-makefile.patch
+}
+
+src_configure() {
+       local var_dir=
+       local user_group=
+
+       if has_version net-analyzer/nagios-core; then
+               var_dir=/var/nagios/
+               user_group=nagios
+       else
+               var_dir=/var/lib/icinga/
+               user_group=icinga
+       fi
+
+       econf \
+               --sysconfdir=/etc/pnp \
+               --datarootdir=/usr/share/pnp \
+               --mandir=/usr/share/man \
+               --with-perfdata-dir=${var_dir}/perfdata \
+               --with-nagios-user=${user_group} \
+               --with-nagios-group=${user_group} \
+               --with-perfdata-logfile=${var_dir}/perfdata.log \
+               --with-perfdata-spool-dir=/var/spool/pnp
+}
+
+src_compile() {
+       # The default target just shows a help
+       emake all
+}
+
+src_install() {
+       emake DESTDIR="${D}" install install-config
+       newinitd "${FILESDIR}"/npcd.initd npcd
+       rm "${D}"/usr/share/pnp/install.php || die
+
+       if use apache2 ; then
+               insinto "${APACHE_MODULES_CONFDIR}"
+               doins "${FILESDIR}"/98_pnp4nagios.conf
+       fi
+
+       # Bug 430358 - CVE-2012-3457
+       find "${D}/etc/pnp" -type f -exec chmod 0640 {} \; || die
+       find "${D}/etc/pnp" -type d -exec chmod 0750 {} \; || die
+}
+
+pkg_postinst() {
+       elog "Please make sure to enable URL rewriting in Apache or any other"
+       elog "webserver you're using, to get pnp4nagios running!"
+}