diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 4ba25c3..fecfe71 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -36,6 +36,8 @@ Requires: ghc-compiler Requires: hscolour %endif %endif +# this package could now be noarch again +#BuildArch: noarch %description A set of macros for building GHC packages following the Haskell Guidelines diff --git a/macros.ghc b/macros.ghc index c9be051..5076832 100644 --- a/macros.ghc +++ b/macros.ghc @@ -172,8 +172,14 @@ for lib in %*; do\ rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\ case $rpath in\ *$PWD/$lib/dist/build*)\ - pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\ - syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid)\ + case %{ghc_version} in\ + 7.10.*)\ + pkgid=$(cd %{buildroot}%{ghclibdir}/package.conf.d; ls ${lib}* | sed -e "s/.conf$//")\ + syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $pkgid library-dirs) ;;\ + *)\ + pkgid=$(cd %{buildroot}%{ghclibdir}; echo ${lib}*)\ + syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib library-dirs | grep $pkgid) ;;\ + esac\ newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g")\ chrpath -r $newrpath $i\ ;;\