From fadf868d929d38297eee94b3645ef16a6e31a0a3 Mon Sep 17 00:00:00 2001
From: Simon Frankenberger <simon@fraho.eu>
Date: Mon, 30 Nov 2020 21:22:13 +0100
Subject: [PATCH] main/nagios-plugins: fix compilation with wrong mysql-import

---
 main/nagios-plugins/APKBUILD                  |  6 ++---
 ...-compilation-warnings-about-sys-poll.patch | 16 +++++++++++++
 main/nagios-plugins/fix-mysql-headers.patch   | 24 -------------------
 3 files changed, 19 insertions(+), 27 deletions(-)
 create mode 100644 main/nagios-plugins/fix-compilation-warnings-about-sys-poll.patch
 delete mode 100644 main/nagios-plugins/fix-mysql-headers.patch

diff --git a/main/nagios-plugins/APKBUILD b/main/nagios-plugins/APKBUILD
index aad464784130..98844f262a6c 100644
--- a/main/nagios-plugins/APKBUILD
+++ b/main/nagios-plugins/APKBUILD
@@ -4,7 +4,7 @@
 # Maintainer: Jeff Bilyk <jbilyk@gmail.com>
 pkgname=nagios-plugins
 pkgver=2.3.2
-pkgrel=0
+pkgrel=1
 pkgdesc="Plugins for Nagios to check services on hosts"
 url="https://nagios-plugins.org"
 arch="all"
@@ -28,7 +28,7 @@ pkgusers="nagios"
 pkggroups="nagios"
 options="suid"
 source="https://www.nagios-plugins.org/download/nagios-plugins-$pkgver.tar.gz
-	fix-mysql-headers.patch
+	fix-compilation-warnings-about-sys-poll.patch
 	check_openrc
 	nagios-openrc.sudoers"
 
@@ -150,6 +150,6 @@ _all() {
 }
 
 sha512sums="c73e13800ad408f9b345fbfc2142ae2275b77e4865ecdb9be33a86024c10be1e54e401450c3f7c848e96bd1152c723426477a1f2874e3bf5dd149f07391b1dd9  nagios-plugins-2.3.2.tar.gz
-5db87cf63fb6d1f72122bd7c72f012aab2724328d3d71da546970792a6cdeedbe008f3feef03f7432f100836ace3701c1902b820c93a79e5fa13abe8b337da0d  fix-mysql-headers.patch
+7a62e4808eb8b07ca43bc17a625f4199708da6c52b79eca7a756817cb734648fc3054cd89862638ae925022017db32479d2cfcfddeba79ab4557d7b9ec97c323  fix-compilation-warnings-about-sys-poll.patch
 12d87542631494df1c961e547c19107a025829509e174e8208111736141c12e20dbf490c55d487af39d47cefca5507cd98c973b7b20ae3f961dcbfd167195d8e  check_openrc
 171c9ad14d1027541b78df76063e6d34483dd536219fb83e0346e191739529d59c8d6be468af7f1c4c93b20baf9a32879510f15ec3d06aa1eefaf5d785ea8546  nagios-openrc.sudoers"
diff --git a/main/nagios-plugins/fix-compilation-warnings-about-sys-poll.patch b/main/nagios-plugins/fix-compilation-warnings-about-sys-poll.patch
new file mode 100644
index 000000000000..70b4d4680c13
--- /dev/null
+++ b/main/nagios-plugins/fix-compilation-warnings-about-sys-poll.patch
@@ -0,0 +1,16 @@
+Subject: Use correct poll.h import
+Author: Simon Frankenberger <simon-alpine@fraho.eu>
+
+This silences some compiler warnings
+
+--- old/plugins/common.h
++++ new/plugins/common.h
+@@ -120,7 +120,7 @@
+ #include <locale.h>
+ 
+ #ifdef HAVE_SYS_POLL_H
+-# include "sys/poll.h"
++# include <poll.h>
+ #endif
+ 
+ /*
diff --git a/main/nagios-plugins/fix-mysql-headers.patch b/main/nagios-plugins/fix-mysql-headers.patch
deleted file mode 100644
index 34926a73feb9..000000000000
--- a/main/nagios-plugins/fix-mysql-headers.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -up ./plugins/check_mysql.c.fix_mysql_f27 ./plugins/check_mysql.c
---- ./plugins/check_mysql.c.fix_mysql_f27	2017-11-20 21:19:47.597527944 -0500
-+++ ./plugins/check_mysql.c	2017-11-20 21:17:15.715921194 -0500
-@@ -41,7 +41,7 @@ const char *email = "devel@nagios-plugin
- #include "utils_base.h"
- #include "netutils.h"
- 
--#include <mysql.h>
-+#include <server/mysql.h>
- #include <mysqld_error.h>
- #include <errmsg.h>
- 
-diff -up ./plugins/check_mysql_query.c.fix_mysql_f27 ./plugins/check_mysql_query.c
---- ./plugins/check_mysql_query.c.fix_mysql_f27	2017-11-20 21:20:01.369764323 -0500
-+++ ./plugins/check_mysql_query.c	2017-11-20 21:17:20.378001200 -0500
-@@ -38,7 +38,7 @@ const char *email = "devel@nagios-plugin
- #include "utils_base.h"
- #include "netutils.h"
- 
--#include <mysql.h>
-+#include <server/mysql.h>
- #include <errmsg.h>
- 
- char *db_user = NULL;
-- 
GitLab