Blame SPECS/mariadb-connector-c.spec

95fc2b
# For deep debugging we need to build binaries with extra debug info
95fc2b
%bcond_with     debug
95fc2b
95fc2b
Name:           mariadb-connector-c
95fc2b
Version:        3.1.11
95fc2b
Release:        2%{?with_debug:.debug}%{?dist}
95fc2b
Summary:        The MariaDB Native Client library (C driver)
95fc2b
License:        LGPLv2+
95fc2b
Source:         https://downloads.mariadb.org/interstitial/connector-c-%{version}/mariadb-connector-c-%{version}-src.tar.gz
95fc2b
Source2:        my.cnf
95fc2b
Source3:        client.cnf
95fc2b
Url:            http://mariadb.org/
95fc2b
# More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
95fc2b
95fc2b
Requires:       %{_sysconfdir}/my.cnf
95fc2b
BuildRequires:  zlib-devel cmake openssl-devel gcc-c++
95fc2b
# Remote-IO plugin
95fc2b
BuildRequires:  libcurl-devel
95fc2b
# auth_gssapi_client plugin
95fc2b
BuildRequires:  krb5-devel
95fc2b
95fc2b
Requires:       ( mariadb >= 3:10.3.27 if mariadb )
95fc2b
Requires:       ( %{name}-config = %{version}-%{release} if %{name}-config )
95fc2b
95fc2b
%description
95fc2b
The MariaDB Native Client library (C driver) is used to connect applications
95fc2b
developed in C/C++ to MariaDB and MySQL databases.
95fc2b
95fc2b
95fc2b
95fc2b
%package devel
95fc2b
Summary:        Development files for mariadb-connector-c
95fc2b
Requires:       %{name} = %{version}-%{release}
95fc2b
Requires:       openssl-devel zlib-devel
95fc2b
BuildRequires:  multilib-rpm-config
95fc2b
Conflicts:      mysql-devel
95fc2b
95fc2b
Requires:       ( mariadb-devel >= 3:10.3.27 if mariadb-devel )
95fc2b
95fc2b
%description devel
95fc2b
Development files for mariadb-connector-c.
95fc2b
Contains everything needed to build against libmariadb.so >=3 client library.
95fc2b
95fc2b
95fc2b
95fc2b
%package config
95fc2b
Summary:        Configuration files for packages that use /etc/my.cnf as a configuration file
95fc2b
BuildArch:      noarch
95fc2b
Obsoletes:      mariadb-config <= 3:10.3.8-4
95fc2b
95fc2b
%description config
95fc2b
This package delivers /etc/my.cnf that includes other configuration files
95fc2b
from the /etc/my.cnf.d directory and ships this directory as well.
95fc2b
Other packages should only put their files into /etc/my.cnf.d directory
95fc2b
and require this package, so the /etc/my.cnf file is present.
95fc2b
95fc2b
95fc2b
95fc2b
%prep
95fc2b
%setup -q -n %{name}-%{version}-src
95fc2b
95fc2b
# Remove unsused parts
95fc2b
rm -r win zlib win-iconv
95fc2b
95fc2b
95fc2b
95fc2b
%build
95fc2b
%{set_build_flags}
95fc2b
95fc2b
# Override all optimization flags when making a debug build
95fc2b
%{?with_debug: CFLAGS="$CFLAGS -O0 -g"}
95fc2b
CXXFLAGS="$CFLAGS"
95fc2b
export CFLAGS CXXFLAGS
95fc2b
95fc2b
# https://jira.mariadb.org/browse/MDEV-13836:
95fc2b
#   The server has (used to have for ages) some magic around the port number.
95fc2b
#   If it's 0, the default port value will use getservbyname("mysql", "tcp"), that is, whatever is written in /etc/services.
95fc2b
#   If it's a positive number, say, 3306, it will be 3306, no matter what /etc/services say.
95fc2b
#   I don't know if that behavior makes much sense, /etc/services wasn't supposed to be a system configuration file.
95fc2b
95fc2b
# The INSTALL_xxx macros have to be specified relative to CMAKE_INSTALL_PREFIX
95fc2b
# so we can't use %%{_datadir} and so forth here.
95fc2b
95fc2b
%cmake . \
95fc2b
       -DCMAKE_BUILD_TYPE="%{?with_debug:Debug}%{!?with_debug:RelWithDebInfo}" \
95fc2b
       -DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \
95fc2b
\
95fc2b
       -DMARIADB_UNIX_ADDR=%{_sharedstatedir}/mysql/mysql.sock \
95fc2b
       -DMARIADB_PORT=3306 \
