From 2a16fb4afaa9bdd17832731f1e393478f174d819 Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Wed, 8 Nov 2023 16:57:08 +0800 Subject: [PATCH] Remove rpath and generate debuginfo to fix not stipped --- mysql.spec | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/mysql.spec b/mysql.spec index e029005..a133599 100644 --- a/mysql.spec +++ b/mysql.spec @@ -1,13 +1,8 @@ -%define debug_package %{nil} -%define __os_install_post %{nil} -%define __debug_install_post \ -%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ -%{nil} %global pkgnamepatch mysql %global boost_bundled_version 1.73.0 Name: mysql Version: 8.0.28 -Release: 2 +Release: 3 License: GPLv2 with exceptions and LGPLv2 and BSD Summary: The world's most popular open source database URL: http://www.mysql.com/ @@ -26,7 +21,7 @@ Patch13:disable-moutline-atomics-for-aarch64.patch Patch14: CVE-2022-37434-1.patch Patch15: CVE-2022-37434-2.patch -BuildRequires: cmake openssl-devel ncurses-devel libtirpc-devel rpcgen libcurl-devel make +BuildRequires: cmake openssl-devel ncurses-devel libtirpc-devel rpcgen libcurl-devel make chrpath Requires: libatomic >= 1.2.0 libstdc++ >= 7.3.0 ncurses libtirpc openssl ldconfig @@ -74,6 +69,19 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql/data %install %make_install +cd $RPM_BUILD_ROOT/usr/local/mysql/ +file `find -type f`| grep -w ELF | awk -F":" '{print $1}' | for i in `xargs` +do + chrpath -d $i +done +cd - + +mkdir -p %{buildroot}/etc/ld.so.conf.d +echo "/usr/local/mysql/lib/mysqlrouter/private" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf +echo "/usr/local/mysql/lib/mysqlrouter" >>%{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf +echo "/usr/local/mysql/lib/private" >>%{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf +echo "/usr/local/mysql/bin" >>%{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf + %clean rm -rf %{buildroot} @@ -94,6 +102,8 @@ if [ -e %{_prefix}/local/%{name}/lib/private ];then ldconfig fi +/sbin/ldconfig + %preun if [ -f %{_sysconfdir}/my.cnf ];then mv %{_sysconfdir}/my.cnf %{_sysconfdir}/my.cnf.rpmold @@ -109,14 +119,19 @@ if [ "$1" = 0 ];then fi %postun +/sbin/ldconfig %files %dir %{_prefix}/local/%{name} %attr(755, %{name}, %{name}) %{_prefix}/local/%{name}/* %exclude /usr/src/debug %exclude /usr/lib/debug +%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf %changelog +* Wed Nov 8 2023 liyanan - 8.0.28-3 +- Remove rpath and generate debuginfo to fix not stipped + * Tue May 16 2023 yaoxin - 8.0.28-2 - Fix CVE-2022-37434 -- Gitee