diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index 82c6bf7..0b0195b 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -20,6 +20,9 @@ make -f cabal-rpm.mk %{_smp_mflags} \ %cabal copy --destdir=${RPM_BUILD_ROOT} \ %{nil} +%ghc_cabal_configure \ +%cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/ghc/libraries/%{name} --libsubdir='$compiler/$pkgid' + %ghc_gen_filelists() \ rm -f %1.files %1-prof.files \ echo '%defattr(-,root,root,-)' > %1-prof.files \ @@ -56,8 +59,8 @@ install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \ %{nil} %ghc_haddock_reindex \ -if [ -f /usr/bin/haddock -a -d /usr/share/doc/ghc/libraries ]; then \ -cd /usr/share/doc/ghc/libraries && \ +if [ -f %{_bindir}/haddock -a -d %{_docdir}/ghc/libraries ]; then \ +cd %{_docdir}/ghc/libraries && \ haddock --gen-index --gen-contents -o . -t 'Haskell Hierarchical Libraries' \ $(find . \( \( -path ./ghc -o -path ./ghc-prim \) -prune \) -o \( -name '*.haddock' -print \) \ | sed 's!.*/\([^/]*\).haddock!--read-interface=\1,\0!'); \ diff --git a/ghc.spec b/ghc.spec index f745dbe..793abef 100644 --- a/ghc.spec +++ b/ghc.spec @@ -16,7 +16,7 @@ Name: ghc Version: 6.10.0.20081007 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Glasgow Haskell Compilation system # See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239713 ExcludeArch: alpha ppc64 @@ -170,7 +170,10 @@ update-alternatives --install %{_bindir}/hsc2hs hsc2hs \ %post doc -%ghc_haddock_reindex +cd %{_docdir}/ghc/libraries && \ +haddock --gen-index --gen-contents -o . -t 'Haskell Hierarchical Libraries' \ +$(find . \( \( -path ./ghc -o -path ./ghc-prim \) -prune \) -o \( -name '*.haddock' -print \) \ +| sed 's!.*/\([^/]*\).haddock!--read-interface=\1,\0!') %preun @@ -211,7 +214,10 @@ fi %changelog -* Sun Oct 14 2008 Bryan O'Sullivan - 6.10.0.20081007-4 +* Tue Oct 14 2008 Bryan O'Sullivan - 6.10.0.20081007-5 +- Don't use a macro to update the docs for the main doc package + +* Tue Oct 14 2008 Bryan O'Sullivan - 6.10.0.20081007-4 - Add ghc_haddock_reindex macro - Generate haddock index after installing ghc-doc package