95fc2b
\
95fc2b
       -DWITH_EXTERNAL_ZLIB=YES \
95fc2b
       -DWITH_SSL=OPENSSL \
95fc2b
       -DWITH_MYSQLCOMPAT=ON \
95fc2b
       -DPLUGIN_CLIENT_ED25519=DYNAMIC \
95fc2b
\
95fc2b
       -DINSTALL_LAYOUT=RPM \
95fc2b
       -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
95fc2b
       -DINSTALL_BINDIR="bin" \
95fc2b
       -DINSTALL_LIBDIR="%{_lib}" \
95fc2b
       -DINSTALL_INCLUDEDIR="include/mysql" \
95fc2b
       -DINSTALL_PLUGINDIR="%{_lib}/mariadb/plugin" \
95fc2b
       -DINSTALL_PCDIR="%{_lib}/pkgconfig" \
95fc2b
\
95fc2b
       -DWITH_UNITTEST=ON
95fc2b
95fc2b
95fc2b
95fc2b
#cmake -LAH
95fc2b
95fc2b
%make_build
95fc2b
95fc2b
95fc2b
95fc2b
%install
95fc2b
%make_install
95fc2b
95fc2b
%multilib_fix_c_header --file %{_includedir}/mysql/mariadb_version.h
95fc2b
95fc2b
# Remove static linked libraries and symlinks to them
95fc2b
rm %{buildroot}%{_libdir}/lib*.a
95fc2b
95fc2b
# Add a compatibility symlinks
95fc2b
ln -s mariadb_config %{buildroot}%{_bindir}/mysql_config
95fc2b
ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql/mysql_version.h
95fc2b
95fc2b
# Install config files
95fc2b
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/my.cnf
95fc2b
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf
95fc2b
95fc2b
95fc2b
95fc2b
%check
95fc2b
# Check the generated configuration on the actual machine
95fc2b
%{buildroot}%{_bindir}/mariadb_config
95fc2b
95fc2b
# Run the unit tests
95fc2b
# - don't run mytap tests
95fc2b
# - ignore the testsuite result for now. Enable tests now, fix them later.
95fc2b
# Note: there must be a database called 'test' created for the testcases to be run
95fc2b
pushd unittest/libmariadb/
95fc2b
ctest || :
95fc2b
popd
95fc2b
95fc2b
95fc2b
95fc2b
%files
95fc2b
%{_libdir}/libmariadb.so.3
95fc2b
95fc2b
%dir %{_libdir}/mariadb
95fc2b
%dir %{_libdir}/mariadb/plugin
95fc2b
%{_libdir}/mariadb/plugin/*
95fc2b
95fc2b
%doc README
95fc2b
%license COPYING.LIB
95fc2b
95fc2b
95fc2b
95fc2b
%files devel
95fc2b
# Binary which provides compiler info for software compiling against this library
95fc2b
%{_bindir}/mariadb_config
95fc2b
%{_bindir}/mysql_config
95fc2b
95fc2b
# Symlinks to the versioned library
95fc2b
%{_libdir}/libmariadb.so
95fc2b
%{_libdir}/libmysqlclient.so
95fc2b
%{_libdir}/libmysqlclient_r.so
95fc2b
95fc2b
# Pkgconfig
95fc2b
%{_libdir}/pkgconfig/libmariadb.pc
95fc2b
95fc2b
# Header files
95fc2b
%dir %{_includedir}/mysql
95fc2b
%{_includedir}/mysql/*
95fc2b
95fc2b
%license COPYING.LIB
95fc2b
95fc2b
95fc2b
%files config
95fc2b
%dir %{_sysconfdir}/my.cnf.d
95fc2b
%config(noreplace) %{_sysconfdir}/my.cnf
95fc2b
%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
95fc2b
95fc2b
95fc2b
95fc2b
%changelog
95fc2b
* Thu Dec 03 2020 Michal Schorm <mschorm@redhat.com> - 3.1.11-2
95fc2b
- Require specific minimal version of the 'mariadb' package, if it is installed
95fc2b
95fc2b
* Tue Nov 10 2020 Michal Schorm <mschorm@redhat.com> - 3.1.11-1
95fc2b
- Rebase to 3.1.11
95fc2b
95fc2b
* Wed Jun 24 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3.1.9-1
95fc2b
- Rebase to 3.1.9
95fc2b
- Overlinking issues fixed by upstream in 3.1.3 release
95fc2b
- Add explicit confict between mariadb-connector-c-devel and mysql-devel packages
95fc2b
95fc2b
* Fri Jul 12 2019 Michal Schorm <mschorm@redhat.com> - 3.1.2-1
95fc2b
- Rebase to 3.1.2
95fc2b
- Introducing ED25519 plugin
95fc2b
- Plugindir issues (from 3.0.9 release) fixed by upstream
95fc2b
  Resolves: #1691176
95fc2b
95fc2b
* Wed May 15 2019 Michal Schorm <mschorm@redhat.com> - 3.0.10-1
95fc2b
- Rebase to 3.0.10
95fc2b
- Use macro for tarball name
95fc2b
- Use macro to set build flags
95fc2b
- Use macros for make commands
95fc2b
- Remove the scriptlets non relevant for RHEL-8
95fc2b
- Add info for the testsuite execution
95fc2b
- Remove glob from library version
95fc2b
- Remove info about the upstream issues
95fc2b
95fc2b
* Fri Mar 29 2019 Michal Schorm <mschorm@redhat.com> - 3.0.8-2
95fc2b
- Add "zlib-devel" requirement in "-devel" subpackage. MariaDB requires
95fc2b
  linking with "-lz", which will fail without the zlib library
95fc2b
- Resolves: #1710471
95fc2b
95fc2b
* Wed Jan 02 2019 Michal Schorm <mschorm@redhat.com> - 3.0.8-1
95fc2b
- Rebase to 3.0.8
95fc2b
95fc2b
* Mon Dec 10 2018 Michal Schorm <mschorm@redhat.com> - 3.0.7-1
95fc2b
- Rebase to 3.0.7
95fc2b
95fc2b
* Tue Sep 04 2018 Michal Schorm <mschorm@redhat.com> - 3.0.6-2
95fc2b
- Fix parallel installability of x86_64 and i686 devel package
95fc2b
- Resolves: #1637031
95fc2b
95fc2b
* Fri Aug 03 2018 Michal Schorm <mschorm@redhat.com> - 3.0.6-1
95fc2b
- Rebase to 3.0.6
95fc2b
95fc2b
* Tue Jul 17 2018 Honza Horak <hhorak@redhat.com> - 3.0.5-2
95fc2b
- Add -config sub-package that delivers system-wide /etc/my.cnf and
95fc2b
  /etc/my.cnf.d directory, that other packages should use
95fc2b
  This package also obsoletes mariadb-config
95fc2b
95fc2b
* Fri Jun 08 2018 Michal Schorm <mschorm@redhat.com> - 3.0.5-1
95fc2b
- Rebase to 3.0.5
95fc2b
95fc2b
* Thu Apr 26 2018 Michal Schorm <mschorm@redhat.com> - 3.0.4-1
95fc2b
- Rebase to 3.0.4
95fc2b
95fc2b
* Mon Apr 23 2018 Michal Schorm <mschorm@redhat.com> - 3.0.3-4
95fc2b
- Further fix of the '--plugindir' output from the config binary
95fc2b
  Realted: #1569159
95fc2b
95fc2b
* Wed Mar 21 2018 Richard W.M. Jones <rjones@redhat.com> - 3.0.3-3
95fc2b
- Fix plugin install directory (INSTALL_PLUGINDIR not PLUGIN_INSTALL_DIR).
95fc2b
95fc2b
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.3-2
95fc2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
95fc2b
95fc2b
* Fri Jan 19 2018 Michal Schorm <mschorm@redhat.com> - 3.0.3-1
95fc2b
- Rebase to 3.0.3
95fc2b
95fc2b
* Mon Nov 27 2017 Honza Horak <hhorak@redhat.com> - 3.0.2-21
95fc2b
- Remove unneeded dependency on xmlto
95fc2b
95fc2b
* Tue Nov 14 2017 Pavel Raiskup <praiskup@redhat.com> - 3.0.2-19
95fc2b
- drop misleading provides
95fc2b
95fc2b
* Wed Nov 08 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-19
95fc2b
- Move the scriptlet to the correct package
95fc2b
95fc2b
* Thu Nov 02 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-18
95fc2b
- Fix typo in require
95fc2b
95fc2b
* Wed Nov 01 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-17
95fc2b
- Use correct require for OpenSSL
95fc2b
95fc2b
* Wed Nov 01 2017 Merlin Mathesius <mmathesi@redhat.com> - 3.0.2-16
95fc2b
- Correct typo in spec file conditional
95fc2b
95fc2b
* Tue Oct 31 2017 Merlin Mathesius <mmathesi@redhat.com> - 3.0.2-15
95fc2b
- Cleanup spec file conditionals
95fc2b
95fc2b
* Tue Oct 31 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-14
95fc2b
- Remove Requires for openssl. Managed by RPM.
95fc2b
95fc2b
* Mon Oct 30 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-13
95fc2b
- Update scriplet dealing with symlinks as Guidelines suggests
95fc2b
  Related: #1501933
95fc2b
95fc2b
* Thu Oct 26 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-12
95fc2b
- Move library directly to libdir, don't create any symlinks to directories
95fc2b
- Update scritplets, so they only check for old symlinks to directories
95fc2b
  Related: #1501933
95fc2b
- Add 'Conflicts' with mariadb package on F<28
95fc2b
  Related: #1506441
95fc2b
95fc2b
* Mon Oct 09 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-11
95fc2b
- Fix ldconfig path
95fc2b
95fc2b
* Wed Oct 04 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-10
95fc2b
- Add scriptlets to handle errors in /usr/lib64/ created by older versions
95fc2b
  of mariadb and mariadb-connector-c pakages
95fc2b
95fc2b
* Wed Sep 20 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-9
95fc2b
- Add symlinks so more packages will build succesfully
95fc2b
- Change libdir from .../lib64/mariadb to mysql
95fc2b
  Related: #1497234
95fc2b
95fc2b
* Wed Sep 13 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-7
95fc2b
- Move header files to the same location, as they would be in mariadb-server
95fc2b
- Add provides "libmysqlclient.so"
95fc2b
95fc2b
* Tue Sep 05 2017 Honza Horak <hhorak@redhat.com> - 3.0.2-5
95fc2b
- Remove a symlink /usr/lib64/mysql that conflicts with mariadb-libs
95fc2b
95fc2b
* Mon Aug 14 2017 Honza Horak <hhorak@redhat.com> - 3.0.2-4
95fc2b
- Add compatibility symlinks
95fc2b
95fc2b
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-3
95fc2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
95fc2b
95fc2b
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
95fc2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
95fc2b
95fc2b
* Wed Jun 07 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-1
95fc2b
- Rebase to version 3.0.2
95fc2b
- Library libmariadb.so.3 introduced
95fc2b
- Plugin Remote-IO enabled
95fc2b
95fc2b
* Wed Jun 07 2017 Michal Schorm <mschorm@redhat.com> - 2.3.3-1
95fc2b
- Rebase to version 2.3.3
95fc2b
- Patch dropped, solved by upstream; https://jira.mariadb.org/browse/CONC-231
95fc2b
95fc2b
* Tue Feb 07 2017 Michal Schorm <mschorm@redhat.com> - 2.3.2-2
95fc2b
- Fix based on output from RPMLint in previous version
95fc2b
95fc2b
* Tue Jan 24 2017 Michal Schorm <mschorm@redhat.com> - 2.3.2-1
95fc2b
- Rebase to version 2.3.2, patch needed (fixed by upstream in later versions)
95fc2b
- Plugin dir moved from /libdir/plugin to /libdir/mariadb/plugin
95fc2b
95fc2b
* Thu Oct 27 2016 Michal Schorm <mschorm@redhat.com> - 2.3.1-3
95fc2b
- Fixed ownership of {_libdir}/mariadb (this dir must me owned by package)
95fc2b
- Fixed ownership of {_sysconfigdir}/ld.so.conf.d (this dir must me owned by package)
95fc2b
- Fixed redundnace on lines with {_sysconfigdir}/ld.so.conf.d
95fc2b
- Fixed ownership of {_bindir} (only one program is owned, so let's be accurate)
95fc2b
- Some comments added, for me and future maintainers
95fc2b
95fc2b
* Mon Oct 17 2016 Michal Schorm <mschorm@redhat.com> - 2.3.1-2
95fc2b
- Fixed ownership of {_libdir}/mariadb directory and cosmetic specfile changes
95fc2b
95fc2b
* Tue Sep 13 2016 Michal Schorm <mschorm@redhat.com> - 2.3.1-1
95fc2b
- Rebase to version 2.3.1
95fc2b
95fc2b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
95fc2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
95fc2b
95fc2b
* Thu Jul 23 2015 Matej Mužila <mmuzila@redhat.com> - 2.1.0-1
95fc2b
- Rebase to version 2.1.0
95fc2b
95fc2b
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-3
95fc2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
95fc2b
95fc2b
* Wed Sep 24 2014 Matej Mužila <mmuzila@redhat.com> - 2.0.0-2
95fc2b
- Fixed html IDs in documentation
95fc2b
95fc2b
* Tue Aug 26 2014 Matej Mužila <mmuzila@redhat.com> - 2.0.0-2
95fc2b
- Initial version for 2.0.0