multilib fixes

Delegate most of the multilib decisions to multilib-rpm-config,
this allows us to maintain the rules at central place.

Move the pkgconfig file to architecture dependant location.

Version: 10.2.0-3
This commit is contained in:
Pavel Raiskup 2016-06-22 14:03:19 +02:00
parent e0a9f3e25e
commit cd3275f872
2 changed files with 20 additions and 52 deletions

View File

@ -123,7 +123,7 @@
Name: mariadb Name: mariadb
Version: %{compatver}.%{bugfixver} Version: %{compatver}.%{bugfixver}
Release: 2%{?with_debug:.debug}%{?dist} Release: 3%{?with_debug:.debug}%{?dist}
Epoch: 1 Epoch: 1
Summary: A community developed branch of MySQL Summary: A community developed branch of MySQL
@ -136,7 +136,6 @@ License: GPLv2 with exceptions and LGPLv2 and BSD
Source0: http://mirrors.syringanetworks.net/mariadb/mariadb-%{version}/source/mariadb-%{version}.tar.gz Source0: http://mirrors.syringanetworks.net/mariadb/mariadb-%{version}/source/mariadb-%{version}.tar.gz
Source2: mysql_config_multilib.sh Source2: mysql_config_multilib.sh
Source3: my.cnf.in Source3: my.cnf.in
Source4: my_config.h
Source5: README.mysql-cnf Source5: README.mysql-cnf
Source6: README.mysql-docs Source6: README.mysql-docs
Source7: README.mysql-license Source7: README.mysql-license
@ -190,6 +189,7 @@ BuildRequires: perl
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: systemtap-sdt-devel BuildRequires: systemtap-sdt-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: multilib-rpm-config
# auth_pam.so plugin will be build if pam-devel is installed # auth_pam.so plugin will be build if pam-devel is installed
BuildRequires: pam-devel BuildRequires: pam-devel
# use either new enough version of pcre or provide bundles(pcre) # use either new enough version of pcre or provide bundles(pcre)
@ -699,22 +699,20 @@ cp -p -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config
chmod 755 %{buildroot}%{_bindir}/mysql_config chmod 755 %{buildroot}%{_bindir}/mysql_config
# multilib header support # multilib header support
for header in mysql/my_config.h mysql/private/config.h; do
%multilib_fix_c_header --file %{_includedir}/$header
done
# multilib support for shell scripts
# we only apply this to known Red Hat multilib arches, per bug #181335 # we only apply this to known Red Hat multilib arches, per bug #181335
unamei=$(uname -i) if %multilib_capable; then
%ifarch %{arm}
unamei=arm
%endif
%ifarch %{power64}
unamei=ppc64
%endif
%ifarch %{arm} aarch64 %{ix86} x86_64 ppc %{power64} %{sparc} s390 s390x
mv %{buildroot}%{_includedir}/mysql/my_config.h %{buildroot}%{_includedir}/mysql/my_config_${unamei}.h
mv %{buildroot}%{_includedir}/mysql/private/config.h %{buildroot}%{_includedir}/mysql/private/my_config_${unamei}.h
install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/mysql/
install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/mysql/private/config.h
mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits} mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits}
install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config
%endif fi
# Upstream install this into arch-independent directory, TODO: report
mkdir -p %{buildroot}/%{_libdir}/pkgconfig
mv %{buildroot}/%{_datadir}/pkgconfig/*.pc %{buildroot}/%{_libdir}/pkgconfig
# install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files, # install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files,
# but that's pretty wacko --- see also %%{name}-file-contents.patch) # but that's pretty wacko --- see also %%{name}-file-contents.patch)
@ -858,7 +856,7 @@ rm -f %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded
rm -f %{buildroot}%{_bindir}/mysql_config* rm -f %{buildroot}%{_bindir}/mysql_config*
rm -rf %{buildroot}%{_includedir}/mysql rm -rf %{buildroot}%{_includedir}/mysql
rm -f %{buildroot}%{_datadir}/aclocal/mysql.m4 rm -f %{buildroot}%{_datadir}/aclocal/mysql.m4
rm -f %{buildroot}%{_datadir}/pkgconfig/mariadb.pc rm -f %{buildroot}%{_libdir}/pkgconfig/mariadb.pc
rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient*.so rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient*.so
rm -f %{buildroot}%{_mandir}/man1/mysql_config.1* rm -f %{buildroot}%{_mandir}/man1/mysql_config.1*
%endif %endif
@ -1242,11 +1240,10 @@ fi
%if %{with devel} %if %{with devel}
%files devel %files devel
%{_bindir}/mysql_config %{_bindir}/mysql_config*
%{_bindir}/mysql_config-%{__isa_bits}
%{_includedir}/mysql %{_includedir}/mysql
%{_datadir}/aclocal/mysql.m4 %{_datadir}/aclocal/mysql.m4
%{_datadir}/pkgconfig/mariadb.pc %{_libdir}/pkgconfig/mariadb.pc
%if %{with clibrary} %if %{with clibrary}
%{_libdir}/mysql/libmysqlclient.so %{_libdir}/mysql/libmysqlclient.so
%{_libdir}/mysql/libmysqlclient_r.so %{_libdir}/mysql/libmysqlclient_r.so
@ -1280,6 +1277,10 @@ fi
%endif %endif
%changelog %changelog
* Tue Jun 21 2016 Pavel Raiskup <praiskup@redhat.com> - 10.2.0-3
- BR multilib-rpm-config and use it for multilib workarounds
- install architecture dependant pc file to arch-dependant location
* Thu May 26 2016 Jakub Dorňák <jdornak@redhat.com> - 1:10.2.0-2 * Thu May 26 2016 Jakub Dorňák <jdornak@redhat.com> - 1:10.2.0-2
- Fix mysql-prepare-db-dir - Fix mysql-prepare-db-dir
Resolves: #1335849 Resolves: #1335849

View File

@ -1,33 +0,0 @@
/*
* Kluge to support multilib installation of both 32- and 64-bit RPMS:
* we need to arrange that header files that appear in both RPMs are
* identical. Hence, this file is architecture-independent and calls
* in an arch-dependent file that will appear in just one RPM.
*
* To avoid breaking arches not explicitly supported by Red Hat, we
* use this indirection file *only* on known multilib arches.
*
* Note: this may well fail if user tries to use gcc's -I- option.
* But that option is deprecated anyway.
*/
#if defined(__x86_64__)
#include "my_config_x86_64.h"
#elif defined(__i386__)
#include "my_config_i386.h"
#elif defined(__ppc64__) || defined(__powerpc64__)
#include "my_config_ppc64.h"
#elif defined(__ppc__) || defined(__powerpc__)
#include "my_config_ppc.h"
#elif defined(__s390x__)
#include "my_config_s390x.h"
#elif defined(__s390__)
#include "my_config_s390.h"
#elif defined(__sparc__) && defined(__arch64__)
#include "my_config_sparc64.h"
#elif defined(__sparc__)
#include "my_config_sparc.h"
#elif defined(__arm__)
#include "my_config_arm.h"
#elif defined(__aarch64__)
#include "my_config_aarch64.h"
#endif