1 |
commit: 982a97b2acad008069b9cfb6c21574cc97ec3654 |
2 |
Author: Louis Sautier <sautier.louis <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Nov 28 16:04:51 2016 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 30 23:42:29 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=982a97b2 |
7 |
|
8 |
net-analyzer/pnp4nagios: remove dep. on outdated apache eclass, various fixes. |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
Closes: https://github.com/gentoo/gentoo/pull/2943 |
12 |
|
13 |
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org> |
14 |
|
15 |
.../pnp4nagios/pnp4nagios-0.6.25-r3.ebuild | 56 ++++++++++------------ |
16 |
1 file changed, 24 insertions(+), 32 deletions(-) |
17 |
|
18 |
diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.25-r3.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.25-r3.ebuild |
19 |
index 974810a..ee5fadd 100644 |
20 |
--- a/net-analyzer/pnp4nagios/pnp4nagios-0.6.25-r3.ebuild |
21 |
+++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.25-r3.ebuild |
22 |
@@ -4,15 +4,13 @@ |
23 |
|
24 |
EAPI=6 |
25 |
|
26 |
-inherit depend.apache eutils |
27 |
- |
28 |
DESCRIPTION="A performance data analyzer for nagios" |
29 |
HOMEPAGE="http://www.pnp4nagios.org/" |
30 |
SRC_URI="mirror://sourceforge/${PN}/PNP-0.6/${P}.tar.gz" |
31 |
|
32 |
LICENSE="GPL-2" |
33 |
SLOT="0" |
34 |
-IUSE="" |
35 |
+IUSE="apache2" |
36 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" |
37 |
|
38 |
# A lot of things (sync mode, for one) are broken with nagios-4.x. |
39 |
@@ -37,38 +35,28 @@ PATCHES=( |
40 |
"${FILESDIR}/${P}-rrdtool-0.6.0-support.patch" |
41 |
) |
42 |
|
43 |
-# There is no want_apache2_4, but we needed to specify that manually |
44 |
-# anyway to be able to include the list of modules. |
45 |
-want_apache2 |
46 |
- |
47 |
-pkg_setup() { |
48 |
- depend.apache_pkg_setup |
49 |
-} |
50 |
- |
51 |
src_configure() { |
52 |
- local var_dir= |
53 |
- local user_group= |
54 |
+ local var_dir user_group |
55 |
|
56 |
if has_version net-analyzer/nagios-core; then |
57 |
- var_dir=/var/nagios/ |
58 |
+ var_dir=/var/nagios |
59 |
user_group=nagios |
60 |
elif has_version net-analyzer/icinga2; then |
61 |
- var_dir=/var/lib/icinga2/ |
62 |
+ var_dir=/var/lib/icinga2 |
63 |
user_group=icinga |
64 |
else |
65 |
- var_dir=/var/lib/icinga/ |
66 |
+ var_dir=/var/lib/icinga |
67 |
user_group=icinga |
68 |
fi |
69 |
|
70 |
econf \ |
71 |
- --sysconfdir=/etc/pnp \ |
72 |
- --datarootdir=/usr/share/pnp \ |
73 |
- --mandir=/usr/share/man \ |
74 |
- --with-perfdata-dir=${var_dir}/perfdata \ |
75 |
+ --sysconfdir="${EPREFIX}"/etc/pnp \ |
76 |
+ --datarootdir="${EPREFIX}"/usr/share/pnp \ |
77 |
+ --with-perfdata-dir="${EPREFIX}"${var_dir}/perfdata \ |
78 |
--with-nagios-user=${user_group} \ |
79 |
--with-nagios-group=${user_group} \ |
80 |
- --with-perfdata-logfile=${var_dir}/perfdata.log \ |
81 |
- --with-perfdata-spool-dir=/var/spool/pnp |
82 |
+ --with-perfdata-logfile="${EPREFIX}"${var_dir}/perfdata.log \ |
83 |
+ --with-perfdata-spool-dir="${EPREFIX}"/var/spool/pnp |
84 |
} |
85 |
|
86 |
src_compile() { |
87 |
@@ -78,9 +66,10 @@ src_compile() { |
88 |
|
89 |
src_install() { |
90 |
emake DESTDIR="${D}" install install-config |
91 |
+ einstalldocs |
92 |
newinitd "${FILESDIR}"/npcd.initd npcd |
93 |
- rm "${D}/usr/share/pnp/install.php" || \ |
94 |
- die "unable to remove ${D}/usr/share/pnp/install.php" |
95 |
+ rm "${ED%/}/usr/share/pnp/install.php" || \ |
96 |
+ die "unable to remove ${ED%/}/usr/share/pnp/install.php" |
97 |
|
98 |
if use apache2 ; then |
99 |
insinto "${APACHE_MODULES_CONFDIR}" |
100 |
@@ -88,21 +77,24 @@ src_install() { |
101 |
|
102 |
# Allow the apache user to read our config files. This same |
103 |
# approach is used in net-analyzer/nagios-core. |
104 |
- chgrp -R apache "${D}/etc/pnp" \ |
105 |
- || die "failed to change group of ${ROOT}etc/pnp" |
106 |
+ chgrp -R apache "${ED%/}/etc/pnp" \ |
107 |
+ || die "failed to change group of ${ED%/}/etc/pnp" |
108 |
fi |
109 |
|
110 |
# Bug 430358 - CVE-2012-3457 |
111 |
- find "${D}/etc/pnp" -type f -exec chmod 0640 '{}' + || \ |
112 |
- die "unable to set file permissions under ${D}/etc/pnp" |
113 |
- |
114 |
- find "${D}/etc/pnp" -type d -exec chmod 0750 '{}' + || \ |
115 |
- die "unable to set directory permissions under ${D}/etc/pnp" |
116 |
+ local f |
117 |
+ while IFS="" read -d $'\0' -r f ; do |
118 |
+ chmod 0640 "${f}" || die |
119 |
+ done < <(find "${ED%/}/etc/pnp" -type f) |
120 |
+ |
121 |
+ while IFS="" read -d $'\0' -r f ; do |
122 |
+ chmod 0750 "${f}" || die |
123 |
+ done < <(find "${ED%/}/etc/pnp" -type d) |
124 |
} |
125 |
|
126 |
pkg_postinst() { |
127 |
elog "To enable the pnp4nagios web front-end, please visit" |
128 |
- elog "${ROOT}etc/conf.d/apache2 and add \"-D PNP -D PHP5\"" |
129 |
+ elog "${EROOT%/}/etc/conf.d/apache2 and add \"-D PNP -D PHP5\"" |
130 |
elog "to APACHE2_OPTS. Then pnp4nagios will be available at," |
131 |
elog |
132 |
elog " http://localhost/pnp4nagios" |