Blame SPECS/mariadb-connector-c.spec

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