Remove symlinks towards libtool .la also

(cherry picked from commit 14372ac27b8bc7899e6923f755870ce4074744f8)
This commit is contained in:
Funda Wang 2024-09-20 19:15:49 +08:00 committed by openeuler-sync-bot
parent b04b22520d
commit 537590ab53
3 changed files with 60 additions and 32 deletions

View File

@ -0,0 +1,33 @@
From 4936c42b4d8ed68af45fe220d24b2a69baaf9676 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Tue, 17 Sep 2024 13:13:13 +0200
Subject: [PATCH] brp-remove-la-files: Remove symlinks, too
As we check for file contents delete symlink before looking at regular
files.
Resolves: #3304
---
scripts/brp-remove-la-files | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/scripts/brp-remove-la-files b/scripts/brp-remove-la-files
index 58c513bf88..0e6e58f31a 100755
--- a/scripts/brp-remove-la-files
+++ b/scripts/brp-remove-la-files
@@ -5,6 +5,12 @@ if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
-find "$RPM_BUILD_ROOT" -type f -name '*.la' 2>/dev/null -print0 |
- xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null |
- xargs -0 rm --force
+# Check and remove symlinks first then regular files
+for FILETYPE in l f
+do
+
+ find "$RPM_BUILD_ROOT" -type $FILETYPE -name '*.la' 2>/dev/null -print0 |
+ xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null |
+ xargs -0 rm --force
+
+done

View File

@ -1,10 +1,10 @@
Name: rpm
Version: 4.18.2
Release: 15
Release: 16
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
Source0: http://ftp.rpm.org/releases/rpm-4.18.x/%{name}-%{version}.tar.bz2
License: GPL-2.0-or-later
URL: https://rpm.org/
Source0: https://ftp.osuosl.org/pub/rpm/releases/rpm-4.18.x/%{name}-%{version}.tar.bz2
Patch1: Unbundle-config-site-and-add-RPM-LD-FLAGS-macro.patch
Patch2: rpm-4.12.0-rpm2cpio-hack.patch
@ -45,6 +45,7 @@ Patch6023: backport-Make-sure-dirs-are-not-relocated-twice.patch
Patch6024: backport-Fix-root-relocation-regression.patch
Patch6025: backport-Fix-crash-on-Lua-file-trigger-exiting-with-return-ed.patch
Patch6026: backport-Fix-V-option-usage-in-our-tests.patch
Patch6027: backport-Remove-libtool-la-symlinks.patch
Patch9000: Add-digest-list-plugin.patch
Patch9001: Add-IMA-digest-list-support.patch
@ -126,7 +127,7 @@ Obsoletes: apidocs
%prep
%autosetup -n %{name}-%{version} -p1
%ifnarch sw_64
%patch10 -R -p1
%patch -P10 -R -p1
%endif
%build
@ -171,6 +172,7 @@ done;
%install
%make_install
%delete_la
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
@ -206,12 +208,13 @@ cp -va ndb/. $RPM_BUILD_ROOT/var/lib/rpm/
%find_lang %{name}
find $RPM_BUILD_ROOT -name "*.la"|xargs rm -f
rm -f $RPM_BUILD_ROOT/%{_rpmconfigdir}/{perldeps.pl,perl.*,pythond*}
rm -f $RPM_BUILD_ROOT/%{_fileattrsdir}/{perl*,python*}
rm -f $RPM_BUILD_ROOT/%{_rpmconfigdir}/{tcl.req,osgideps.pl}
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/dbus-1/system.d/org.rpm.conf
rm -f $RPM_BUILD_ROOT/%{_libdir}/rpm-plugins/fsverity.so
rm -f $RPM_BUILD_ROOT/%{_libdir}/rpm-plugins/dbus_announce.so
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/rpm-plugin-dbus-announce.8*
%check
%ifnarch loongarch64
@ -222,14 +225,6 @@ make check || (cat tests/rpmtests.log; exit 0)
make clean
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%posttrans
{
set -e
@ -245,7 +240,6 @@ make clean
} &
%files -f %{name}.lang
%defattr(-,root,root)
%license COPYING
%doc CREDITS
/usr/lib/tmpfiles.d/rpm.conf
@ -274,10 +268,12 @@ make clean
%{_rpmconfigdir}/rpm2cpio.sh
%{_rpmconfigdir}/tgpg
%{_rpmconfigdir}/platform
%{_libdir}/rpm-plugins/
%exclude %{_libdir}/rpm-plugins/systemd_inhibit.so
%exclude %{_libdir}/rpm-plugins/fsverity.so
%exclude %{_libdir}/rpm-plugins/dbus_announce.so
%dir %{_libdir}/rpm-plugins
%{_libdir}/rpm-plugins/digest_list.so
%{_libdir}/rpm-plugins/ima.so
%{_libdir}/rpm-plugins/prioreset.so
%{_libdir}/rpm-plugins/selinux.so
%{_libdir}/rpm-plugins/syslog.so
%dir %{_rpmconfigdir}/fileattrs
%{_bindir}/rpm
%{_bindir}/rpm2archive
@ -294,14 +290,13 @@ make clean
%{_libdir}/librpm*.so.9*
%files build
%defattr(-,root,root)
%{_bindir}/rpmbuild
%{_bindir}/gendiff
%{_bindir}/rpmspec
%{_mandir}/man1/gendiff.1*
%{_mandir}/man8/rpmbuild.8.gz
%{_mandir}/man8/rpmdeps.8.gz
%{_mandir}/man8/rpmspec.8.gz
%{_mandir}/man8/rpmbuild.8*
%{_mandir}/man8/rpmdeps.8*
%{_mandir}/man8/rpmspec.8*
%{_rpmconfigdir}/brp-*
%{_rpmconfigdir}/check-*
@ -316,12 +311,10 @@ make clean
%{_rpmconfigdir}/config.*
%files -n python3-%{name}
%defattr(-,root,root)
%{python3_sitearch}/%{name}/
%{python3_sitearch}/%{name}-%{version}*.egg-info
%files devel
%defattr(-,root,root)
%{_bindir}/rpmgraph
%{_libdir}/librp*[a-z].so
%{_libdir}/pkgconfig/%{name}.pc
@ -332,17 +325,19 @@ make clean
%{_mandir}/man8/rpm-plugin-systemd-inhibit.8*
%files help
%defattr(-,root,root)
%doc docs/manual/[a-z]*
%doc docs/librpm/html/*
%{_mandir}/man8/rpm*.8*
%exclude %{_mandir}/man8/rpm-plugin-systemd-inhibit.8*
%exclude %{_mandir}/man8/rpm-plugin-dbus-announce.8*
%exclude %{_mandir}/man8/rpmbuild.8.gz
%exclude %{_mandir}/man8/rpmdeps.8.gz
%exclude %{_mandir}/man8/rpmspec.8.gz
%exclude %{_mandir}/man8/rpmbuild.8*
%exclude %{_mandir}/man8/rpmdeps.8*
%exclude %{_mandir}/man8/rpmspec.8*
%changelog
* Wed Sep 18 2024 Funda Wang <fundawang@yeah.net> - 4.18.2-16
- Remove symlinks towards libtool .la also
- cleanup spec
* Wed Sep 11 2024 luhuaxin <luhuaxin1@huawei.com> - 4.18.2-15
- Fix the log level of IMA digest_list

View File

@ -1,4 +1,4 @@
version_control: github
src_repo: "rpm-software-management/rpm"
tag_prefix: "^rpm-"
seperator: _
separator: _