[Fedora-haskell-list] guidelines install scripts
Jens Petersen
petersen at redhat.com
Mon Nov 24 07:53:22 UTC 2008
Hi,
So I have been thinking a bit more about the install scripts in the guidelines, since there seems to me to be no good reason to run ghc-pkg and gen_contents_index more than once per rpm transaction. (Perhaps we should even recommend subpackaging ghc packages.)
But I thought I would just ask here once before committing and building the change below to make sure I am not missing something:
--- ghc-rpm-macros.ghc 23 Oct 2008 08:31:20 -0000 1.8
+++ ghc-rpm-macros.ghc 24 Nov 2008 07:30:44 -0000
@@ -40,7 +40,6 @@
%{nil}
%ghc_preinst_script \
-[ "$1" = 2 ] && %{pkg_libdir}/unregister.sh >&/dev/null || : \
%{nil}
%ghc_postinst_script \
@@ -48,11 +47,10 @@
%{nil}
%ghc_preun_script \
-%{pkg_libdir}/unregister.sh >&/dev/null \
+[ "$1" = 0 ] && %{pkg_libdir}/unregister.sh >&/dev/null \
%{nil}
%ghc_postun_script \
-[ "$1" = 1 ] && %{pkg_libdir}/register.sh >& /dev/null || : \
%{nil}
%ghc_reindex_haddock \
Summarizing: %ghc_preinst_script and %ghc_postun_script should not been needed since ghc_postinst_script runs "ghc-pkg update".
And %ghc_reindex_haddock only needs to be run in %post not %postun.
Jens
ps We probably also need to think a bit of how to handle indexing with different haddock versions: gtk2hs.darcs requires haddock-2.4 to build docs, so we can't index with it unless we rebuild ghc with haddock-2.4 - we could just skip %ghc_reindex_haddock for gtk2hs for now though, but probably need to ressurrect haddock in rawhide for gtk2hs docs.
More information about the Fedora-haskell-list
mailing list