diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index 3c04aae..daa57ea 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -281,6 +281,23 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \ %{!?1:%ghc_strip_dynlinked}\ %{nil} +# ghc_fix_dynamic_rpath prog ... +%ghc_fix_dynamic_rpath()\ +%if %{undefined ghc_without_dynamic}\ +PDIR=$(cd ..; pwd)\ +for i in %*; do\ + PROG=%{buildroot}%{_bindir}/$i\ + RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\ + case $RPATH in\ + $PDIR*)\ + NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\ + chrpath -r $NEWRPATH $PROG\ + ;;\ + esac\ +done\ +%endif\ +%{nil} + # - without_hscolour, without_testsuite, and ghc_bootstrapping # need to be set locally in the spec file diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 5444add..b9a5bd0 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -6,7 +6,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 0.97.6 +Version: 0.98 Release: 1%{?dist} Summary: Macros for building packages for GHC @@ -75,6 +75,10 @@ EOF %changelog +* Mon Jan 21 2013 Jens Petersen - 0.98-1 +- new ghc_fix_dynamic_rpath macro for cleaning up package executables + linked against their own libraries + * Fri Jan 18 2013 Jens Petersen - 0.97.6-1 - be more careful about library pkgdir ownership (#893777)