Introduction ============ This directory contains a template for a Cabalized and Debianized Haskell library. In the remainder of this document I will describe how to use these files to Debianize a Haskell library of your choice. I assume that you already have some familiarity with cabal and debian. If you need additional information you can visit: http://www.haskell.org/ghc/docs/latest/html/Cabal/ http://www.debian.org/doc/debian-policy/ http://www.debian.org/doc/maint-guide/ http://www.google.com/ Getting The Template ==================== To retrieve the latest version of the cabalDebianTemplate run: darcs get http://www.n-heptane.com/nhlab/repos/cabalDebianTemplate You should be able to 'apt-get install darcs' if you do not already have it installed. The darcs homepage is: http://abridgegame.org/darcs/ Merge The Template And Your Library =================================== (1) copy the cabalDebianTemplate to a directory such as 'yourpackage-1.0', e.g. $ cp -a cabalDebianTemplate yourpackage-1.0 (2) copy your library into the yourpackage-1.0 directory: $ cp -a YourPackage yourpackage-1.0 (3) change your working directory to yourpackage-1.0 $ cd yourpackage-1.0 Update .cabal To Reflect Your Package ============================== (1) Rename Package.cabal to YourPackage.cabal $ mv Package.cabal YourPackage.cabal (2) Edit YourPackage.cabal Update Debianization To Reflect Your Package ============================================ Update Descriptions, Copyright, etc ----------------------------------- (1) update debian/copyright (2) edit debian/control and change: (a) 'package' to 'yourpackage' [NOTE: You will need to make the change in several places, but not *everywhere* that package appears, sorry about that.] (b) change 'Description' fields (3) edit debian/changelog (a) change haskell-package to haskell-yourpackage (b) update version number (b) update email/timestamp line Update Dependencies ------------------- (1) edit debian/control and add any extra Build-Depends/Build-Depend-Indep (2) if required, add package specific Depends If Your Package Has Documentation --------------------------------- (1) rename debian/haskell-package-doc.docs to debian/haskell-yourpackage-doc.docs (2) Edit Makefile and change the 'doc' target as necessary - by default it just attempts to build Haddock documentation If Your Package Does Not Have Documentation ------------------------------------------- (1) remove the haskell-package-doc paragraph from debian/control (2) delete the call to 'make doc' from debian/rules (3) remove the file debian/haskell-package-doc.docs Makefile -------- The template contains a default Makefile. It is mostly provided so that people can just run 'make && make install' and not have to know how Cabal works. However, it also contains two targets that debian/rules invokes: 'clean' and 'doc'. If you wish to provide your own Makefile or your wish to remove the Makefile, make sure you update debian/rules accordingly. Using update-haskell-control ============================ If you prefer, you may use update-haskell-control to manage the build and install dependencies instead of letting dh_haskell take care of it. I have not tried it myself, but I think you can just: (1) rename debian/control to debian/control.in (2) edit debian/control.in and (a) remove the ${haskell:Depends} references (b) add whatever markup update-haskell-control requires BUGS ==== The build will currently fail if you do not have at least one architecture independent paragraph in your control file. If your source package contains both libraries and executables, then you will need to adapt the framework to still the executables into a seperate package. I believe they will currently be installed in the -dev package by default.