man dh_haskell (Commandes) - Builds Cabalized libraries, calculates Haskell dependencies, and adds postinst and prerm Haskell scripts
NAME
dh_haskell - Builds Cabalized libraries, calculates Haskell dependencies, and adds postinst and prerm Haskell scripts
SYNOPSIS
dh_haskell [debhelper options]
DESCRIPTION
dh_haskell is a debhelper program that helps with building Haskell libraries.
It does several things. It can generat postinst and prerm scripts when necessary. It automates building libraries for the different supported Haskell systems in Debian. It generates substvars for your control file so that the library packages depend on the appropriate packages. In short, it can drive the entire process.
REQUIREMENTS
dh_haskell assumes that your packages are adhering to the draft Haskell policy.
Your control file must build the binary library files using packages named libtype-name-dev, where type is ghc5, ghc6, or nhc98; and name is the name of your package. These packages should be Architecture: any.
If you build a Hugs package, name it libhugs-name. However, dh_haskell will also accept libhugs-name-dev for consistency. Most Hugs packages should be Architecture: all. If your package uses foreign methods, maybe it should be Architecture: any (please let me know if you have an answer to that).
dh_haskell figures out how to build your package based on the type, so you must adhere to this naming scheme.
dh_haskell assumes that the Haskell Cabal (see www.haskell.org/cabal) can be used to build your package. It obtains package name and version information from the Cabal Setup.Description file.
HOW TO PACKAGE A HASKELL LIBRARY
Start from a basic debian/ directory. Add entries to Build-Depends for haskell-devscripts and the compilers for any binaries you will build.
In the clause in control for each binary package, make sure to add ${haskell:Depends} to the Depends: line.
In rules, in the install target, add dh_haskell. Your build and configure targets should be empty.
Remember that you should add -a to all debhelper calls for multi-binary packages. That goes for dh_haskell too.
Your clean target should contain:
CW-./setup clean CW--rm -rf setup Setup.hi Setup.ho Setup.o .*config* dist
That's it. dh_haskell does the rest.
EXAMPLE
See the Debian source package for hunit.
BUGS
hugs, ghc6, and ghc5 are the only supported targets at the moment. Cabal does not yet support nhc98. Note though that there are some known bugs in Cabal relating to ghc5 support.
SEE ALSO
AUTHOR
John Goerzen <jgoerzen@complete.org>
Based on ideas in dh_python by Josselin Mouette <joss@debian.org>