From 043980e73f824a20fabba31dd43010dc3426b25e Mon Sep 17 00:00:00 2001
From: Marcin Krol <hawk@tld-linux.org>
Date: Thu, 9 May 2024 21:39:16 +0200
Subject: [PATCH] - bcond for building as default MySQL

---
 mysql.spec | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mysql.spec b/mysql.spec
index a20a4f2..c6f4ec1 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -12,6 +12,7 @@
 %bcond_with	tests		# run test suite
 %bcond_with	ndb		# NDB is now a separate product, this here is broken, so disable it
 %bcond_without	ldap		# LDAP auth support (requires MIT Kerberos)
+%bcond_without	default		# default version of MySQL (with -common and -devel)
 
 %define mysqlversion 8.0
 %define mysqlpriority 80
@@ -253,7 +254,7 @@ MySQL - wspólne pliki i katalogi.
 Summary:        Common directories for MysSQL %{mysqlversion}
 Summary(pl.UTF-8):      Wspólne pliki i katalogi dla MySQL %{mysqlversion}
 Group:          Applicataion/Databases
-Requires:	mysql-common >= %{version}-%{release}
+Requires:	mysql-common >= 8.0.0
 
 %description dirs
 Common directories for MysSQL %{mysqlversion}
@@ -1105,6 +1106,7 @@ fi
 %defattr(644,root,root,755)
 %{_datadir}/mysql/%{mysqlversion}/lang/charsets
 
+%if %{with default}
 %files -n mysql-common
 %defattr(644,root,root,755)
 %attr(751,root,root) %dir %{_sysconfdir}/mysql
@@ -1117,6 +1119,7 @@ fi
 %attr(751,root,root) %dir /var/log/archive/mysql
 %attr(751,root,root) %dir /var/log/mysqlrouter
 %attr(751,root,root) %dir /var/log/archive/mysqlrouter
+%endif
 
 %files dirs
 %defattr(644,root,root,755)
@@ -1181,6 +1184,7 @@ fi
 %attr(755,root,root) %ghost %{_libdir}/libndbclient.so.3
 %endif
 
+%if %{with default}
 %files -n mysql-devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/mysql/%{mysqlversion}/bin/mysql_config
@@ -1200,6 +1204,7 @@ fi
 %if %{with ndb}
 %{_libdir}/libndbclient.a
 %endif
+%endif
 
 %if %{with ndb}
 %files ndb
-- 
2.49.0