improve %ghc_fix_dynamic_rpath not to assume cwd = pkg_name

This commit is contained in:
Jens Petersen 2014-09-10 16:07:29 +09:00
parent 3efe41dd0c
commit 2da26f9db5
2 changed files with 6 additions and 4 deletions

View File

@ -6,7 +6,7 @@
#%%global without_hscolour 1
Name: ghc-rpm-macros
Version: 1.3.5
Version: 1.3.6
Release: 1%{?dist}
Summary: RPM macros for building packages for GHC
@ -93,6 +93,9 @@ EOF
%changelog
* Wed Sep 10 2014 Jens Petersen <petersen@redhat.com> - 1.3.6-1
- improve ghc_fix_dynamic_rpath not to assume cwd = pkg_name
* Fri Aug 29 2014 Jens Petersen <petersen@redhat.com> - 1.3.5-1
- no longer disable debuginfo by default:
packages now need to explicitly opt out of debuginfo if appropriate

View File

@ -118,18 +118,17 @@ find %{buildroot} -type f -exec sh -c "file {} | grep -q 'dynamically linked'" \
%{nil}
# ghc_fix_dynamic_rpath prog ...
# (assumes cwd = pkg_name !)
%ghc_fix_dynamic_rpath()\
%if %{undefined ghc_without_dynamic}\
if ! type chrpath > /dev/null; then exit 1; fi\
PDIR=$(cd ..; pwd)\
PDIR=$(pwd)\
for i in %*; do\
PROG=%{buildroot}%{_bindir}/$i\
if [ -x "$PROG" ]; then\
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")\
NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR/dist/build@%{ghclibdir}/%{pkg_name}-%{version}@g")\
chrpath -r $NEWRPATH $PROG\
;;\
esac\