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