!27 [sync] PR-24: 【轻量级 PR】:fix install warning

From: @openeuler-sync-bot 
Reviewed-by: @HelloWorld_lvcongqing 
Signed-off-by: @HelloWorld_lvcongqing
This commit is contained in:
openeuler-ci-bot 2023-05-31 02:47:30 +00:00 committed by Gitee
commit 4bca8ff7c3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,7 +1,7 @@
#%%global debug_package %{nil}
%define specrelease 5%{?dist}
%define specrelease 6%{?dist}
%if 0%{?openeuler}
%define specrelease 5
%define specrelease 6
%endif
Name: deepin-reader
@ -54,6 +54,7 @@ popd
%install
%make_install -C build INSTALL_ROOT="%buildroot"
pushd %{buildroot}/usr/lib/%{name}
mapfile -t dups <<<"$(fdupes -1 .)"
for line in "${dups[@]}"; do
realfile="$(echo "${line}" | tr '[:space:]' '\n' | sort -r | head -1)"
@ -63,11 +64,22 @@ for line in "${dups[@]}"; do
ln -s -f "${realfile}" "${dup}"
done
done
popd
chrpath -d %{buildroot}%{_bindir}/%{name}
chrpath -d %{buildroot}/usr/lib/%{name}/*
mkdir -p %{buildroot}/etc/ld.so.conf.d
echo "/usr/lib/%{name}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
# remove rpath info
for file in $(find %{buildroot}/ -executable -type f -exec file {} ';' | grep "\<ELF\>" | awk -F ':' '{print $1}')
do
if [ ! -u "$file" ]; then
if [ -w "$file" ]; then
chrpath -d $file
fi
fi
done
# add rpath path in ld.so.conf.d
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "%{_bindir}/%{name}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
echo "/usr/lib/%{name}" >> %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
%files
%doc README.md
@ -82,6 +94,9 @@ echo "/usr/lib/%{name}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
%changelog
* Tue May 30 2023 leeffo <liweiganga@uniontech.com> - 5.9.9-6
- fix: fix install warning
* Tue Mar 07 2023 liweiganga <liweiganga@uniontech.com> - 5.9.9-5
- fix: enable debug