From f20cf923ae77de4bfee2c1ef21b9d7b610713ad7 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 29 Jul 2024 14:34:13 +0800 Subject: [PATCH] improve %ghc_delete_rpaths to delete leading and trailing %_libdir + /usr/lib/rpm/check-rpaths : ERROR 0001: file '/usr/lib64/ghc-9.6.6/lib/libHSdigest-0.0.2.1-EXQLl7EOUopLcWJlJWaOr-ghc9.6.6.so' contains a standard runpath '/usr/lib64' in [/usr/lib64/ghc-9.6.6/lib/x86_64-linux-ghc-9.6.6:/usr/lib64] ERROR 0001: file '/usr/lib64/ghc-9.6.6/lib/libHSyesod-1.6.2.1-8tHwkPWZJUX8yU5pD0ck2v-ghc9.6.6.so' contains a standard runpath '/usr/lib64' in [/usr/lib64:/usr/lib64/ghc-9.6.6/lib/x86_64-linux-ghc-9.6.6:/usr/lib64/ghc-9.6.6/lib] --- ghc-rpm-macros.spec | 1 + macros.ghc | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index ecf4d2d..36e8d15 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -206,6 +206,7 @@ mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries %changelog * Mon Jul 29 2024 Jens Petersen - 2.7.2-1 +- improve ghc_delete_rpaths to delete trailing :_libdir - extra: add ghc_merge_filelist from ghc.spec * Thu Jul 18 2024 Fedora Release Engineering - 2.7.1-2 diff --git a/macros.ghc b/macros.ghc index 5cb471b..767dbab 100644 --- a/macros.ghc +++ b/macros.ghc @@ -244,20 +244,17 @@ done\ echo "deleting rpaths:"\ if ! type chrpath > /dev/null; then exit 1; fi\ for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \\; -print); do\ - if [ -x "$i" ]; then\ %if %{defined _ghcdynlibdir}\ chrpath -d $i\ %else\ rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\ case "$rpath" in\ *$PWD/*) chrpath -r "%{ghclibdir}/lib:%{ghclibdir}/lib/%{ghcplatform}" $i ;;\ + *:%{_libdir}) chrpath -r $(echo "$rpath" | sed -e 's!:%{_libdir}$!!') $i ;;\ + %{_libdir}:*) chrpath -r $(echo "$rpath" | sed -e 's!^%{_libdir}:!!') $i ;;\ *) ;;\ esac\ %endif\ - else\ - echo "%0: no $i executable"\ - exit 1\ - fi\ done\ %endif