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; 2+ 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] 2+ 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; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2024-02-18 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-27 12:45 [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 --
2024-02-18 22:49 Michael Orlitzky

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