Move library directly to libdir, don't create any symlinks to directories
Related: #1501933 Add 'Conflicts' with mariadb package on F<28 Related: #1506441 Patch extension
This commit is contained in:
parent
949ef84e50
commit
039fdbed92
17
cmake.patch
17
cmake.patch
@ -14,3 +14,20 @@
|
|||||||
SET(INSTALL_PLUGINDIR_RPM "lib/mariadb/plugin")
|
SET(INSTALL_PLUGINDIR_RPM "lib/mariadb/plugin")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(INSTALL_INCLUDEDIR_RPM "include")
|
SET(INSTALL_INCLUDEDIR_RPM "include")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--- mariadb-connector-c-3.0.2-src/mariadb_config/mariadb_config.c.in 2017-07-19 11:31:02.000000000 +0200
|
||||||
|
+++ mariadb-connector-c-3.0.2-src/mariadb_config/mariadb_config.c.in_patched 2017-10-25 12:32:42.075324299 +0200
|
||||||
|
@@ -5,8 +5,8 @@
|
||||||
|
|
||||||
|
static char *mariadb_progname;
|
||||||
|
|
||||||
|
-#define INCLUDE "-I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
|
||||||
|
-#define LIBS "-L@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb "\
|
||||||
|
+#define INCLUDE "-I@INSTALL_INCLUDEDIR@ -I@INSTALL_INCLUDEDIR@"
|
||||||
|
+#define LIBS "-L@INSTALL_LIBDIR@/ -lmariadb "\
|
||||||
|
"@extra_dynamic_LDFLAGS@"
|
||||||
|
#define LIBS_SYS "@extra_dynamic_LDFLAGS@"
|
||||||
|
#define CFLAGS INCLUDE
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
Name: mariadb-connector-c
|
Name: mariadb-connector-c
|
||||||
Version: 3.0.2
|
Version: 3.0.2
|
||||||
Release: 11%{?dist}
|
Release: 12%{?dist}
|
||||||
Summary: The MariaDB Native Client library (C driver)
|
Summary: The MariaDB Native Client library (C driver)
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Source: https://downloads.mariadb.org/interstitial/connector-c-%{version}/mariadb-connector-c-%{version}-src.tar.gz
|
Source: https://downloads.mariadb.org/interstitial/connector-c-%{version}/mariadb-connector-c-%{version}-src.tar.gz
|
||||||
Url: http://mariadb.org/
|
Url: http://mariadb.org/
|
||||||
# Informations: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
|
# More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
|
||||||
|
|
||||||
|
%if 0%{fedora} >= 28
|
||||||
|
# RPM does not expand "less" correctly
|
||||||
|
%else
|
||||||
|
# mariadb-connector-c is a part of mariadb. *Every* file is meant to conflict.
|
||||||
|
# From F28 the client library part was removed from mariadb and tis package is required instead.
|
||||||
|
# On F<28 is the package present from both historical and compatibility reasons.
|
||||||
|
Conflicts: mariadb-libs mariadb-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
BuildRequires: zlib-devel cmake openssl-devel
|
BuildRequires: zlib-devel cmake openssl-devel
|
||||||
|
Suggests: openssl
|
||||||
# Remote-IO plugin
|
# Remote-IO plugin
|
||||||
BuildRequires: libcurl-devel
|
BuildRequires: libcurl-devel
|
||||||
|
|
||||||
# RPMLint issues of 2.3.2 release tracked on the upstream JIRA:
|
# Patch for "-DINSTALL_LAYOUT=RPM" and mariadb_config
|
||||||
# https://jira.mariadb.org/browse/CONC-232
|
|
||||||
# https://jira.mariadb.org/browse/CONC-234
|
|
||||||
|
|
||||||
# Patch for "-DINSTALL_LAYOUT=RPM"
|
|
||||||
Patch1: cmake.patch
|
Patch1: cmake.patch
|
||||||
|
|
||||||
%if 0%{?__isa_bits} == 64
|
%if 0%{?__isa_bits} == 64
|
||||||
@ -33,6 +39,8 @@ Provides: libmysqlclient.so.18(libmysqlclient_18)
|
|||||||
The MariaDB Native Client library (C driver) is used to connect applications
|
The MariaDB Native Client library (C driver) is used to connect applications
|
||||||
developed in C/C++ to MariaDB and MySQL databases.
|
developed in C/C++ to MariaDB and MySQL databases.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for mariadb-connector-c
|
Summary: Development files for mariadb-connector-c
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -41,76 +49,70 @@ Requires: %{name} = %{version}-%{release}
|
|||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
Development files for mariadb-connector-c.
|
Development files for mariadb-connector-c.
|
||||||
|
Contains everything needed to build against libmariadb.so >=3 client library.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n mariadb-connector-c-%{version}-src
|
%setup -q -n mariadb-connector-c-%{version}-src
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
|
||||||
|
# Remove unsused parts
|
||||||
|
rm -r win zlib win-iconv examples
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake . \
|
%cmake . \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
|
|
||||||
-DMARIADB_PORT=3306 \
|
|
||||||
-DWITH_EXTERNAL_ZLIB=ON \
|
|
||||||
-DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \
|
-DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \
|
||||||
-DPLUGIN_INSTALL_DIR="%{_libdir}/mariadb/plugin" \
|
\
|
||||||
-DWITH_MYSQLCOMPAT=ON \
|
-DMARIADB_UNIX_ADDR=/var/lib/mysql/mysql.sock \
|
||||||
-DINSTALL_LAYOUT=RPM \
|
-DMARIADB_PORT=3306 \
|
||||||
|
\
|
||||||
|
-DWITH_EXTERNAL_ZLIB=YES \
|
||||||
-DWITH_SSL=OPENSSL \
|
-DWITH_SSL=OPENSSL \
|
||||||
|
-DWITH_MYSQLCOMPAT=ON \
|
||||||
|
\
|
||||||
|
-DINSTALL_LAYOUT=RPM \
|
||||||
|
-DINSTALL_BINDIR="%{_bindir}" \
|
||||||
|
-DINSTALL_LIBDIR="%{_libdir}" \
|
||||||
|
-DINSTALL_INCLUDEDIR=%{_includedir}/mysql \
|
||||||
|
-DPLUGIN_INSTALL_DIR="%{_libdir}/mariadb/plugin"
|
||||||
|
|
||||||
# Use
|
# Causes build errors:
|
||||||
#-DMARIADB_PORT=number
|
|
||||||
#-DMARIADB_UNIX_ADDR=/path_to_socket/file.sock
|
|
||||||
# https://jira.mariadb.org/browse/MDEV-13836
|
|
||||||
|
|
||||||
# Causes build errors
|
|
||||||
# -DAUTH_NATIVE=DYNAMIC
|
# -DAUTH_NATIVE=DYNAMIC
|
||||||
|
# -DCMAKE_INSTALL_PREFIX="/usr"
|
||||||
|
|
||||||
|
# https://jira.mariadb.org/browse/MDEV-13836:
|
||||||
|
# The server has (used to have for ages) some magic around the port number.
|
||||||
|
# If it's 0, the default port value will use getservbyname("mysql", "tcp"), that is, whatever is written in /etc/services.
|
||||||
|
# If it's a positive number, say, 3306, it will be 3306, no matter what /etc/services say.
|
||||||
|
# I don't know if that behavior makes much sense, /etc/services wasn't supposed to be a system configuration file.
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make install DESTDIR=%{buildroot}
|
make install DESTDIR=%{buildroot}
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
|
# Remove static linked libraries and symlinks to them
|
||||||
echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
|
rm %{buildroot}%{_libdir}/libmariadbclient.a
|
||||||
|
rm %{buildroot}%{_libdir}/libmysqlclient.a
|
||||||
|
rm %{buildroot}%{_libdir}/libmysqlclient_r.a
|
||||||
|
|
||||||
# static linked libraries and symlinks to them
|
# Add a compatibility symlinks
|
||||||
rm %{buildroot}%{_libdir}/mariadb/libmariadbclient.a
|
|
||||||
rm %{buildroot}%{_libdir}/mariadb/libmysqlclient.a
|
|
||||||
rm %{buildroot}%{_libdir}/mariadb/libmysqlclient_r.a
|
|
||||||
|
|
||||||
# add a compatibility symlink
|
|
||||||
ln -s mariadb_config %{buildroot}%{_bindir}/mysql_config
|
ln -s mariadb_config %{buildroot}%{_bindir}/mysql_config
|
||||||
|
ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql/mysql_version.h
|
||||||
mv %{buildroot}%{_libdir}/mariadb %{buildroot}%{_libdir}/mysql
|
|
||||||
ln -s mysql %{buildroot}%{_libdir}/mariadb
|
|
||||||
ln -s mariadb_version.h %{buildroot}%{_includedir}/mysql_version.h
|
|
||||||
|
|
||||||
# move header files to the same location, as they would be in mariadb-server (10.2.8)
|
|
||||||
# which means from /usr/include to /usr/include/mysql
|
|
||||||
mkdir %{buildroot}%{_includedir}/temporary
|
|
||||||
mv %{buildroot}%{_includedir}/{*.h,mysql,mariadb} %{buildroot}%{_includedir}/temporary
|
|
||||||
mv %{buildroot}%{_includedir}/temporary %{buildroot}%{_includedir}/mysql
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%pre devel
|
%pre devel
|
||||||
rpm -qf /usr/lib64/mysql
|
if [ -h %{_libdir}/mariadb ]; then
|
||||||
if [ $? -eq 1 ]; then
|
unlink %{_libdir}/mariadb
|
||||||
if [ "$(ls -A /usr/lib64/mysql)" ]; then
|
|
||||||
mv /usr/lib64/mysql /usr/lib64/.mysql_update_tmp
|
|
||||||
fi
|
|
||||||
rm -rf /usr/lib64/{mysql*,mariadb*}
|
|
||||||
fi
|
fi
|
||||||
|
if [ -h %{_libdir}/mysql ]; then
|
||||||
%post devel
|
unlink %{_libdir}/mysql
|
||||||
if [ -d "/usr/lib64/.mysql_update_tmp" ]; then
|
|
||||||
if [ "$(ls -A /usr/lib64/.mysql_update_tmp)" ]; then
|
|
||||||
mv /usr/lib64/.mysql_update_tmp/* /usr/lib64/mysql
|
|
||||||
rm -rf /usr/lib64/.mysql_update_tmp
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post -p /sbin/ldconfig
|
||||||
@ -119,12 +121,11 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_libdir}/mysql/libmariadb.so.*
|
%{_libdir}/libmariadb.so.*
|
||||||
%dir %{_libdir}/mysql/plugin
|
|
||||||
%{_libdir}/mysql/plugin/*
|
|
||||||
|
|
||||||
# fix of RPATH. If there is a set config file, libdir/mariadb/ is added to search for libraries
|
%dir %{_libdir}/mariadb
|
||||||
%config(noreplace) %{_sysconfdir}/ld.so.conf.d
|
%dir %{_libdir}/mariadb/plugin
|
||||||
|
%{_libdir}/mariadb/plugin/*
|
||||||
|
|
||||||
%doc README
|
%doc README
|
||||||
%license COPYING.LIB
|
%license COPYING.LIB
|
||||||
@ -132,22 +133,40 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
# program which provides compiler info for programs compiling with this library
|
# Binary which provides compiler info for software compiling against this library
|
||||||
%{_bindir}/mariadb_config
|
%{_bindir}/mariadb_config
|
||||||
%{_bindir}/mysql_config
|
%{_bindir}/mysql_config
|
||||||
|
|
||||||
%dir %{_libdir}/mysql
|
# Symlinks to the versioned library
|
||||||
%{_libdir}/mariadb
|
%{_libdir}/libmariadb.so
|
||||||
%{_libdir}/mysql/libmariadb.so
|
%{_libdir}/libmysqlclient.so
|
||||||
%{_libdir}/mysql/libmysqlclient.so
|
%{_libdir}/libmysqlclient_r.so
|
||||||
%{_libdir}/mysql/libmysqlclient_r.so
|
|
||||||
|
|
||||||
# header files
|
# Header files
|
||||||
%{_includedir}/*
|
%dir %{_includedir}/mysql
|
||||||
|
%{_includedir}/mysql/*
|
||||||
|
|
||||||
%license COPYING.LIB
|
%license COPYING.LIB
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# RPMLint issues from 2.3.2 release tracked on the upstream JIRA:
|
||||||
|
# https://jira.mariadb.org/browse/CONC-232
|
||||||
|
# https://jira.mariadb.org/browse/CONC-234
|
||||||
|
# RPMLint issues from 3.0.2 release tracked on the upstream JIRA:
|
||||||
|
# https://jira.mariadb.org/browse/CONC-271
|
||||||
|
# https://jira.mariadb.org/browse/CONC-287
|
||||||
|
# https://jira.mariadb.org/browse/CONC-290
|
||||||
|
# https://jira.mariadb.org/browse/MDEV-13836
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Oct 26 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-12
|
||||||
|
- Move library directly to libdir, don't create any symlinks to directories
|
||||||
|
- Update scritplets, so they only check for old symlinks to directories
|
||||||
|
Related: #1501933
|
||||||
|
- Add 'Conflicts' with mariadb package on F<28
|
||||||
|
Related: #1506441
|
||||||
|
|
||||||
* Mon Oct 09 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-11
|
* Mon Oct 09 2017 Michal Schorm <mschorm@redhat.com> - 3.0.2-11
|
||||||
- Fix ldconfig path
|
- Fix ldconfig path
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user