Add -config sub-package that delivers system-wide /etc/my.cnf and /etc/my.cnf.d directory, that other packages should use

This commit is contained in:
Honza Horak 2018-07-18 00:41:53 +02:00
parent bf2348b347
commit f3adb89b97
3 changed files with 52 additions and 1 deletions

13
client.cnf Normal file
View File

@ -0,0 +1,13 @@
#
# These two groups are read by the client library
# Use it for options that affect all clients, but not the server
#
[client]
# This group is not read by mysql client library,
# If you use the same .cnf file for MySQL and MariaDB,
# use it for MariaDB-only client options
[client-mariadb]

View File

@ -1,9 +1,11 @@
Name: mariadb-connector-c
Version: 3.0.5
Release: 2%{?dist}
Release: 3%{?dist}
Summary: The MariaDB Native Client library (C driver)
License: LGPLv2+
Source: https://downloads.mariadb.org/interstitial/connector-c-%{version}/mariadb-connector-c-%{version}-src.tar.gz
Source2: my.cnf
Source3: client.cnf
Url: http://mariadb.org/
# More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
@ -28,6 +30,17 @@ Development files for mariadb-connector-c.
Contains everything needed to build against libmariadb.so >=3 client library.
%package config
Summary: Configuration files for mariadb-connector-c
BuildArch: noarch
%description config
This package delivers /etc/my.cnf that includes other configuration files
from the /etc/my.cnf.d directory and ships this directory as well.
Other packages should only put their files into /etc/my.cnf.d directory
and require this package, so the /etc/my.cnf file is present.
%prep
%setup -q -n mariadb-connector-c-%{version}-src
@ -85,6 +98,10 @@ rm %{buildroot}%{_libdir}/lib*.a
ln -s mariadb_config %{buildroot}%{_bindir}/mysql_config
ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql/mysql_version.h
# Install config files
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/my.cnf
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf
%check
@ -144,6 +161,12 @@ end
%license COPYING.LIB
%files config
%dir %{_sysconfdir}/my.cnf.d
%config(noreplace) %{_sysconfdir}/my.cnf
%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
# RPMLint issues from 2.3.2 release tracked on the upstream JIRA:
# https://jira.mariadb.org/browse/CONC-232
@ -153,6 +176,10 @@ end
# https://jira.mariadb.org/browse/CONC-291
%changelog
* Tue Jul 17 2018 Honza Horak <hhorak@redhat.com> - 3.0.5-3
- Add -config sub-package that delivers system-wide /etc/my.cnf and
/etc/my.cnf.d directory, that other packages should use
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

11
my.cnf Normal file
View File

@ -0,0 +1,11 @@
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d