mariadb-connector-c/mariadb-connector-c.spec

156 lines
4.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package mariadb-connector-c
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%bcond_with sqlite3
%define sover 3
%define libname libmariadb
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
Name: mariadb-connector-c
Version: 3.0.2
Release: 0
Summary: MariaDB connector in C
License: LGPL-2.1+
Group: Development/Libraries/C and C++
Url: https://github.com/MariaDB/mariadb-connector-c
Source: https://downloads.mariadb.com/Connectors/c/connector-c-%{version}/%{name}-%{version}-src.tar.gz
Source1: https://downloads.mariadb.com/Connectors/c/connector-c-%{version}/%{name}-%{version}-src.tar.gz.asc
# Imported from keyserver based on keyid @ https://mariadb.com/kb/en/mariadb-enterprise/mariadb-enterprise-installation-guide/
Source2: mariadb.keyring
Patch1: mariadb-connector-c-2.3.1_unresolved_symbols.patch
Patch3: absolute_path_fix.patch
Patch4: private_library.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake
BuildRequires: curl-devel
BuildRequires: pkgconfig(krb5)
BuildRequires: pkgconfig(krb5-gssapi)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(zlib)
%if %{with sqlite3}
BuildRequires: sqlite3-devel
%endif
%description
MariaDB Connector is used to connect applications developed in
C or C++ to MariaDB and MySQL databases.
%package -n %{libname}%{sover}
Summary: MariaDB connector in C
Group: System/Libraries
%description -n %{libname}%{sover}
MariaDB Connector is used to connect applications developed in
C or C++ to MariaDB and MySQL databases.
This package holds the runtime components.
%package -n %{libname}_plugins
Summary: Plugins for the MariaDB C Connector
Group: System/Libraries
%description -n %{libname}_plugins
MariaDB Connector is used to connect applications developed in
C or C++ to MariaDB and MySQL databases.
This package holds MariaDB library plugins.
%package -n %{libname}private
Summary: Additional internal libraries for the MariaDB C Connector
Group: System/Libraries
%description -n %{libname}private
MariaDB Connector is used to connect applications developed in
C or C++ to MariaDB and MySQL databases.
This package holds the runtime components with private API.
%package -n %{libname}-devel
Requires: %{libname}%{sover} = %{version}
Requires: pkgconfig(openssl)
Summary: Development files for the MariaDB Connector C API
Group: Development/Libraries/C and C++
%description -n %{libname}-devel
MariaDB Connector is used to connect applications developed in
C or C++ to MariaDB and MySQL databases.
This package holds the development files.
%prep
%setup -q -n %{name}-%{version}-src
%patch1 -p1
%patch3 -p1
%patch4 -p1
%build
%cmake \
%if %{with sqlite3}
-DWITH_SQLITE:BOOL=ON \
%endif
-DWITH_EXTERNAL_ZLIB:BOOL=ON \
-DMARIADB_UNIX_ADDR:STRING=%{_rundir}/mysql/mysql.sock \
-DINSTALL_LIBDIR:STRING=%{_libdir}/mariadb \
-DINSTALL_PLUGINDIR:STRING=%{_libdir}/mariadb/plugin/ \
-DWITH_MYSQLCOMPAT=ON \
-DWITH_SSL=OPENSSL
make %{?_smp_mflags}
%install
%cmake_install
# remove static linked libraries
rm %{buildroot}%{_libdir}/mariadb/libmariadbclient.a
rm %{buildroot}%{_libdir}/mariadb/libmysqlclient.a
rm %{buildroot}%{_libdir}/mariadb/libmysqlclient_r.a
%files -n %{libname}%{sover}
%defattr(-,root,root)
%doc README COPYING.LIB
%{_libdir}/mariadb/libmariadb.so.%{sover}
%files -n %{libname}_plugins
%dir %{_libdir}/mariadb/
%dir %{_libdir}/mariadb/plugin/
%{_libdir}/mariadb/plugin/dialog.so
%{_libdir}/mariadb/plugin/mysql_clear_password.so
%{_libdir}/mariadb/plugin/auth_gssapi_client.so
%{_libdir}/mariadb/plugin/remote_io.so
%{_libdir}/mariadb/plugin/sha256_password.so
%files -n %{libname}private
%{_libdir}/mariadb/libmariadbprivate.so
%files -n %{libname}-devel
%defattr(-,root,root)
%{_bindir}/mariadb_config
%{_includedir}/mariadb/
%{_libdir}/mariadb/libmariadb.so
%{_libdir}/mariadb/libmysqlclient.so
%{_libdir}/mariadb/libmysqlclient_r.so
%post -n %{libname}%{sover} -p /sbin/ldconfig
%post -n %{libname}private -p /sbin/ldconfig
%postun -n %{libname}%{sover} -p /sbin/ldconfig
%postun -n %{libname}private -p /sbin/ldconfig
%changelog