The Haskell code uses tabs for indentation, and displays well with
tab-width set to 2. So, I created a .dir-locals.el (applies to all
files opened in emacs at or below ./), which sets 'tab-width' to 2,
turns on 'indent-tabs-mode', and highlights leading spaces in
'haskell-mode'.
The creation of the 'git-annex-shell' symlink was in 'postInst' hook.
I combined it with the man-page installation in a 'postInst' hook and
a 'postCopy' hook. I don't understand how to use the `cabal copy`
command, but the examples I looked at defined both hooks.
Relevant comments from the source:
* man-page installation:
See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages.
Based on pandoc's and lhs2tex's 'Setup.installManpages' and
'postInst' hooks.
My understanding: 'postCopy' is run for `cabal copy`, 'postInst' is
run for `cabal inst`, and copy is not a generalized install, so you
have to write two nearly identical hooks.
Summary of hooks:
http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple-UserHooks.htm--
Other people are also confused:
* Bug: 'postCopy' and 'postInst' are confusing:
http://hackage.haskell.org/trac/hackage/ticket/718
* A cabal maintainer suggests using 'postCopy' instead of
'postInst', because `cabal install` is `cabal copy` followed by
`cabal register`:
http://www.haskell.org/pipermail/libraries/2008-March/009416.html
Although that sounds desirable, it's not true, as the reply and
experiments indicate.
* the `cabal copy` command:
???: Not sure how you're supposed to use this. E.g., when I do
cabal install --prefix=/tmp/git-annex-install
cabal copy --deistdir=/tmp/git-annex-copy
I get the copy under
/tmp/git-annex-copy/tmp/git-annex-install
Also, `cabal install` fails when given a relative --prefix.
This ensures that all special remotes show up in git annex status.
Before, a special remote that was not manually described, and was not
a current git remote, did not show up there, although initremote did list
it.
This works with `cabal-dev install .`, but `cabal sdist` does not yet
include the man pages (tried adding a `make $(mans)` before `cabal
sdist` in `make sdist`, but no luck).
XXX: Need to go back and replace spaces with tabs.
The `cabal install git-annex` doesn't install the man pages, and the
Makefile only installed the man pages as part of a full build/install.
So, I factored out the documentation parts of the Makefile.
Anything that tries to open the file for write, or delete the file,
or replace it with something else, will not affect the add.
Only if a process has the file open for write before add starts
can it still change it while (or after) it's added to the annex.
(fsck will catch this later of course)