public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/pnp4nagios/
Date: Sat,  4 Nov 2017 23:40:20 +0000 (UTC)	[thread overview]
Message-ID: <1509838640.8a6c86311831919c79c94f0b4744e05691fe5045.mjo@gentoo> (raw)

commit:     8a6c86311831919c79c94f0b4744e05691fe5045
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Nov  2 16:33:39 2017 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Nov  4 23:37:20 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a6c8631

net-analyzer/pnp4nagios: new revision to fix nagios/icinga "or" dependency.

Previous revisions of pnp4nagios have an "or" dependency on either
Nagios or Icinga,

  || ( net-analyzer/nagios-core net-analyzer/icinga ...

The way "or" dependencies work is that they are considered satisfied
if any elements of the associated group are installed. Thus the above
stanza allows Nagios and Icinga to be swapped out without rebuilding
pnp4nagios. That is incorrect, since later in the ebuild, nagios-
or icinga-specific paths are compiled into pnp4nagios.

The usual solution to that problem is to choose a default package that
satisfies the "one of these" dependency, but to allow the user to
specify one with a USE flag. This new revision adds three USE flags:
icinga, icinga2, and nagios. The "nagios" flag is enabled by default,
and builds pnp4nagios against net-analyzer/nagios. The other flags
build against the associated package.

In the process, the dependency on nagios-3.x was loosened to accept
nagios-4.x as well. The nagios-3.x series has been end-of-life'd, and
has multiple open security bugs.

Bug: https://bugs.gentoo.org/628086
Bug: https://bugs.gentoo.org/629380
Bug: https://bugs.gentoo.org/636234
Closes: https://bugs.gentoo.org/600424
Package-Manager: Portage-2.3.8, Repoman-2.3.3

 net-analyzer/pnp4nagios/metadata.xml               | 16 ++++++++++++++
 ...s-0.6.26.ebuild => pnp4nagios-0.6.26-r1.ebuild} | 25 ++++++++++++++--------
 2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/net-analyzer/pnp4nagios/metadata.xml b/net-analyzer/pnp4nagios/metadata.xml
index 379fdde3e07..d5799ab49c9 100644
--- a/net-analyzer/pnp4nagios/metadata.xml
+++ b/net-analyzer/pnp4nagios/metadata.xml
@@ -5,7 +5,23 @@
     <email>sysadmin@gentoo.org</email>
     <name>Gentoo Sysadmin Project</name>
   </maintainer>
+
+  <use>
+    <flag name="nagios">
+      Build against <pkg>net-analyzer/nagios-core</pkg> (the default)
+    </flag>
+    <flag name="icinga">
+      Build against <pkg>net-analyzer/icinga</pkg> instead of
+      <pkg>net-analyzer/nagios-core</pkg>
+    </flag>
+    <flag name="icinga2">
+      Build against <pkg>net-analyzer/icinga2</pkg> instead of
+      <pkg>net-analyzer/nagios-core</pkg>
+    </flag>
+  </use>
+
   <upstream>
     <remote-id type="sourceforge">pnp4nagios</remote-id>
+    <remote-id type="github">lingej/pnp4nagios</remote-id>
   </upstream>
 </pkgmetadata>

diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r1.ebuild
similarity index 84%
rename from net-analyzer/pnp4nagios/pnp4nagios-0.6.26.ebuild
rename to net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r1.ebuild
index 06416fc0d98..c15a8c98de6 100644
--- a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26.ebuild
+++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r1.ebuild
@@ -9,14 +9,20 @@ SRC_URI="mirror://sourceforge/${PN}/PNP-0.6/${P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="apache2"
+IUSE="apache2 icinga icinga2 +nagios"
 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
 
-# A lot of things (sync mode, for one) are broken with nagios-4.x.
+REQUIRED_USE="^^ ( icinga icinga2 nagios )"
+
+# Some things (sync mode, for one) are broken with nagios-4.x, but since
+# nagios-3.x has been end-of-life'd, we don't have much choice here but
+# to accept it.
 DEPEND="
 	dev-lang/php:*[filter,gd,json,simplexml,xml,zlib]
 	>=net-analyzer/rrdtool-1.2[graph,perl]
-	|| ( <net-analyzer/nagios-core-4 net-analyzer/icinga net-analyzer/icinga2 )"
+	icinga? ( net-analyzer/icinga )
+	icinga2? ( net-analyzer/icinga2 )
+	nagios? ( net-analyzer/nagios-core )"
 
 # A list of modules used in our Apache config file.
 APACHE_MODS="apache2_modules_alias,"       # "Alias" directive
@@ -34,15 +40,16 @@ PATCHES=( "${FILESDIR}/${PN}-0.6.14-makefile.patch" )
 src_configure() {
 	local var_dir user_group
 
-	if has_version net-analyzer/nagios-core; then
-		var_dir=/var/nagios
-		user_group=nagios
-	elif has_version net-analyzer/icinga2; then
+	if use icinga; then
+		var_dir=/var/lib/icinga
+		user_group=icinga
+	elif use icinga2; then
 		var_dir=/var/lib/icinga2
 		user_group=icinga
 	else
-		var_dir=/var/lib/icinga
-		user_group=icinga
+		# Thanks to REQUIRED_USE, "use nagios" is the only other case.
+		var_dir=/var/nagios
+		user_group=nagios
 	fi
 
 	econf \


             reply	other threads:[~2017-11-04 23:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-04 23:40 Michael Orlitzky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-21 21:19 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/pnp4nagios/ Sam James
2023-11-04 13:35 Sam James
2023-11-04 12:25 Sam James
2023-11-04 10:49 Sam James
2023-09-23 15:07 Michael Orlitzky
2023-09-23 15:07 Michael Orlitzky
2022-12-23 13:48 Arthur Zamarin
2022-12-23 13:48 Arthur Zamarin
2022-12-23 12:17 Sam James
2022-08-30 10:06 Michael Orlitzky
2022-08-29 12:38 Jakov Smolić
2022-08-12 14:27 Sam James
2022-08-03 16:12 Arthur Zamarin
2020-03-17  7:32 Matthew Thode
2020-02-17 23:37 Matthew Thode
2018-06-19 22:24 Michael Orlitzky
2018-03-19 23:24 Sergei Trofimovich
2018-03-19 22:39 Sergei Trofimovich
2017-11-29 18:52 Thomas Deutschmann
2017-11-29 13:38 Agostino Sarubbo
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2017-11-04 23:40 Michael Orlitzky
2016-11-30 23:44 Patrice Clement
2016-03-15 11:08 Agostino Sarubbo
2016-02-06 23:31 Matt Thode
2016-02-01 14:45 Matt Thode
2015-12-16 22:11 Matt Thode

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509838640.8a6c86311831919c79c94f0b4744e05691fe5045.mjo@gentoo \
    --to=mjo@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox