[ghc-rpm-macros] improve %ghc_fix_dynamic_rpath not to assume cwd = pkg_name
Jens Petersen
petersen at fedoraproject.org
Wed Sep 10 07:07:58 UTC 2014
commit 2da26f9db56515862de9839f12a17be5f2ed2eb7
Author: Jens Petersen <petersen at redhat.com>
Date: Wed Sep 10 16:07:29 2014 +0900
improve %ghc_fix_dynamic_rpath not to assume cwd = pkg_name
ghc-rpm-macros.spec | 5 ++++-
macros.ghc | 5 ++---
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index 6aec82c..8e0c30f 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -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 at redhat.com> - 1.3.6-1
+- improve ghc_fix_dynamic_rpath not to assume cwd = pkg_name
+
* Fri Aug 29 2014 Jens Petersen <petersen at redhat.com> - 1.3.5-1
- no longer disable debuginfo by default:
packages now need to explicitly opt out of debuginfo if appropriate
diff --git a/macros.ghc b/macros.ghc
index 0b561a4..dadd68c 100644
--- a/macros.ghc
+++ b/macros.ghc
@@ -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\
More information about the scm-commits
mailing list