#7 Add -config sub-package that delivers system-wide /etc/my.cnf and /etc/my.cnf.d directory, that other packages should use
Merged 5 years ago by hhorak. Opened 5 years ago by hhorak.
rpms/ hhorak/mariadb-connector-c config-pkg  into  master

file added
+13
@@ -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]

+ 

file modified
+32 -1
@@ -1,12 +1,15 @@ 

  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/

  

+ Requires:       %{_sysconfdir}/my.cnf

  BuildRequires:  zlib-devel cmake openssl-devel gcc-c++

  # Remote-IO plugin

  BuildRequires:  libcurl-devel
@@ -28,6 +31,19 @@ 

  Contains everything needed to build against libmariadb.so >=3 client library.

  

  

+ %package config

+ Summary:        Configuration files for mariadb-connector-c

+ BuildArch:      noarch

+ Obsoletes:      mariadb-config <= 3:10.3.8-4

+ Provides:       mariadb-config = %{version}-%{release}

+ 

+ %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 +101,10 @@ 

  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 +164,12 @@ 

  %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 +179,11 @@ 

  #   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

+   This package also obsoletes mariadb-config

+ 

  * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

  

file added
+11
@@ -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

+ 

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.

After merging this, we should turn off building mariadb-config package in mariadb component.

Two issues remaining:
mariadb-connector-c should require mariadb-connector-c-config
mariadb-connector-c-config should obsolete mariadb-config

1 new commit added

  • Obsolete mariadb-config and make the main package require /etc/my.cnf
5 years ago

1 new commit added

  • Use Provides and Obsoletes in -config, not main package
5 years ago

No disagreement, I think we can merge.

Pull-Request has been merged by hhorak

5 years ago