From 354d10e225640c7ffb2bb25b1900c62c74271fb3 Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Tue, 14 Oct 2008 18:55:27 +0000 Subject: [PATCH] Generate haddocks after installing ghc-doc --- ghc-rpm-macros.ghc | 8 ++++++++ ghc.spec | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index d91b7e1..82c6bf7 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -55,3 +55,11 @@ install -m 755 register.sh unregister.sh ${RPM_BUILD_ROOT}%{pkg_libdir} \ [ "$1" = 1 ] && %{pkg_libdir}/register.sh >& /dev/null || : \ %{nil} +%ghc_haddock_reindex \ +if [ -f /usr/bin/haddock -a -d /usr/share/doc/ghc/libraries ]; then \ +cd /usr/share/doc/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!'); \ +fi \ +%{nil} diff --git a/ghc.spec b/ghc.spec index 74108d0..f745dbe 100644 --- a/ghc.spec +++ b/ghc.spec @@ -16,7 +16,7 @@ Name: ghc Version: 6.10.0.20081007 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Glasgow Haskell Compilation system # See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239713 ExcludeArch: alpha ppc64 @@ -168,6 +168,11 @@ update-alternatives --install %{_bindir}/runhaskell runhaskell \ update-alternatives --install %{_bindir}/hsc2hs hsc2hs \ %{_bindir}/hsc2hs-ghc 500 + +%post doc +%ghc_haddock_reindex + + %preun if test "$1" = 0; then update-alternatives --remove runhaskell %{_bindir}/runghc @@ -195,10 +200,21 @@ fi %files doc %defattr(-,root,root,-) %{_docdir}/%{name} +%ghost %{_docdir}/%{name}/libraries/doc-index.html +%ghost %{_docdir}/%{name}/libraries/haddock.css +%ghost %{_docdir}/%{name}/libraries/haddock-util.js +%ghost %{_docdir}/%{name}/libraries/haskell_icon.gif +%ghost %{_docdir}/%{name}/libraries/index.html +%ghost %{_docdir}/%{name}/libraries/minus.gif +%ghost %{_docdir}/%{name}/libraries/plus.gif %endif %changelog +* Sun Oct 14 2008 Bryan O'Sullivan - 6.10.0.20081007-4 +- Add ghc_haddock_reindex macro +- Generate haddock index after installing ghc-doc package + * Mon Oct 13 2008 Jens Petersen - 6.10.0.20081007-3 - provide haddock = 2.2.2 - add selinux file context for unconfined_execmem following darcs package