From a361062c8e8dc213de471535a807a624f2ddd2b7 Mon Sep 17 00:00:00 2001 From: Henrik Triem Date: Tue, 20 Jul 2021 14:08:21 +0000 Subject: [PATCH] Merge branch 'test/mariadb-connector-c' into '2.12' Use mariadb-connector-c for RHEL 8+ See merge request packaging/rpm-icinga2!25 https://github.com/Icinga/icinga-packaging/issues/205 (cherry picked from commit a894a068dd3e362b3049c6ec68193e35ab9aa4b9) 7bf92e3d Use mariadb-connector-c for RHEL 8+ 98704be6 Try excluding mysql-devel a6d6aa46 Try setting BuildRequires to Requires 59f9680d Re-add BuildRequires cc51938b Add script to remove mysql-devel 9bba7fb5 Add a sudo :( e813ef63 ...and assume yes when removing mysql-devel 2716e965 Remove mysql-devel before the script d04228d5 Remove remove mysql-devel instruction --- icinga2.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/icinga2.spec b/icinga2.spec index 82364b8..c824538 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -251,9 +251,13 @@ BuildRequires: libmysqlclient-devel BuildRequires: mysql-devel %endif +%else +%if 0%{?rhel} >= 8 +BuildRequires: mariadb-connector-c-devel %else BuildRequires: mysql-devel %endif #suse +%endif Requires: %{name}-bin = %{version}-%{release} @@ -643,6 +647,7 @@ getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /s %endif %endif +%if %{with mysql} %post ido-mysql if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-mysql.conf ] then @@ -659,7 +664,9 @@ if [ "$1" = "0" ]; then fi exit 0 +%endif +%if %{with pgsql} %post ido-pgsql if [ ${1:-0} -eq 1 ] && [ -e %{_sysconfdir}/%{name}/features-enabled/ido-pgsql.conf ] then @@ -676,6 +683,7 @@ if [ "$1" = "0" ]; then fi exit 0 +%endif %if 0%{?use_selinux} %post selinux