1 |
commit: 8a6c86311831919c79c94f0b4744e05691fe5045 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 2 16:33:39 2017 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 4 23:37:20 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a6c8631 |
7 |
|
8 |
net-analyzer/pnp4nagios: new revision to fix nagios/icinga "or" dependency. |
9 |
|
10 |
Previous revisions of pnp4nagios have an "or" dependency on either |
11 |
Nagios or Icinga, |
12 |
|
13 |
|| ( net-analyzer/nagios-core net-analyzer/icinga ... |
14 |
|
15 |
The way "or" dependencies work is that they are considered satisfied |
16 |
if any elements of the associated group are installed. Thus the above |
17 |
stanza allows Nagios and Icinga to be swapped out without rebuilding |
18 |
pnp4nagios. That is incorrect, since later in the ebuild, nagios- |
19 |
or icinga-specific paths are compiled into pnp4nagios. |
20 |
|
21 |
The usual solution to that problem is to choose a default package that |
22 |
satisfies the "one of these" dependency, but to allow the user to |
23 |
specify one with a USE flag. This new revision adds three USE flags: |
24 |
icinga, icinga2, and nagios. The "nagios" flag is enabled by default, |
25 |
and builds pnp4nagios against net-analyzer/nagios. The other flags |
26 |
build against the associated package. |
27 |
|
28 |
In the process, the dependency on nagios-3.x was loosened to accept |
29 |
nagios-4.x as well. The nagios-3.x series has been end-of-life'd, and |
30 |
has multiple open security bugs. |
31 |
|
32 |
Bug: https://bugs.gentoo.org/628086 |
33 |
Bug: https://bugs.gentoo.org/629380 |
34 |
Bug: https://bugs.gentoo.org/636234 |
35 |
Closes: https://bugs.gentoo.org/600424 |
36 |
Package-Manager: Portage-2.3.8, Repoman-2.3.3 |
37 |
|
38 |
net-analyzer/pnp4nagios/metadata.xml | 16 ++++++++++++++ |
39 |
...s-0.6.26.ebuild => pnp4nagios-0.6.26-r1.ebuild} | 25 ++++++++++++++-------- |
40 |
2 files changed, 32 insertions(+), 9 deletions(-) |
41 |
|
42 |
diff --git a/net-analyzer/pnp4nagios/metadata.xml b/net-analyzer/pnp4nagios/metadata.xml |
43 |
index 379fdde3e07..d5799ab49c9 100644 |
44 |
--- a/net-analyzer/pnp4nagios/metadata.xml |
45 |
+++ b/net-analyzer/pnp4nagios/metadata.xml |
46 |
@@ -5,7 +5,23 @@ |
47 |
<email>sysadmin@g.o</email> |
48 |
<name>Gentoo Sysadmin Project</name> |
49 |
</maintainer> |
50 |
+ |
51 |
+ <use> |
52 |
+ <flag name="nagios"> |
53 |
+ Build against <pkg>net-analyzer/nagios-core</pkg> (the default) |
54 |
+ </flag> |
55 |
+ <flag name="icinga"> |
56 |
+ Build against <pkg>net-analyzer/icinga</pkg> instead of |
57 |
+ <pkg>net-analyzer/nagios-core</pkg> |
58 |
+ </flag> |
59 |
+ <flag name="icinga2"> |
60 |
+ Build against <pkg>net-analyzer/icinga2</pkg> instead of |
61 |
+ <pkg>net-analyzer/nagios-core</pkg> |
62 |
+ </flag> |
63 |
+ </use> |
64 |
+ |
65 |
<upstream> |
66 |
<remote-id type="sourceforge">pnp4nagios</remote-id> |
67 |
+ <remote-id type="github">lingej/pnp4nagios</remote-id> |
68 |
</upstream> |
69 |
</pkgmetadata> |
70 |
|
71 |
diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r1.ebuild |
72 |
similarity index 84% |
73 |
rename from net-analyzer/pnp4nagios/pnp4nagios-0.6.26.ebuild |
74 |
rename to net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r1.ebuild |
75 |
index 06416fc0d98..c15a8c98de6 100644 |
76 |
--- a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26.ebuild |
77 |
+++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r1.ebuild |
78 |
@@ -9,14 +9,20 @@ SRC_URI="mirror://sourceforge/${PN}/PNP-0.6/${P}.tar.gz" |
79 |
|
80 |
LICENSE="GPL-2" |
81 |
SLOT="0" |
82 |
-IUSE="apache2" |
83 |
+IUSE="apache2 icinga icinga2 +nagios" |
84 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" |
85 |
|
86 |
-# A lot of things (sync mode, for one) are broken with nagios-4.x. |
87 |
+REQUIRED_USE="^^ ( icinga icinga2 nagios )" |
88 |
+ |
89 |
+# Some things (sync mode, for one) are broken with nagios-4.x, but since |
90 |
+# nagios-3.x has been end-of-life'd, we don't have much choice here but |
91 |
+# to accept it. |
92 |
DEPEND=" |
93 |
dev-lang/php:*[filter,gd,json,simplexml,xml,zlib] |
94 |
>=net-analyzer/rrdtool-1.2[graph,perl] |
95 |
- || ( <net-analyzer/nagios-core-4 net-analyzer/icinga net-analyzer/icinga2 )" |
96 |
+ icinga? ( net-analyzer/icinga ) |
97 |
+ icinga2? ( net-analyzer/icinga2 ) |
98 |
+ nagios? ( net-analyzer/nagios-core )" |
99 |
|
100 |
# A list of modules used in our Apache config file. |
101 |
APACHE_MODS="apache2_modules_alias," # "Alias" directive |
102 |
@@ -34,15 +40,16 @@ PATCHES=( "${FILESDIR}/${PN}-0.6.14-makefile.patch" ) |
103 |
src_configure() { |
104 |
local var_dir user_group |
105 |
|
106 |
- if has_version net-analyzer/nagios-core; then |
107 |
- var_dir=/var/nagios |
108 |
- user_group=nagios |
109 |
- elif has_version net-analyzer/icinga2; then |
110 |
+ if use icinga; then |
111 |
+ var_dir=/var/lib/icinga |
112 |
+ user_group=icinga |
113 |
+ elif use icinga2; then |
114 |
var_dir=/var/lib/icinga2 |
115 |
user_group=icinga |
116 |
else |
117 |
- var_dir=/var/lib/icinga |
118 |
- user_group=icinga |
119 |
+ # Thanks to REQUIRED_USE, "use nagios" is the only other case. |
120 |
+ var_dir=/var/nagios |
121 |
+ user_group=nagios |
122 |
fi |
123 |
|
124 |
econf \ |