diff --git a/ghc-deps.sh b/ghc-deps.sh index de838cb..e4d1f77 100755 --- a/ghc-deps.sh +++ b/ghc-deps.sh @@ -23,8 +23,8 @@ for i in $files; do case $i in # exclude builtin_rts.conf $pkgconfdir/*-*.conf) - pkgver=$(echo $i | sed -e "s%$pkgconfdir/\(.\+\)-.\+.conf%\1%") - ids=$($ghc_pkg field $pkgver $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//") + id=$(grep "id: " $i | sed -e "s/id: //") + ids=$($ghc_pkg field $id $field | sed -e "s/rts//" -e "s/bin-package-db-[^ ]\+//") for d in $ids; do case $d in diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index d063ce2..412f0b3 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -10,7 +10,7 @@ #%%global without_hscolour 1 Name: ghc-rpm-macros -Version: 1.6.17 +Version: 1.6.18 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC @@ -147,6 +147,10 @@ EOF %changelog +* Thu Mar 2 2017 Jens Petersen - 1.6.18-1 +- fix ghc_fix_rpath, ghc_gen_filelists, and ghc-deps.sh when pkg-ver already + installed + * Wed Feb 22 2017 Jens Petersen - 1.6.17-1 - setup --global/--user in cabal_configure - allow subpackage names to contain digits diff --git a/macros.ghc b/macros.ghc index c08af31..277bbed 100644 --- a/macros.ghc +++ b/macros.ghc @@ -70,11 +70,12 @@ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\ %define pkgnamever %{pkgname}-%{pkgver}\ %define basepkg %{?ghc_name}%{!?ghc_name:ghc}-%{pkgname}\ %define docdir %{ghclibdocdir}/%{pkgnamever}\ -keyname=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} field %{pkgnamever} key)\ -pkgdir="%{ghclibdir}/${keyname}"\ +pkgconf=$(echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf")\ +key=$(grep "key: " %{buildroot}${pkgconf} | sed -e "s/key: //")\ +pkgdir="%{ghclibdir}/${key}"\ rm -f %{basepkg}.files %{basepkg}-devel.files\ touch %{basepkg}.files %{basepkg}-devel.files\ -echo "%{ghclibdir}/package.conf.d/%{pkgnamever}*.conf" >> %{basepkg}-devel.files\ +echo ${pkgconf} >> %{basepkg}-devel.files\ if [ -d "%{buildroot}${pkgdir}" ]; then\ echo "%%dir ${pkgdir}" >> %{basepkg}.files\ %if %{undefined ghc_without_shared}\ @@ -168,7 +169,8 @@ for lib in %*; do\ rpath=$(chrpath $i | sed -e "s@^$i: R.*PATH=@@")\ case $rpath in\ *$PWD/$lib/dist/build*)\ - syspath=$(%{_rpmconfigdir}/ghc-pkg-wrapper %{buildroot}%{ghclibdir} --package-db=%{buildroot}%{ghclibdir}/package.conf.d field $lib 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)\ newrpath=$(echo $rpath | sed -e "s@$PWD/$lib/dist/build@${syspath}@g")\ chrpath -r $newrpath $i\ ;;\