[community-mysql] Require /etc/my.cnf instead of shipping it

Honza Horak hhorak at fedoraproject.org
Mon Jun 30 10:18:43 UTC 2014


commit 5ec838ab2ea2f43e53a701373263c127c1800537
Author: Honza Horak <hhorak at redhat.com>
Date:   Fri Jun 27 17:20:46 2014 +0200

    Require /etc/my.cnf instead of shipping it

 community-mysql.spec |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/community-mysql.spec b/community-mysql.spec
index b3d696d..03a0ee7 100644
--- a/community-mysql.spec
+++ b/community-mysql.spec
@@ -14,6 +14,9 @@
 
 %global           skiplist platform-specific-tests.list
 
+# When there is already another 
+%global ship_my_cnf 0
+
 Name:             community-mysql
 Version:          5.6.19
 Release:          3%{?dist}
@@ -118,6 +121,9 @@ MySQL server.
 %package          common
 Summary:          The shared files required for MySQL server and client
 Group:            Applications/Databases
+%if ! %{ship_my_cnf}
+Requires:         %{_sysconfdir}/my.cnf
+%endif
 
 %description      common
 The mysql-common package provides the essential shared files for any
@@ -362,8 +368,10 @@ touch %{buildroot}/var/log/mysqld.log
 mkdir -p %{buildroot}/var/run/mysqld
 install -p -m 0755 -d %{buildroot}/var/lib/mysql
 
-install -D -p -m 0644 %{SOURCE3} %{buildroot}/etc/my.cnf
-mkdir %{buildroot}%{_sysconfdir}/my.cnf.d
+%if %{ship_my_cnf}
+install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/my.cnf
+%endif
+mkdir -p %{buildroot}%{_sysconfdir}/my.cnf.d
 
 # install systemd unit files and scripts for handling server startup
 install -D -p -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/%{basename:%SOURCE11}
@@ -508,7 +516,9 @@ popd
 %doc README COPYING README.mysql-license
 # although the default my.cnf contains only server settings, we put it in the
 # libs package because it can be used for client settings too.
+%if %{ship_my_cnf}
 %config(noreplace) %{_sysconfdir}/my.cnf
+%endif
 %dir %{_libdir}/mysql
 %{_libdir}/mysql/libmysqlclient*.so.*
 %config(noreplace) /etc/ld.so.conf.d/*
@@ -658,6 +668,7 @@ popd
 * Fri Jun 27 2014 Honza Horak <hhorak at redhat.com> - 5.6.19-3
 - Add mysql-compat-server symbol, common symbol for arbitrary MySQL
   implementation
+- Require /etc/my.cnf instead of shipping it
 
 * Thu Jun 12 2014 Bjorn Munch <bjorn.munch at oracle.com> - 5.6.19-2
 - Fix build on aarch64


More information about the scm-commits mailing list