]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-analyzer/pnp4nagios/pnp4nagios-0.6.24.ebuild
net-analyzer/pnp4nagios: add gentoo package.
[mjo-overlay.git] / net-analyzer / pnp4nagios / pnp4nagios-0.6.24.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/pnp4nagios/pnp4nagios-0.6.24.ebuild,v 1.5 2014/11/10 13:51:44 ago Exp $
4
5 EAPI=5
6
7 inherit depend.apache eutils
8
9 DESCRIPTION="A performance data analyzer for nagios"
10 HOMEPAGE="http://www.pnp4nagios.org"
11 SRC_URI="mirror://sourceforge/${PN}/PNP-0.6/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 IUSE=""
16 KEYWORDS="amd64 ppc ppc64 ~sparc x86"
17
18 DEPEND="
19 dev-lang/php[json,simplexml,zlib,xml,filter]
20 >=dev-lang/php-5.3
21 >=net-analyzer/rrdtool-1.2[graph,perl]
22 || ( net-analyzer/nagios-core net-analyzer/icinga net-analyzer/icinga2 )"
23 RDEPEND="${DEPEND}
24 virtual/perl-Getopt-Long
25 virtual/perl-Time-HiRes
26 media-fonts/dejavu
27 apache2? ( www-servers/apache[apache2_modules_rewrite] )"
28
29 want_apache2
30
31 pkg_setup() {
32 depend.apache_pkg_setup
33 }
34
35 src_prepare() {
36 epatch "${FILESDIR}"/${PN}-0.6.14-makefile.patch
37 }
38
39 src_configure() {
40 local var_dir=
41 local user_group=
42
43 if has_version net-analyzer/nagios-core; then
44 var_dir=/var/nagios/
45 user_group=nagios
46 else
47 var_dir=/var/lib/icinga/
48 user_group=icinga
49 fi
50
51 econf \
52 --sysconfdir=/etc/pnp \
53 --datarootdir=/usr/share/pnp \
54 --mandir=/usr/share/man \
55 --with-perfdata-dir=${var_dir}/perfdata \
56 --with-nagios-user=${user_group} \
57 --with-nagios-group=${user_group} \
58 --with-perfdata-logfile=${var_dir}/perfdata.log \
59 --with-perfdata-spool-dir=/var/spool/pnp
60 }
61
62 src_compile() {
63 # The default target just shows a help
64 emake all
65 }
66
67 src_install() {
68 emake DESTDIR="${D}" install install-config
69 newinitd "${FILESDIR}"/npcd.initd npcd
70 rm "${D}"/usr/share/pnp/install.php || die
71
72 if use apache2 ; then
73 insinto "${APACHE_MODULES_CONFDIR}"
74 doins "${FILESDIR}"/98_pnp4nagios.conf
75 fi
76
77 # Bug 430358 - CVE-2012-3457
78 find "${D}/etc/pnp" -type f -exec chmod 0640 {} \; || die
79 find "${D}/etc/pnp" -type d -exec chmod 0750 {} \; || die
80 }
81
82 pkg_postinst() {
83 elog "Please make sure to enable URL rewriting in Apache or any other"
84 elog "webserver you're using, to get pnp4nagios running!"
85 }