From 2112d91931094a3efb9098e0d8ae121a1e1e07d2 Mon Sep 17 00:00:00 2001 From: chen-jan Date: Wed, 8 Sep 2021 06:34:29 +0000 Subject: [PATCH] del rpath from some binaries and bin (cherry picked from commit b4070494b039d0369ea00f35d2d8a897865361ed) --- dovecot.spec | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dovecot.spec b/dovecot.spec index 89ff33f..a15aba1 100644 --- a/dovecot.spec +++ b/dovecot.spec @@ -6,7 +6,7 @@ Name: dovecot Version: 2.3.15 -Release: 1 +Release: 2 Summary: Dovecot Secure imap server License: MIT and LGPLv2.1 URL: http://www.dovecot.org/ @@ -41,7 +41,7 @@ BuildRequires: libtool autoconf automake pkgconfig sqlite-devel libpq-devel BuildRequires: mariadb-connector-c-devel libxcrypt-devel openldap-devel krb5-devel BuildRequires: quota-devel xz-devel gettext-devel clucene-core-devel libcurl-devel expat-devel BuildRequires: lz4-devel libzstd-devel libicu-devel libstemmer-devel multilib-rpm-config -BuildRequires: systemd-devel +BuildRequires: systemd-devel chrpath Requires: openssl >= 0.9.7f-4 systemd Requires(pre): shadow-utils @@ -149,6 +149,15 @@ cd docinstall rm -f securecoding.txt thread-refs.txt cd - +cd $RPM_BUILD_ROOT/usr +file `find -type f`| grep -w ELF | awk -F":" '{print $1}' | for i in `xargs` +do + chrpath -d $i +done +cd - +mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d +echo "%{_bindir}/%{name}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf +echo "%{_libdir}/%{name}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf %pre getent group dovecot >/dev/null || groupadd -r --gid 97 dovecot @@ -166,6 +175,7 @@ if [ "$1" = "2" ]; then fi %post +/sbin/ldconfig if [ $1 -eq 1 ]; then %systemd_post dovecot.service fi @@ -184,6 +194,7 @@ if [ $1 = 0 ]; then fi %postun +/sbin/ldconfig /bin/systemctl daemon-reload >/dev/null 2>&1 || : @@ -276,6 +287,8 @@ make check %exclude %{_sysconfdir}/dovecot/README +%config(noreplace) /etc/ld.so.conf.d/* + %files devel %{_includedir}/dovecot %{_datadir}/aclocal/dovecot*.m4 @@ -291,6 +304,9 @@ make check %changelog +* Wed Sep 08 2021 chenchen - 2.3.15-2 +- del rpath from some binaries and bin + * Thu Jul 08 2021 wutao - 2.3.15-1 - upgrade to 2.3.15 -- Gitee