From 7d5fe7205f38aa377f8dfe829e35ee9fc4dbc98e Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Tue, 15 Nov 2022 21:54:16 +0000
Subject: [PATCH] community/monitoring-plugins: upgrade to 2.3.2

---
 community/monitoring-plugins/APKBUILD        | 36 ++++++++++++--------
 community/monitoring-plugins/prototype.patch | 27 +++++++++++++++
 2 files changed, 49 insertions(+), 14 deletions(-)
 create mode 100644 community/monitoring-plugins/prototype.patch

diff --git a/community/monitoring-plugins/APKBUILD b/community/monitoring-plugins/APKBUILD
index 0d99e0cde9c8..b45b35d40c8e 100644
--- a/community/monitoring-plugins/APKBUILD
+++ b/community/monitoring-plugins/APKBUILD
@@ -1,26 +1,31 @@
 # Contributor: Francesco Colista <fcolista@alpinelinux.org>
 # Maintainer: Francesco Colista <fcolista@alpinelinux.org>
 pkgname=monitoring-plugins
-pkgver=2.3.1
-pkgrel=4
+pkgver=2.3.2
+pkgrel=0
 pkgdesc="Plugins for Icinga, Naemon, Nagios, Shinken, Sensu and other monitoring applications"
 url="https://www.monitoring-plugins.org"
 arch="all"
 license="GPL-3.0-or-later"
 options="suid !check" # Tests require interactive output and connecting to various URLs
 depends="iputils procps bind-tools"
-makedepends="linux-headers libdbi-dev openssl-dev>3
-mariadb-connector-c-dev libpq-dev perl-dev perl-net-snmp net-snmp-tools"
+makedepends="
+	gettext-dev
+	libdbi-dev
+	libpq-dev
+	linux-headers
+	mariadb-connector-c-dev
+	net-snmp-tools
+	openssl-dev
+	perl-dev
+	perl-net-snmp
+	"
 checkdepends="cmd:ksh"
-subpackages="$pkgname-doc"
+subpackages="$pkgname-lang $pkgname-doc"
 source="https://www.monitoring-plugins.org/download/$pkgname-$pkgver.tar.gz
-	mariadb.patch"
-
-prepare() {
-	default_prepare
-	update_config_guess
-	update_config_sub
-}
+	mariadb.patch
+	prototype.patch
+	"
 
 build() {
 	 ./configure \
@@ -47,5 +52,8 @@ package() {
 	rm $pkgdir/usr/lib/charset.alias
 }
 
-sha512sums="0ae76bc776997ed23d142ad9a688edc4df9b8ec0f9539b446e4fb4849a165cc88e97cbfb3a7a9a450de452e021d38f2e4ada7e8a22d78cf58e17e266472d01d7  monitoring-plugins-2.3.1.tar.gz
-3db122a22012dbd571865023d5542c38541a6667b8e00a08d4180c04117300737f57dbdff3264240cda9f6746419022bace8da06d997b0ade776604c55da9bde  mariadb.patch"
+sha512sums="
+d155f09ddd99f4e0d065627d3bf8768e13ae3f58ed25912f33b070cd24d6f3f43243616ec3e2d496dec633feee6b1f14950035a928034a1413f725814e850765  monitoring-plugins-2.3.2.tar.gz
+3db122a22012dbd571865023d5542c38541a6667b8e00a08d4180c04117300737f57dbdff3264240cda9f6746419022bace8da06d997b0ade776604c55da9bde  mariadb.patch
+8e217d791424453486d4733f4a2209b956a56b9278092d2b65db845d875251796a222e636087bc2bbadb47534189dffa13d19b6f51f172bca8f5d3dac5961375  prototype.patch
+"
diff --git a/community/monitoring-plugins/prototype.patch b/community/monitoring-plugins/prototype.patch
new file mode 100644
index 000000000000..159ebce543a9
--- /dev/null
+++ b/community/monitoring-plugins/prototype.patch
@@ -0,0 +1,27 @@
+used before being defined, so fix some missing prototypes
+diff --git a/plugins/runcmd.c b/plugins/runcmd.c
+index a7155d2..540d29a 100644
+--- a/plugins/runcmd.c
++++ b/plugins/runcmd.c
+@@ -44,6 +44,8 @@
+ # include <sys/wait.h>
+ #endif
+ 
++#include "utils.h"
++
+ /** macros **/
+ #ifndef WEXITSTATUS
+ # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+diff --git a/plugins/sslutils.c b/plugins/sslutils.c
+index 286273f..3950df7 100644
+--- a/plugins/sslutils.c
++++ b/plugins/sslutils.c
+@@ -30,6 +30,8 @@
+ #include "common.h"
+ #include "netutils.h"
+ 
++int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit);
++
+ #ifdef HAVE_SSL
+ static SSL_CTX *c=NULL;
+ static SSL *s=NULL;
-- 
GitLab