]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-analyzer/pnp4nagios/pnp4nagios-0.6.24-r1.ebuild
Manifest bump.
[mjo-overlay.git] / net-analyzer / pnp4nagios / pnp4nagios-0.6.24-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
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
24 # A list of modules used in our Apache config file.
25 APACHE_MODS="apache2_modules_alias," # "Alias" directive
26 APACHE_MODS+="apache2_modules_authz_core," # "Require" directive
27 APACHE_MODS+="apache2_modules_rewrite" # "RewriteEngine" and friends
28
29 RDEPEND="${DEPEND}
30 virtual/perl-Getopt-Long
31 virtual/perl-Time-HiRes
32 media-fonts/dejavu
33 apache2? ( >=www-servers/apache-2.4[${APACHE_MODS}] )"
34
35 # There is no want_apache2_4, but we needed to specify that manually
36 # anyway to be able to include the list of modules.
37 want_apache2
38
39 pkg_setup() {
40 depend.apache_pkg_setup
41 }
42
43 src_prepare() {
44 epatch "${FILESDIR}/${PN}-0.6.14-makefile.patch"
45 }
46
47 src_configure() {
48 local var_dir=
49 local user_group=
50
51 if has_version net-analyzer/nagios-core; then
52 var_dir=/var/nagios/
53 user_group=nagios
54 else
55 var_dir=/var/lib/icinga/
56 user_group=icinga
57 fi
58
59 econf \
60 --sysconfdir=/etc/pnp \
61 --datarootdir=/usr/share/pnp \
62 --mandir=/usr/share/man \
63 --with-perfdata-dir=${var_dir}/perfdata \
64 --with-nagios-user=${user_group} \
65 --with-nagios-group=${user_group} \
66 --with-perfdata-logfile=${var_dir}/perfdata.log \
67 --with-perfdata-spool-dir=/var/spool/pnp
68 }
69
70 src_compile() {
71 # The default target just shows a help
72 emake all
73 }
74
75 src_install() {
76 emake DESTDIR="${D}" install install-config
77 newinitd "${FILESDIR}"/npcd.initd npcd
78 rm "${D}/usr/share/pnp/install.php" || \
79 die "unable to remove ${D}/usr/share/pnp/install.php"
80
81 if use apache2 ; then
82 insinto "${APACHE_MODULES_CONFDIR}"
83 newins "${FILESDIR}"/98_pnp4nagios-2.4.conf 98_pnp4nagios.conf
84 fi
85
86 # Bug 430358 - CVE-2012-3457
87 find "${D}/etc/pnp" -type f -exec chmod 0640 '{}' + || \
88 die "unable to set file permissions under ${D}/etc/pnp"
89
90 find "${D}/etc/pnp" -type d -exec chmod 0750 '{}' + || \
91 die "unable to set directory permissions under ${D}/etc/pnp"
92 }
93
94 pkg_postinst() {
95 elog "Please make sure to enable URL rewriting in Apache or any other"
96 elog "webserver you're using, to get pnp4nagios running!"
97 }