public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-plugins/files/, net-analyzer/nagios-plugins/
@ 2017-10-27 12:45 Michael Orlitzky
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Orlitzky @ 2017-10-27 12:45 UTC (permalink / raw
  To: gentoo-commits

commit:     20d288e5098552ca42a508f998eed6f2e5229e87
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 27 12:37:56 2017 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 12:37:56 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20d288e5

net-analyzer/nagios-plugins: new revision to fix build failure with MariaDB.

The latest -r2 adds a patch (which I've sent upstream) to fix a build
failure against newer versions of MariaDB.

Bug: https://bugs.gentoo.org/633548
Bug: https://bugs.gentoo.org/635106
Package-Manager: Portage-2.3.8, Repoman-2.3.3

 .../files/define-own-mysql-port-constant.patch     | 100 +++++++++++++++++++++
 ....1-r1.ebuild => nagios-plugins-2.2.1-r2.ebuild} |   2 +
 2 files changed, 102 insertions(+)

diff --git a/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch b/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch
new file mode 100644
index 00000000000..67bc65cad88
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch
@@ -0,0 +1,100 @@
+From 43ff2e8607c0b7095c2a4dcab6e466bc67e2e2ff Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Thu, 26 Oct 2017 15:01:17 -0400
+Subject: [PATCH 1/3] plugins/check_mysql*.c: define our own default MySQL
+ port.
+
+The MYSQL_PORT constant used to be defined in mysql.h, and was used as
+the default port in the two plugins check_mysql and check_mysql_query.
+Now that mysql.h no longer defines that constant, our plugins fail to
+build against newer versions of MySQL and MariaDB.
+
+Since MYSQL_PORT used the "default port" on the local system, it
+actually was not the best choice as the default for the check plugins:
+when monitoring remote MySQL servers, the usual default of 3306 is
+more likely to be correct than whatever the local server happens to be
+listening on.
+
+As a result, we fix the issue by defining our own constant, called
+CHECK_PORT_DEFAULT, as "3306" at the top of both check_mysql.c and
+check_mysql_query.c. The existing uses of MYSQL_PORT have been changed
+to use the new CHECK_PORT_DEFAULT.
+
+This change is backwards-incompatible: any users who compiled in a
+MYSQL_PORT other than 3306 and who were running their checks on the
+same server as the database will now need to specify that port
+explicitly.
+
+Closes: https://github.com/nagios-plugins/nagios-plugins/issues/288
+---
+ plugins/check_mysql.c       | 7 +++++--
+ plugins/check_mysql_query.c | 7 +++++--
+ 2 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
+index 83f89c85..c0b61292 100644
+--- a/plugins/check_mysql.c
++++ b/plugins/check_mysql.c
+@@ -36,6 +36,9 @@ const char *email = "devel@nagios-plugins.org";
+ 
+ #define SLAVERESULTSIZE 70
+ 
++/* The default port that MySQL servers listen on. */
++#define CHECK_PORT_DEFAULT 3306
++
+ #include "common.h"
+ #include "utils.h"
+ #include "utils_base.h"
+@@ -58,7 +61,7 @@ char *ciphers = NULL;
+ bool ssl = false;
+ char *opt_file = NULL;
+ char *opt_group = NULL;
+-unsigned int db_port = MYSQL_PORT;
++unsigned int db_port = CHECK_PORT_DEFAULT;
+ int check_slave = 0, warn_sec = 0, crit_sec = 0;
+ int ignore_auth = 0;
+ int verbose = 0;
+@@ -505,7 +508,7 @@ void
+ print_help (void)
+ {
+ 	char *myport;
+-	xasprintf (&myport, "%d", MYSQL_PORT);
++	xasprintf (&myport, "%d", CHECK_PORT_DEFAULT);
+ 
+ 	print_revision (progname, NP_VERSION);
+ 
+diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
+index 436e0685..e9c3acfb 100644
+--- a/plugins/check_mysql_query.c
++++ b/plugins/check_mysql_query.c
+@@ -33,6 +33,9 @@ const char *progname = "check_mysql_query";
+ const char *copyright = "1999-2014";
+ const char *email = "devel@nagios-plugins.org";
+ 
++/* The default port that MySQL servers listen on. */
++#define CHECK_PORT_DEFAULT 3306
++
+ #include "common.h"
+ #include "utils.h"
+ #include "utils_base.h"
+@@ -48,7 +51,7 @@ char *db_pass = NULL;
+ char *db = NULL;
+ char *opt_file = NULL;
+ char *opt_group = NULL;
+-unsigned int db_port = MYSQL_PORT;
++unsigned int db_port = CHECK_PORT_DEFAULT;
+ 
+ int process_arguments (int, char **);
+ int validate_arguments (void);
+@@ -300,7 +303,7 @@ void
+ print_help (void)
+ {
+ 	char *myport;
+-	xasprintf (&myport, "%d", MYSQL_PORT);
++	xasprintf (&myport, "%d", CHECK_PORT_DEFAULT);
+ 
+ 	print_revision (progname, NP_VERSION);
+ 
+-- 
+2.13.6
+

diff --git a/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r1.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild
similarity index 97%
rename from net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r1.ebuild
rename to net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild
index c86bad6d681..7cdc0f87996 100644
--- a/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r1.ebuild
+++ b/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild
@@ -63,6 +63,8 @@ DOCS=(
 	THANKS
 )
 
+PATCHES=( "${FILESDIR}/define-own-mysql-port-constant.patch" )
+
 src_prepare() {
 	default
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-plugins/files/, net-analyzer/nagios-plugins/
@ 2024-02-18 22:49 Michael Orlitzky
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Orlitzky @ 2024-02-18 22:49 UTC (permalink / raw
  To: gentoo-commits

commit:     8c3cd19023d036f0a77c98de68ffff304071e035
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 18 22:46:43 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sun Feb 18 22:49:46 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c3cd190

net-analyzer/nagios-plugins: drop 2.4.0-r3, 2.4.2-r3

Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 net-analyzer/nagios-plugins/Manifest               |   2 -
 .../files/define-own-mysql-port-constant.patch     | 100 ------------------
 .../nagios-plugins/nagios-plugins-2.4.0-r3.ebuild  | 115 ---------------------
 .../nagios-plugins/nagios-plugins-2.4.2-r3.ebuild  | 111 --------------------
 4 files changed, 328 deletions(-)

diff --git a/net-analyzer/nagios-plugins/Manifest b/net-analyzer/nagios-plugins/Manifest
index 0bcd88f5261f..1b065025a063 100644
--- a/net-analyzer/nagios-plugins/Manifest
+++ b/net-analyzer/nagios-plugins/Manifest
@@ -1,3 +1 @@
-DIST nagios-plugins-2.4.0.tar.gz 2738643 BLAKE2B 695c3804aec592dad0ae1f2f19222a5ae066944de4169beba08dd1e7beee51c5082679dfc1cf5adc052758e3142f33187ebde9636af19ae313f1448867764878 SHA512 f6f4cd604d28161f36c1429dbfa8f07e9fa468d8d8c21925d53d7049f0765504cb785e1f1189a0c93aa1f0cd1fe3985409c420b7724aa39790836af5c3f725ff
-DIST nagios-plugins-2.4.2.tar.gz 2740092 BLAKE2B 73101f0d439a10bbc0e5d576fe1cf60f115eead00e4611e2f820ebde86390daf1904a45603389a6ad0a9fdb0f14fb49b429ad571159f605df5490f9798fc18d1 SHA512 43448483301c8f5fb9be9b496514a9e15199c320b2a320bb93c4fc6f6fcd35f2a469f980916b37b2b7e565edcb14eea1692f290b0a7bca9364e298eb42af63ce
 DIST nagios-plugins-2.4.6.tar.gz 2751770 BLAKE2B a85da8eaa8d926e2ccae3451d9faa680b75ebd736ba1306c69e7d3b2b8749787743dd6e26013d3a72fba12ef49fdf635c60052791fab558eb49c379bdbb6bac7 SHA512 f2a12a5b6a70849d7233debd1ca95667df981d3627287e3b8813d8fd709c4f4a26cf2128851837f33e0df3132132a4f891edef90e220bc16b1a6351d514faa43

diff --git a/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch b/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch
deleted file mode 100644
index 67bc65cad880..000000000000
--- a/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 43ff2e8607c0b7095c2a4dcab6e466bc67e2e2ff Mon Sep 17 00:00:00 2001
-From: Michael Orlitzky <michael@orlitzky.com>
-Date: Thu, 26 Oct 2017 15:01:17 -0400
-Subject: [PATCH 1/3] plugins/check_mysql*.c: define our own default MySQL
- port.
-
-The MYSQL_PORT constant used to be defined in mysql.h, and was used as
-the default port in the two plugins check_mysql and check_mysql_query.
-Now that mysql.h no longer defines that constant, our plugins fail to
-build against newer versions of MySQL and MariaDB.
-
-Since MYSQL_PORT used the "default port" on the local system, it
-actually was not the best choice as the default for the check plugins:
-when monitoring remote MySQL servers, the usual default of 3306 is
-more likely to be correct than whatever the local server happens to be
-listening on.
-
-As a result, we fix the issue by defining our own constant, called
-CHECK_PORT_DEFAULT, as "3306" at the top of both check_mysql.c and
-check_mysql_query.c. The existing uses of MYSQL_PORT have been changed
-to use the new CHECK_PORT_DEFAULT.
-
-This change is backwards-incompatible: any users who compiled in a
-MYSQL_PORT other than 3306 and who were running their checks on the
-same server as the database will now need to specify that port
-explicitly.
-
-Closes: https://github.com/nagios-plugins/nagios-plugins/issues/288
----
- plugins/check_mysql.c       | 7 +++++--
- plugins/check_mysql_query.c | 7 +++++--
- 2 files changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
-index 83f89c85..c0b61292 100644
---- a/plugins/check_mysql.c
-+++ b/plugins/check_mysql.c
-@@ -36,6 +36,9 @@ const char *email = "devel@nagios-plugins.org";
- 
- #define SLAVERESULTSIZE 70
- 
-+/* The default port that MySQL servers listen on. */
-+#define CHECK_PORT_DEFAULT 3306
-+
- #include "common.h"
- #include "utils.h"
- #include "utils_base.h"
-@@ -58,7 +61,7 @@ char *ciphers = NULL;
- bool ssl = false;
- char *opt_file = NULL;
- char *opt_group = NULL;
--unsigned int db_port = MYSQL_PORT;
-+unsigned int db_port = CHECK_PORT_DEFAULT;
- int check_slave = 0, warn_sec = 0, crit_sec = 0;
- int ignore_auth = 0;
- int verbose = 0;
-@@ -505,7 +508,7 @@ void
- print_help (void)
- {
- 	char *myport;
--	xasprintf (&myport, "%d", MYSQL_PORT);
-+	xasprintf (&myport, "%d", CHECK_PORT_DEFAULT);
- 
- 	print_revision (progname, NP_VERSION);
- 
-diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
-index 436e0685..e9c3acfb 100644
---- a/plugins/check_mysql_query.c
-+++ b/plugins/check_mysql_query.c
-@@ -33,6 +33,9 @@ const char *progname = "check_mysql_query";
- const char *copyright = "1999-2014";
- const char *email = "devel@nagios-plugins.org";
- 
-+/* The default port that MySQL servers listen on. */
-+#define CHECK_PORT_DEFAULT 3306
-+
- #include "common.h"
- #include "utils.h"
- #include "utils_base.h"
-@@ -48,7 +51,7 @@ char *db_pass = NULL;
- char *db = NULL;
- char *opt_file = NULL;
- char *opt_group = NULL;
--unsigned int db_port = MYSQL_PORT;
-+unsigned int db_port = CHECK_PORT_DEFAULT;
- 
- int process_arguments (int, char **);
- int validate_arguments (void);
-@@ -300,7 +303,7 @@ void
- print_help (void)
- {
- 	char *myport;
--	xasprintf (&myport, "%d", MYSQL_PORT);
-+	xasprintf (&myport, "%d", CHECK_PORT_DEFAULT);
- 
- 	print_revision (progname, NP_VERSION);
- 
--- 
-2.13.6
-

diff --git a/net-analyzer/nagios-plugins/nagios-plugins-2.4.0-r3.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-2.4.0-r3.ebuild
deleted file mode 100644
index 192207bf2da9..000000000000
--- a/net-analyzer/nagios-plugins/nagios-plugins-2.4.0-r3.ebuild
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DESCRIPTION="Official plugins for Nagios"
-HOMEPAGE="https://nagios-plugins.org/"
-SRC_URI="https://github.com/${PN}/${PN}/releases/download/release-${PV}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ppc ppc64 sparc x86"
-IUSE="ipv6 ldap mysql nagios-dns nagios-ping nagios-game postgres radius samba selinux snmp ssh +ssl"
-
-# Most of the plugins use automagic dependencies, i.e. the plugin will
-# get built if the binary it uses is installed. For example, check_snmp
-# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
-# installed. End result: most of our runtime dependencies are required
-# at build time as well.
-AUTOMAGIC_DEPEND="
-	nagios-dns? ( net-dns/bind-tools )
-	nagios-game? ( games-util/qstat )
-	nagios-ping? ( net-analyzer/fping )
-	samba? ( net-fs/samba )
-	ssh? ( virtual/openssh )
-	snmp? ( dev-perl/Net-SNMP
-			net-analyzer/net-snmp[-minimal] )"
-
-# Perl really needs to run during the build...
-BDEPEND="${AUTOMAGIC_DEPEND}
-	dev-lang/perl"
-
-DEPEND="
-	ldap? ( net-nds/openldap:= )
-	mysql? ( dev-db/mysql-connector-c:= )
-	postgres? ( dev-db/postgresql:* )
-	ssl? (
-		dev-libs/openssl:0=
-	)
-	radius? ( net-dialup/freeradius-client )"
-
-# Basically everything in net-analyzer/monitoring-plugins collides with
-# nagios-plugins. Perl (from BDEPEND) is needed at runtime, too.
-RDEPEND="${BDEPEND}
-	${DEPEND}
-	!net-analyzer/monitoring-plugins
-	selinux? ( sec-policy/selinux-nagios )"
-
-# At least one test is interactive.
-RESTRICT="test"
-
-DOCS=(
-	ACKNOWLEDGEMENTS
-	AUTHORS
-	CODING
-	ChangeLog
-	FAQ
-	NEWS
-	README
-	REQUIREMENTS
-	SUPPORT
-	THANKS
-)
-
-PATCHES=(
-	"${FILESDIR}/define-own-mysql-port-constant.patch"
-)
-
-src_prepare() {
-	default
-
-	# Fix the path to our perl interpreter
-	sed -i -e "1s:/usr/local/bin/perl:/usr/bin/perl:" \
-		"${S}"/plugins-scripts/*.pl \
-		|| die 'failed to fix perl interpreter path'
-}
-
-src_configure() {
-	# Use an array to prevent econf from mangling the ping args.
-	local myconf=()
-
-	if use ssl; then
-		myconf+=( $(use_with ssl openssl /usr) )
-	else
-		myconf+=( --without-openssl )
-		myconf+=( --without-gnutls )
-	fi
-
-	# The autodetection for these two commands can hang if localhost is
-	# down or ICMP traffic is filtered (bug #468296). But also the path
-	# likes to move around on us (bug #883765).
-	myconf+=( --with-ping-command="$(command -v ping) -n -U -w %d -c %d %s" )
-
-	if use ipv6; then
-		myconf+=( --with-ping6-command="$(command -v ping6) -n -U -w %d -c %d %s" )
-	fi
-
-	econf \
-		$(use_with mysql) \
-		$(use_with ipv6) \
-		$(use_with ldap) \
-		$(use_with postgres pgsql /usr) \
-		$(use_with radius) \
-		"${myconf[@]}" \
-		--libexecdir="/usr/$(get_libdir)/nagios/plugins" \
-		--sysconfdir="/etc/nagios"
-}
-
-pkg_postinst() {
-	elog "This ebuild has a number of USE flags that determine what you"
-	elog "are able to monitor. Depending on what you want to monitor, some"
-	elog "or all of these USE flags need to be set."
-	elog
-	elog "The plugins are installed in ${ROOT}/usr/$(get_libdir)/nagios/plugins"
-}

diff --git a/net-analyzer/nagios-plugins/nagios-plugins-2.4.2-r3.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-2.4.2-r3.ebuild
deleted file mode 100644
index 93ed15e27790..000000000000
--- a/net-analyzer/nagios-plugins/nagios-plugins-2.4.2-r3.ebuild
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DESCRIPTION="Official plugins for Nagios"
-HOMEPAGE="https://nagios-plugins.org/"
-SRC_URI="https://github.com/${PN}/${PN}/releases/download/release-${PV}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ppc ppc64 sparc x86"
-IUSE="ipv6 ldap mysql nagios-dns nagios-ping nagios-game postgres radius samba selinux snmp ssh +ssl"
-
-# Most of the plugins use automagic dependencies, i.e. the plugin will
-# get built if the binary it uses is installed. For example, check_snmp
-# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
-# installed. End result: most of our runtime dependencies are required
-# at build time as well.
-AUTOMAGIC_DEPEND="
-	nagios-dns? ( net-dns/bind-tools )
-	nagios-game? ( games-util/qstat )
-	nagios-ping? ( net-analyzer/fping )
-	samba? ( net-fs/samba )
-	ssh? ( virtual/openssh )
-	snmp? ( dev-perl/Net-SNMP
-			net-analyzer/net-snmp[-minimal] )"
-
-# Perl really needs to run during the build...
-BDEPEND="${AUTOMAGIC_DEPEND}
-	dev-lang/perl"
-
-DEPEND="
-	ldap? ( net-nds/openldap:= )
-	mysql? ( dev-db/mysql-connector-c:= )
-	postgres? ( dev-db/postgresql:* )
-	ssl? (
-		dev-libs/openssl:0=
-	)
-	radius? ( net-dialup/freeradius-client )"
-
-# Basically everything in net-analyzer/monitoring-plugins collides with
-# nagios-plugins. Perl (from BDEPEND) is needed at runtime, too.
-RDEPEND="${BDEPEND}
-	${DEPEND}
-	!net-analyzer/monitoring-plugins
-	selinux? ( sec-policy/selinux-nagios )"
-
-# At least one test is interactive.
-RESTRICT="test"
-
-DOCS=(
-	ACKNOWLEDGEMENTS
-	AUTHORS
-	CODING
-	ChangeLog
-	FAQ
-	NEWS
-	README
-	REQUIREMENTS
-	SUPPORT
-	THANKS
-)
-
-src_prepare() {
-	default
-
-	# Fix the path to our perl interpreter
-	sed -i -e "1s:/usr/local/bin/perl:/usr/bin/perl:" \
-		"${S}"/plugins-scripts/*.pl \
-		|| die 'failed to fix perl interpreter path'
-}
-
-src_configure() {
-	# Use an array to prevent econf from mangling the ping args.
-	local myconf=()
-
-	if use ssl; then
-		myconf+=( $(use_with ssl openssl /usr) )
-	else
-		myconf+=( --without-openssl )
-		myconf+=( --without-gnutls )
-	fi
-
-	# The autodetection for these two commands can hang if localhost is
-	# down or ICMP traffic is filtered (bug #468296). But also the path
-	# likes to move around on us (bug #883765).
-	myconf+=( --with-ping-command="$(command -v ping) -n -U -w %d -c %d %s" )
-
-	if use ipv6; then
-		myconf+=( --with-ping6-command="$(command -v ping6) -n -U -w %d -c %d %s" )
-	fi
-
-	econf \
-		$(use_with mysql) \
-		$(use_with ipv6) \
-		$(use_with ldap) \
-		$(use_with postgres pgsql /usr) \
-		$(use_with radius) \
-		"${myconf[@]}" \
-		--libexecdir="/usr/$(get_libdir)/nagios/plugins" \
-		--sysconfdir="/etc/nagios"
-}
-
-pkg_postinst() {
-	elog "This ebuild has a number of USE flags that determine what you"
-	elog "are able to monitor. Depending on what you want to monitor, some"
-	elog "or all of these USE flags need to be set."
-	elog
-	elog "The plugins are installed in ${ROOT}/usr/$(get_libdir)/nagios/plugins"
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-plugins/files/, net-analyzer/nagios-plugins/
@ 2025-04-08  0:50 Michael Orlitzky
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Orlitzky @ 2025-04-08  0:50 UTC (permalink / raw
  To: gentoo-commits

commit:     7d5b11c234adf6ff1613e045edacf6cc6e22845e
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  7 23:52:24 2025 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Apr  8 00:49:54 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d5b11c2

net-analyzer/nagios-plugins: bugfix -r1, keyword ~riscv

 * Two patches for improved pgsql and net-snmp detection.
 * Depend on net-dns/bind instead of the old net-dns/bind-tools.
 * Add ~riscv keywords.

Bug: https://bugs.gentoo.org/940193
Closes: https://bugs.gentoo.org/938467
Closes: https://bugs.gentoo.org/953349
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 ...agios-plugins-2.4.12-postgresql-detection.patch | 143 +++++++++++++++++++++
 .../files/nagios-plugins-2.4.12-snmpgetnext.patch  | 128 ++++++++++++++++++
 .../nagios-plugins/nagios-plugins-2.4.12-r1.ebuild | 130 +++++++++++++++++++
 3 files changed, 401 insertions(+)

diff --git a/net-analyzer/nagios-plugins/files/nagios-plugins-2.4.12-postgresql-detection.patch b/net-analyzer/nagios-plugins/files/nagios-plugins-2.4.12-postgresql-detection.patch
new file mode 100644
index 000000000000..570b0992bf7e
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/nagios-plugins-2.4.12-postgresql-detection.patch
@@ -0,0 +1,143 @@
+From be90a1d9ae5b5e10015619271337e3a2c731b3bb Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 7 Sep 2024 19:51:27 -0400
+Subject: [PATCH] configure.ac: rewrite PostgreSQL detection using pg_config
+
+PostgreSQL installs a pg_config program that spits out its "include"
+and "library" paths when called with --includedir and --libdir,
+respectively. Using this we can simplify the detection of PostgreSQL,
+since in theory the problem is reduced to that of finding pg_config.
+
+This commit replaces the existing PostgreSQL detection with a more
+straightforward search for pg_config. The change is backwards-
+compatible, in the sense that --with-pgsql=foo will still find the
+postgres installation in "foo," except now it will do so through
+foo/bin/pg_config rather than foo/include and foo/lib.
+
+This solves a rare problem: on systems where only one version of
+postgres is allowed, or on systems where multiple versions exist but a
+"default" version can be chosen, the most likely path for postgres is
+--with-pgsql=/usr. With the current implementation, this leads to
+"-I/usr/include" being added to CPPFLAGS, which is fine, and
+"-L/usr/lib" being added to LDFLAGS, which is not. On some of those
+same systems, /usr/lib is for 32-bit libraries while /usr/lib64 is the
+"normal" (64-bit) library path. So as a result of detecting postgres
+under /usr, the linker is pointed to the wrong set of libraries. This
+is known to crash lld (the LLVM linker).
+---
+ configure.ac | 100 ++++++++++++++++++++++++++-------------------------
+ 1 file changed, 52 insertions(+), 48 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b67a7805..c69246c0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -209,56 +209,60 @@ if test "$enable_extra_opts" = "yes" ; then
+ 	fi
+ fi
+ 
+-dnl Check for PostgreSQL libraries
+-_SAVEDLIBS="$LIBS"
+-_SAVEDCPPFLAGS="$CPPFLAGS"
++dnl Check for PostgreSQL libraries. Postgres ships a pg_config program
++dnl that gives us the -I and -L flags we need, so the problem is reduced
++dnl to finding pg_config. When the user passes --with-pgsql=foo, we expect
++dnl that "foo" is something like /usr/lib64/postgresql-16, i.e. that we
++dnl can locate "bin/pg_config" there. This supports choosing one particular
++dnl version of postgres when multiple versions are installed. If the "foo"
++dnl argument is omitted, we instead use whatever pg_config (if any) is present
++dnl on the PATH. It is an error to request postgres support when no usable
++dnl pg_config is provided and one cannot be found.
+ AC_ARG_WITH(pgsql,
+ 	ACX_HELP_STRING([--with-pgsql=DIR],
+-		[sets path to pgsql installation]),
+-	PGSQL=$withval,)
+-AC_CHECK_LIB(crypt,main)
+-if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
+-  if test -n "$PGSQL"; then
+-    LDFLAGS="$LDFLAGS -L$PGSQL/lib"
+-    CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
+-  fi
+-  AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
+-  if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
+-    AC_CHECK_HEADERS(pgsql/libpq-fe.h)
+-    AC_CHECK_HEADERS(postgresql/libpq-fe.h)
+-    AC_CHECK_HEADERS(libpq-fe.h)
+-    if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
+-      PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+-      PGINCLUDE="-I$PGSQL/include"
+-    elif test  "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
+-      PGLIBS="-lpq -lcrypt"
+-      PGINCLUDE="-I/usr/include/pgsql"
+-    elif test  "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
+-      PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+-      PGINCLUDE="-I/usr/include/postgresql"
+-    elif test  "$ac_cv_header_libpq_fe_h" = "yes"; then
+-      PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+-      PGINCLUDE="-I$PGSQL/include"
+-    fi
+-    if test -z "$PGINCLUDE"; then
+-      AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+-      AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
+-    else
+-      AC_SUBST(PGLIBS)
+-      AC_SUBST(PGINCLUDE)
+-      EXTRAS="$EXTRAS check_pgsql\$(EXEEXT)"
+-    fi
+-  else
+-    AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+-    AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
+-    AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
+-  fi
+-else
+-  AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+-  AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
+-fi
+-LIBS="$_SAVEDLIBS"
+-CPPFLAGS="$_SAVEDCPPFLAGS"
++		[path to pgsql installation, i.e. path to bin/pg_config]),
++	PGSQL=$withval,PGSQL=no)
++
++dnl --with-pgsql sans argument gives "yes"
++dnl --without-pgsql gives "no" (this is also the default, see above)
++dnl --with-pgsql=foo gives "foo"
++AS_IF([test "x${PGSQL}" = xno],[
++  AC_MSG_WARN([Skipping PostgreSQL plugin])
++],[
++  _PG_CONFIG=""
++
++  AS_IF([test "x${PGSQL}" = xyes],[
++    AC_PATH_PROG(_PG_CONFIG, pg_config)
++    AS_IF([test -z "${_PG_CONFIG}"],[
++      AC_MSG_ERROR([postgres support requested but pg_config not found])
++    ])
++  ],[
++    AC_MSG_CHECKING([for usable ${PGSQL}/bin/pg_config])
++    AS_IF([test -f "${PGSQL}/bin/pg_config" -a -x "${PGSQL}/bin/pg_config"],[
++      AC_MSG_RESULT([yes])
++      _PG_CONFIG="${PGSQL}/bin/pg_config"
++    ],[
++      AC_MSG_RESULT([no])
++      AC_MSG_ERROR([${PGSQL}/bin/pg_config not found or not executable])
++    ])
++  ])
++
++  dnl Sanity check: look for a header using the -I flags
++  dnl that we get from pg_config.
++  _SAVED_CPPFLAGS="${CPPFLAGS}"
++  PGINCLUDE="-I$(${_PG_CONFIG} --includedir)"
++  CPPFLAGS="${CPPFLAGS} ${PGINCLUDE}"
++  AC_CHECK_HEADER(libpq-fe.h,[
++    PGLIBS="-L$(${_PG_CONFIG} --libdir) -lpq"
++    AC_SUBST(PGLIBS)
++    AC_SUBST(PGINCLUDE)
++    EXTRAS="$EXTRAS check_pgsql\$(EXEEXT)"
++  ],[
++    AC_MSG_ERROR([libpq-fe.h not found])
++  ])
++  CPPFLAGS="${_SAVED_CPPFLAGS}"
++])
++
+ 
+ AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Skips the dbi plugin])])
+ dnl Check for DBI libraries

diff --git a/net-analyzer/nagios-plugins/files/nagios-plugins-2.4.12-snmpgetnext.patch b/net-analyzer/nagios-plugins/files/nagios-plugins-2.4.12-snmpgetnext.patch
new file mode 100644
index 000000000000..549ba3e30b71
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/nagios-plugins-2.4.12-snmpgetnext.patch
@@ -0,0 +1,128 @@
+From 37b27e058cc8a352a588c865e0319c23f6cb23d5 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 15 Feb 2025 17:45:53 -0500
+Subject: [PATCH 1/3] configure.ac: update net-snmp homepage
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6b443263..0308f5cb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1491,7 +1491,7 @@ then
+ 	AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
+ 	EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
+ else
+-	AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
++	AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to make check_hpjd and check_snmp plugins])
+ fi
+ 
+ AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
+
+From 8246d9c987b45586b5ceca2c81a671c642ad7106 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 15 Feb 2025 17:47:34 -0500
+Subject: [PATCH 2/3] configure.ac: use AS_IF in net-snmp tests
+
+Not strictly required here, but the AS_IF macro is generally safer
+because it handles (often unintentional) AC_REQUIRE calls.
+---
+ configure.ac | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0308f5cb..5aaf4eee 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1486,23 +1486,21 @@ AC_ARG_WITH(snmpget_command,
+             ACX_HELP_STRING([--with-snmpget-command=PATH],
+                             [Path to snmpget command]),
+             PATH_TO_SNMPGET=$withval)
+-if test -n "$PATH_TO_SNMPGET"
+-then
++AS_IF([test -n "$PATH_TO_SNMPGET"], [
+ 	AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
+ 	EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
+-else
++], [
+ 	AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to make check_hpjd and check_snmp plugins])
+-fi
++])
+ 
+ AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
+ AC_ARG_WITH(snmpgetnext_command,
+             ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
+                             [Path to snmpgetnext command]),
+             PATH_TO_SNMPGETNEXT=$withval)
+-if test -n "$PATH_TO_SNMPGETNEXT"
+-then
++AS_IF([test -n "$PATH_TO_SNMPGETNEXT"], [
+ 	AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
+-fi
++])
+ 
+ if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )
+ then
+
+From 1ceac49405e77b28e75118c5b537db84d73866a5 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 15 Feb 2025 18:10:06 -0500
+Subject: [PATCH 3/3] configure.ac: require snmpgetnext for check_snmp
+
+PATH_TO_SNMPGETNEXT is used unconditionally in plugins/check_snmp.c,
+and the build will fail if it is left undefined (that is, if we are
+building check_snmp but snmpgetnext was neither found on the user's
+PATH or supplied manually).
+
+To avoid this build failure, we now test for snmpgetnext inside the
+case for snmpget, and skip check_snmp unless BOTH are found.
+
+Closes GH-788
+---
+ configure.ac | 25 +++++++++++++++++--------
+ 1 file changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5aaf4eee..ae2ea796 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1486,20 +1486,29 @@ AC_ARG_WITH(snmpget_command,
+             ACX_HELP_STRING([--with-snmpget-command=PATH],
+                             [Path to snmpget command]),
+             PATH_TO_SNMPGET=$withval)
+-AS_IF([test -n "$PATH_TO_SNMPGET"], [
+-	AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
+-	EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
+-], [
+-	AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to make check_hpjd and check_snmp plugins])
+-])
+ 
+ AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
+ AC_ARG_WITH(snmpgetnext_command,
+             ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
+                             [Path to snmpgetnext command]),
+             PATH_TO_SNMPGETNEXT=$withval)
+-AS_IF([test -n "$PATH_TO_SNMPGETNEXT"], [
+-	AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
++
++AS_IF([test -n "$PATH_TO_SNMPGET"], [
++	AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
++	EXTRAS="$EXTRAS check_hpjd"
++
++	dnl PATH_TO_SNMPGETNEXT is used unconditionally in check_snmp:
++	dnl
++	dnl   https://github.com/nagios-plugins/nagios-plugins/issues/788
++	dnl
++	AS_IF([test -n "$PATH_TO_SNMPGETNEXT"], [
++		AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
++		EXTRAS="$EXTRAS check_snmp\$(EXEEXT)"
++	], [
++		AC_MSG_WARN([Get snmpgetnext from https://net-snmp.sourceforge.io/ to build the check_snmp plugin])
++	])
++], [
++	AC_MSG_WARN([Get snmpget from https://net-snmp.sourceforge.io/ to build the check_hpjd and check_snmp plugins])
+ ])
+ 
+ if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null  )

diff --git a/net-analyzer/nagios-plugins/nagios-plugins-2.4.12-r1.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-2.4.12-r1.ebuild
new file mode 100644
index 000000000000..add6fce1fcec
--- /dev/null
+++ b/net-analyzer/nagios-plugins/nagios-plugins-2.4.12-r1.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Official plugins for Nagios"
+HOMEPAGE="https://nagios-plugins.org/"
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/release-${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="ipv6 ldap mysql nagios-dns nagios-ping nagios-game postgres radius samba selinux snmp ssh +ssl"
+
+# Most of the plugins use automagic dependencies, i.e. the plugin will
+# get built if the binary it uses is installed. For example, check_snmp
+# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
+# installed. End result: most of our runtime dependencies are required
+# at build time as well.
+AUTOMAGIC_DEPEND="
+	nagios-dns? ( net-dns/bind )
+	nagios-game? ( games-util/qstat )
+	nagios-ping? ( net-analyzer/fping )
+	samba? ( net-fs/samba )
+	ssh? ( virtual/openssh )
+	snmp? ( dev-perl/Net-SNMP
+			net-analyzer/net-snmp[-minimal] )"
+
+# Perl really needs to run during the build...
+BDEPEND="${AUTOMAGIC_DEPEND}
+	dev-lang/perl"
+
+DEPEND="
+	ldap? ( net-nds/openldap:= )
+	mysql? ( dev-db/mysql-connector-c:= )
+	postgres? ( dev-db/postgresql:* )
+	ssl? (
+		dev-libs/openssl:0=
+	)
+	radius? ( net-dialup/freeradius-client )"
+
+# Basically everything in net-analyzer/monitoring-plugins collides with
+# nagios-plugins. Perl (from BDEPEND) is needed at runtime, too.
+RDEPEND="${BDEPEND}
+	${DEPEND}
+	!net-analyzer/monitoring-plugins
+	selinux? ( sec-policy/selinux-nagios )"
+
+# At least one test is interactive.
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}/${P}-postgresql-detection.patch"
+	"${FILESDIR}/${P}-snmpgetnext.patch"
+)
+
+DOCS=(
+	ACKNOWLEDGEMENTS
+	AUTHORS
+	CODING
+	ChangeLog
+	FAQ
+	NEWS
+	README
+	REQUIREMENTS
+	SUPPORT
+	THANKS
+)
+
+# These all come from gnulib and the ./configure checks are working as
+# intended when the functions aren't present. Bugs 907755 and 924341.
+QA_CONFIG_IMPL_DECL_SKIP=(
+	statvfs64
+	re_set_syntax
+	re_compile_pattern
+	re_search
+	re_match
+)
+
+src_prepare() {
+	default
+
+	# Fix the path to our perl interpreter
+	sed -i -e "1s:/usr/local/bin/perl:/usr/bin/perl:" \
+		"${S}"/plugins-scripts/*.pl \
+		|| die 'failed to fix perl interpreter path'
+
+	eautoreconf
+}
+
+src_configure() {
+	# Use an array to prevent econf from mangling the ping args.
+	local myconf=()
+
+	if use ssl; then
+		myconf+=( $(use_with ssl openssl /usr) )
+	else
+		myconf+=( --without-openssl )
+		myconf+=( --without-gnutls )
+	fi
+
+	# The autodetection for these two commands can hang if localhost is
+	# down or ICMP traffic is filtered (bug #468296). But also the path
+	# likes to move around on us (bug #883765).
+	myconf+=( --with-ping-command="$(command -v ping) -n -U -w %d -c %d %s" )
+
+	if use ipv6; then
+		myconf+=( --with-ping6-command="$(command -v ping6) -n -U -w %d -c %d %s" )
+	fi
+
+	econf \
+		$(use_with mysql) \
+		$(use_with ipv6) \
+		$(use_with ldap) \
+		$(use_with postgres pgsql /usr) \
+		$(use_with radius) \
+		"${myconf[@]}" \
+		--libexecdir="/usr/$(get_libdir)/nagios/plugins" \
+		--sysconfdir="/etc/nagios"
+}
+
+pkg_postinst() {
+	elog "This ebuild has a number of USE flags that determine what you"
+	elog "are able to monitor. Depending on what you want to monitor, some"
+	elog "or all of these USE flags need to be set."
+	elog
+	elog "The plugins are installed in ${ROOT}/usr/$(get_libdir)/nagios/plugins"
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-08  0:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-18 22:49 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-plugins/files/, net-analyzer/nagios-plugins/ Michael Orlitzky
  -- strict thread matches above, loose matches on Subject: below --
2025-04-08  0:50 Michael Orlitzky
2017-10-27 12:45 Michael Orlitzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox