b3eef80
# For deep debugging we need to build binaries with extra debug info
b3eef80
%bcond_with     debug
b3eef80
4deac40
Name:           mariadb-connector-c
ded4d90
Version:        3.1.7
ded4d90
Release:        1%{?with_debug:.debug}%{?dist}
4deac40
Summary:        The MariaDB Native Client library (C driver)
4deac40
License:        LGPLv2+
3d89935
Source:         https://downloads.mariadb.org/interstitial/connector-c-%{version}/%{name}-%{version}-src.tar.gz
f3adb89
Source2:        my.cnf
f3adb89
Source3:        client.cnf
ac3f8b7
Url:            http://mariadb.org/
039fdbe
# More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
039fdbe
8671500
Patch1:         testsuite.patch
8671500
c1e850f
Requires:       %{_sysconfdir}/my.cnf
b906903
BuildRequires:  zlib-devel cmake openssl-devel gcc-c++
e231d8c
# Remote-IO plugin
e231d8c
BuildRequires:  libcurl-devel
9c95f3b
# auth_gssapi_client plugin
9c95f3b
BuildRequires:  krb5-devel
470b182
470b182
%description
470b182
The MariaDB Native Client library (C driver) is used to connect applications
470b182
developed in C/C++ to MariaDB and MySQL databases.
470b182
039fdbe
039fdbe
470b182
%package devel
8c79813
Summary:        Development files for mariadb-connector-c
018ad16
Requires:       %{name} = %{version}-%{release}
8781fc3
Requires:       openssl-devel zlib-devel
ac1a1e2
BuildRequires:  multilib-rpm-config
470b182
470b182
%description devel
470b182
Development files for mariadb-connector-c.
039fdbe
Contains everything needed to build against libmariadb.so >=3 client library.
4deac40
4deac40
99639b2
8671500
%package test
8671500
Summary:        Testsuite files for mariadb-connector-c
8671500
Requires:       %{name} = %{version}-%{release}
8671500
Requires:       cmake
8671500
Recommends:     mariadb-server
8671500
8671500
%description test
8671500
Testsuite files for mariadb-connector-c.
8671500
Contains binaries and a prepared CMake ctest file.
8671500
Requires running MariaDB / MySQL server with create database "test".
8671500
8671500
8671500
f3adb89
%package config
99639b2
Summary:        Configuration files for packages that use /etc/my.cnf as a configuration file
f3adb89
BuildArch:      noarch
dd98104
Obsoletes:      mariadb-config <= 3:10.3.8-4
f3adb89
f3adb89
%description config
f3adb89
This package delivers /etc/my.cnf that includes other configuration files
f3adb89
from the /etc/my.cnf.d directory and ships this directory as well.
f3adb89
Other packages should only put their files into /etc/my.cnf.d directory
f3adb89
and require this package, so the /etc/my.cnf file is present.
f3adb89
f3adb89
99639b2
470b182
%prep
b2aac80
%setup -q -n %{name}-%{version}-src
8671500
%patch1 -p1
470b182
039fdbe
# Remove unsused parts
039fdbe
rm -r win zlib win-iconv examples
039fdbe
039fdbe
039fdbe
470b182
%build
6cca8d7
%{set_build_flags}
6cca8d7
b3eef80
# Override all optimization flags when making a debug build
b3eef80
%{?with_debug: CFLAGS="$CFLAGS -O0 -g"}
b3eef80
CXXFLAGS="$CFLAGS"
b3eef80
export CFLAGS CXXFLAGS
018ad16
018ad16
# https://jira.mariadb.org/browse/MDEV-13836:
018ad16
#   The server has (used to have for ages) some magic around the port number.
018ad16
#   If it's 0, the default port value will use getservbyname("mysql", "tcp"), that is, whatever is written in /etc/services.
018ad16
#   If it's a positive number, say, 3306, it will be 3306, no matter what /etc/services say.
018ad16
#   I don't know if that behavior makes much sense, /etc/services wasn't supposed to be a system configuration file.
018ad16
db2966c
# The INSTALL_* macros have to be specified relative to CMAKE_INSTALL_PREFIX
018ad16
# so we can't use %%{_datadir} and so forth here.
018ad16
e231d8c
%cmake . \
c4d9f6f
       -DCMAKE_BUILD_TYPE="%{?with_debug:Debug}%{!?with_debug:RelWithDebInfo}" \
e231d8c
       -DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \
039fdbe
\
018ad16
       -DMARIADB_UNIX_ADDR=%{_sharedstatedir}/mysql/mysql.sock \
039fdbe
       -DMARIADB_PORT=3306 \
039fdbe
\
039fdbe
       -DWITH_EXTERNAL_ZLIB=YES \
039fdbe
       -DWITH_SSL=OPENSSL \
e231d8c
       -DWITH_MYSQLCOMPAT=ON \
3228be7
       -DPLUGIN_CLIENT_ED25519=DYNAMIC \
039fdbe
\
e231d8c
       -DINSTALL_LAYOUT=RPM \
018ad16
       -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
018ad16
       -DINSTALL_BINDIR="bin" \
018ad16
       -DINSTALL_LIBDIR="%{_lib}" \
018ad16
       -DINSTALL_INCLUDEDIR="include/mysql" \
018ad16
       -DINSTALL_PLUGINDIR="%{_lib}/mariadb/plugin" \
6ff6144
       -DINSTALL_PCDIR="%{_lib}/pkgconfig" \
f824750
\
f824750
       -DWITH_UNITTEST=ON
e231d8c
cd885ff
#cmake ./ -LAH
470b182
fa32028
%make_build
470b182
039fdbe
039fdbe
470b182
%install
fa32028
%make_install
ab4d524
ac1a1e2
%multilib_fix_c_header --file %{_includedir}/mysql/mariadb_version.h
ac1a1e2
039fdbe
# Remove static linked libraries and symlinks to them
018ad16
rm %{buildroot}%{_libdir}/lib*.a
ab4d524
039fdbe
# Add a compatibility symlinks
71fa318
ln -s mariadb_config %{buildroot}%{_bindir}/mysql_config
039fdbe
ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql/mysql_version.h
2d57994
f3adb89
# Install config files
f3adb89
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/my.cnf
f3adb89
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf
f3adb89
d052d17
d052d17
f824750
%check
018ad16
# Check the generated configuration on the actual machine
018ad16
%{buildroot}%{_bindir}/mariadb_config
f824750
f824750
# Run the unit tests
f824750
# - don't run mytap tests
f824750
# - ignore the testsuite result for now. Enable tests now, fix them later.
79c3b16
# Note: there must be a database called 'test' created for the testcases to be run
f824750
pushd unittest/libmariadb/
f824750
ctest || :
f824750
popd
f824750
f824750
f824750
470b182
%files
239038b
%{_libdir}/libmariadb.so.3
8c79813
039fdbe
%dir %{_libdir}/mariadb
039fdbe
%dir %{_libdir}/mariadb/plugin
039fdbe
%{_libdir}/mariadb/plugin/*
54a433a
54a433a
%doc README
54a433a
%license COPYING.LIB
54a433a
54a433a
470b182
e5dd63c
%files devel
039fdbe
# Binary which provides compiler info for software compiling against this library
e5dd63c
%{_bindir}/mariadb_config
71fa318
%{_bindir}/mysql_config
8c79813
039fdbe
# Symlinks to the versioned library
039fdbe
%{_libdir}/libmariadb.so
039fdbe
%{_libdir}/libmysqlclient.so
039fdbe
%{_libdir}/libmysqlclient_r.so
8c79813
71d6c1a
# Pkgconfig
71d6c1a
%{_libdir}/pkgconfig/libmariadb.pc
71d6c1a
039fdbe
# Header files
039fdbe
%dir %{_includedir}/mysql
039fdbe
%{_includedir}/mysql/*
4deac40
470b182
039fdbe
f3adb89
%files config
f3adb89
%dir %{_sysconfdir}/my.cnf.d
f3adb89
%config(noreplace) %{_sysconfdir}/my.cnf
f3adb89
%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
f3adb89
f3adb89
039fdbe
8671500
%files test
8671500
%dir %{_datadir}/%{name}
8671500
%{_datadir}/%{name}/*
8671500
%{_libdir}/libcctap.so
8671500
8671500
8671500
500aa3b
# Opened issues on the upstream tracker:
500aa3b
#   https://jira.mariadb.org/browse/CONC-293
500aa3b
#      DESCRIPTION: add mysql_config and mariadb_config man page
500aa3b
#      IN_PROGRESS: upsteam plans to add it to 3.1 release
ad54a14
#   https://jira.mariadb.org/browse/CONC-410
ad54a14
#      DESCRIPTION: Fix pkgconfig file - overlinking issues
ad54a14
#      IN_PROGRESS: PR submitted, problem consulted & explained, waiting on upstream response
239038b
#   https://jira.mariadb.org/browse/CONC-436
239038b
#      DESCRIPTION: Make testsuite independent / portable
239038b
#      NEW:         PR submitted, problem explained, waiting on upstream response
500aa3b
500aa3b
# Coverity Scan results from 3.0.10 release:
039fdbe
#   https://jira.mariadb.org/browse/CONC-234
500aa3b
#      DESCRIPTION: Covscan report
500aa3b
#      TODO:        Check atleast the important issues
039fdbe
e9a42f0
# Downstream issues:
e9a42f0
#   Start running this package testsuite at the build time
e9a42f0
#      It requires a running MariaDB server
e9a42f0
#         mariadb-server package pulls in mariadb-connector-c as a dependency
e9a42f0
#         Need to ensure, that the testsuite is ran against the newly build library, instead of the one from the pulled package
e9a42f0
#      Need to ensure, that the testsuite will also run properly on 'fedpkg local' buid, not damaging the host machine
e9a42f0
470b182
%changelog
ded4d90
* Mon Feb 03 2020 Michal Schorm <mschorm@redhat.com> - 3.1.7-1
ded4d90
- Rebase to 3.1.7
ded4d90
2718ac4
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-2
2718ac4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2718ac4
8f4140f
* Tue Dec 17 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3.1.6-1
8f4140f
- Rebase to 3.1.6
8f4140f
386a5aa
* Tue Nov 12 2019 Michal Schorm <mschorm@redhat.com> - 3.1.5-1
386a5aa
- Rebase to 3.1.5
386a5aa
4ee332f
* Sun Nov 03 2019 Michal Schorm <mschorm@redhat.com> - 3.1.4-2
4ee332f
- Fix for #1624533
4ee332f
3d89935
* Wed Sep 18 2019 Lukas Javorsky <ljavorsk@redhat.com> - 3.1.4-1
3d89935
- Rebase to 3.1.4
3d89935
3228be7
* Wed Sep 11 2019 Michal Schorm <mschorm@redhat.com> - 3.1.3-3
3228be7
- Enable building of the ed25519 client plugin.
3228be7
  It won't be shipped anymore by 'mariadb-server'
3228be7
8671500
* Mon Aug 19 2019 Michal Schorm <mschorm@redhat.com> - 3.1.3-2
8671500
- Extract the prepared testsuite to the standalone subpackage so it can be run outside of the buildroot
8671500
1c023f4
* Fri Aug 02 2019 Michal Schorm <mschorm@redhat.com> - 3.1.3-1
1c023f4
- Rebase to 3.1.3 version
1c023f4
- Patch upstreamed
239038b
- Remove glob from library version, as per Fedora Packaging Guidelines
1c023f4
6cca8d7
* Fri Jul 19 2019 Michal Schorm <mschorm@redhat.com> - 3.1.2-2
6cca8d7
- Use macro to set build flags
6cca8d7
db2966c
* Fri Jul 12 2019 Michal Schorm <mschorm@redhat.com> - 3.1.2-1
db2966c
- Rebase to 3.1 version
db2966c
- Disabling the ED25519 plugin
db2966c
- Plugindir patch upstreamed
b3eef80
- Added debug build switch
db2966c
ad54a14
* Tue May 21 2019 Michal Schorm <mschorm@redhat.com> - 3.0.10-2
ad54a14
- Fix overlinking issues
ad54a14
9c95f3b
* Wed May 15 2019 Michal Schorm <mschorm@redhat.com> - 3.0.10-1
9c95f3b
- Rebase to 3.0.10
92bc0a3
- Remove scriplet; no longer needed
9c95f3b
8781fc3
* Fri Mar 29 2019 Michal Schorm <mschorm@redhat.com> - 3.0.9-3
8781fc3
- Add "zlib-devel" requirement in "-devel" subpackage. MariaDB requires
8781fc3
  linking with "-lz", which will fail without the zlib library
8781fc3
- Related: #1693966
8781fc3
6d76f1c
* Mon Feb 18 2019 Michal Schorm <mschorm@redhat.com> - 3.0.9-2
6d76f1c
- Fix plugindir issues
6d76f1c
  Resolves: #1624533
6d76f1c
94ac5ea
* Mon Feb 18 2019 Michal Schorm <mschorm@redhat.com> - 3.0.9-1
94ac5ea
- Rebase to 3.0.9
94ac5ea
01fba47
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.8-2
01fba47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
01fba47
6ff6144
* Wed Jan 02 2019 Michal Schorm <mschorm@redhat.com> - 3.0.8-1
6ff6144
- Rebase to 3.0.8
6ff6144
71d6c1a
* Mon Nov 19 2018 Michal Schorm <mschorm@redhat.com> - 3.0.7-1
71d6c1a
- Rebase to 3.0.7
71d6c1a
ac1a1e2
* Tue Sep 04 2018 Michal Schorm <mschorm@redhat.com> - 3.0.6-2
ac1a1e2
- Fix parallel installability of x86_64 and i686 devel package
ac1a1e2
99639b2
* Fri Aug 03 2018 Michal Schorm <mschorm@redhat.com> - 3.0.6-1
99639b2
- Rebase to 3.0.6
99639b2
f3adb89
* Tue Jul 17 2018 Honza Horak <hhorak@redhat.com> - 3.0.5-3
f3adb89
- Add -config sub-package that delivers system-wide /etc/my.cnf and
f3adb89
  /etc/my.cnf.d directory, that other packages should use
c1e850f
  This package also obsoletes mariadb-config
f3adb89
bf2348b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-2
bf2348b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
bf2348b
aaedab5
* Fri Jun 08 2018 Michal Schorm <mschorm@redhat.com> - 3.0.5-1
aaedab5
- Rebase to 3.0.5
aaedab5
48ce0c2
* Thu Apr 26 2018 Michal Schorm <mschorm@redhat.com> - 3.0.4-1
48ce0c2
- Rebase to 3.0.4
48ce0c2
921a542
* Mon Apr 23 2018 Michal Schorm <mschorm@redhat.com> - 3.0.3-4
921a542
- Further fix of the '--plugindir' output from the config binary
921a542
  Realted: #1569159
921a542
17ca9eb
* Wed Mar 21 2018 Richard W.M. Jones <rjones@redhat.com> - 3.0.3-3
17ca9eb
- Fix plugin install directory (INSTALL_PLUGINDIR not PLUGIN_INSTALL_DIR).
17ca9eb
11d41cb
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-2
11d41cb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
11d41cb
3877fa3
* Fri Jan 19 2018 Michal Schorm <mschorm@redhat.com> - 3.0.3-1
3877fa3
- Rebase to 3.0.3
3877fa3
df07f0b
* Mon Nov 27 2017 Honza Horak <hhorak@redhat.com> - 3.0.2-21
df07f0b
- Remove unneeded dependency on xmlto
df07f0b
76721c6
* Tue Nov 14 2017 Pavel Raiskup <praiskup@redhat.com> - 3.0.2-19
76721c6
- drop misleading provides
76721c6
ed31588
* Wed Nov 08 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-19
ed31588
- Move the scriptlet to the correct package
ed31588
7b01eba
* Thu Nov 02 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-18
7b01eba
- Fix typo in require
7b01eba
5c3882f
* Wed Nov 01 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-17
5c3882f
- Use correct require for OpenSSL
5c3882f
f43b0be
* Wed Nov 01 2017 Merlin Mathesius <mmathesi@redhat.com> - 3.0.2-16
f43b0be
- Correct typo in spec file conditional
f43b0be
b21c803
* Tue Oct 31 2017 Merlin Mathesius <mmathesi@redhat.com> - 3.0.2-15
b21c803
- Cleanup spec file conditionals
b21c803
a6da40c
* Tue Oct 31 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-14
a6da40c
- Remove Requires for openssl. Managed by RPM.
a6da40c
d37e9dc
* Mon Oct 30 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-13
a6da40c
- Update scriplet dealing with symlinks as Guidelines suggests
d37e9dc
  Related: #1501933
d37e9dc
039fdbe
* Thu Oct 26 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-12
039fdbe
- Move library directly to libdir, don't create any symlinks to directories
039fdbe
- Update scritplets, so they only check for old symlinks to directories
039fdbe
  Related: #1501933
039fdbe
- Add 'Conflicts' with mariadb package on F<28
039fdbe
  Related: #1506441
039fdbe
949ef84
* Mon Oct 09 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-11
949ef84
- Fix ldconfig path
949ef84
d052d17
* Wed Oct 04 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-10
d052d17
- Add scriptlets to handle errors in /usr/lib64/ created by older versions
d052d17
  of mariadb and mariadb-connector-c pakages
d052d17
3f6ef01
* Wed Sep 20 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-9
2640042
- Add symlinks so more packages will build succesfully
3f6ef01
- Change libdir from .../lib64/mariadb to mysql
3f6ef01
  Related: #1497234
2640042
f1c2799
* Wed Sep 13 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-7
f1c2799
- Move header files to the same location, as they would be in mariadb-server
f1c2799
- Add provides "libmysqlclient.so"
2d57994
43f97fe
* Tue Sep 05 2017 Honza Horak <hhorak@redhat.com> - 3.0.2-5
43f97fe
- Remove a symlink /usr/lib64/mysql that conflicts with mariadb-libs
43f97fe
71fa318
* Mon Aug 14 2017 Honza Horak <hhorak@redhat.com> - 3.0.2-4
71fa318
- Add compatibility symlinks
71fa318
b3cfa73
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-3
b3cfa73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
b3cfa73
0ebca0a
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
0ebca0a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0ebca0a
e231d8c
* Wed Jun 07 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-1
e231d8c
- Rebase to version 3.0.2
e231d8c
- Library libmariadb.so.3 introduced
e231d8c
- Plugin Remote-IO enabled
e231d8c
d4edcb7
* Wed Jun 07 2017 Michal Schorm <mschorm@redhat.com> - 2.3.3-1
d4edcb7
- Rebase to version 2.3.3
d4edcb7
- Patch dropped, solved by upstream; https://jira.mariadb.org/browse/CONC-231
d4edcb7
54a433a
* Tue Feb 07 2017 Michal Schorm <mschorm@redhat.com> - 2.3.2-2
54a433a
- Fix based on output from RPMLint in previous version
54a433a
ac3f8b7
* Tue Jan 24 2017 Michal Schorm <mschorm@redhat.com> - 2.3.2-1
54a433a
- Rebase to version 2.3.2, patch needed (fixed by upstream in later versions)
ac3f8b7
- Plugin dir moved from /libdir/plugin to /libdir/mariadb/plugin
ac3f8b7
FaramosCZ 0fb9789
* Thu Oct 27 2016 Michal Schorm <mschorm@redhat.com> - 2.3.1-3
FaramosCZ 0fb9789
- Fixed ownership of {_libdir}/mariadb (this dir must me owned by package)
FaramosCZ 0fb9789
- Fixed ownership of {_sysconfigdir}/ld.so.conf.d (this dir must me owned by package)
FaramosCZ 0fb9789
- Fixed redundnace on lines with {_sysconfigdir}/ld.so.conf.d
FaramosCZ 0fb9789
- Fixed ownership of {_bindir} (only one program is owned, so let's be accurate)
e5dd63c
- Some comments added, for me and future maintainers
FaramosCZ 0fb9789
4deac40
* Mon Oct 17 2016 Michal Schorm <mschorm@redhat.com> - 2.3.1-2
4deac40
- Fixed ownership of {_libdir}/mariadb directory and cosmetic specfile changes
4deac40
ca722dc
* Tue Sep 13 2016 Michal Schorm <mschorm@redhat.com> - 2.3.1-1
ca722dc
- Rebase to version 2.3.1
ca722dc
fb55243
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
fb55243
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fb55243
eba70a7
* Thu Jul 23 2015 Matej Mužila <mmuzila@redhat.com> - 2.1.0-1
eba70a7
- Rebase to version 2.1.0
eba70a7
5c93e84
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-3
5c93e84
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5c93e84
5665b17
* Wed Sep 24 2014 Matej Mužila <mmuzila@redhat.com> - 2.0.0-2
5665b17
- Fixed html IDs in documentation
5665b17
470b182
* Tue Aug 26 2014 Matej Mužila <mmuzila@redhat.com> - 2.0.0-2
470b182
- Initial version for 2.0.0