Personal tools

Creating Debian packages from Cabal package

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Document the process of creating a new Debian package from a Cabal package)
(I was bitten.)
Line 23: Line 23:
(Pay attention to the leading space in <tt>long_description</tt>.  It's necessary due to the format of Debian's <tt>control</tt> file.)
6. Create <tt>debian/copyright</tt> with your favorite editor:
6. Create <tt>debian/copyright</tt> with your favorite editor:

Revision as of 07:43, 25 October 2007

Packaging a Cabal package in 10 easy steps

This process requires the haskell-utils package.

Here is an example on was created a new Debian package out of an Haskell Cabal package: mtl.

1. wget -O haskell-mtl_1.0.1.orig.tar.gz

2. tar -zxf haskell-mtl_1.0.1.orig.tar.gz

3. cd mtl-1.0`

4. mkdir -p debian/varfiles

5. Create debian/varfiles/varfile with your favorite editor:

maintainer="Ian Lynagh (wibble) <>"
short_description="Haskell monad transformer library for GHC"
long_description=" MTL is a monad transformer library, inspired by the paper \"Functional
Programming with Overloading and Higher-Order Polymorphism\",
by Mark P Jones (<>), Advanced School
of Functional Programming, 1995."

(Pay attention to the leading space in long_description. It's necessary due to the format of Debian's control file.)

6. Create debian/copyright with your favorite editor:

Debianised by ...
Author ...
Copyright: BSD ... /usr/share/common-licenses/BSD ...

7. dch --create -D unstable --package haskell-mtl --newversion 1.0.1-1

8. update-debian-haskell-files

9. debian/rules update-generated-files

10. debuild -us -uc

With luck the .cabal file will provide most of the text for steps 5 and 6.

When making future changes, apart from adding a changelog entry (use dch), only steps 9 and 10 need to be repeated.

Even if packaging Haskell libraries seems easy, the Debian Policy and the Developers Reference contains a lot of valuable informations on how to create a policy compliant Debian package.

Please subscribe to the debian-haskell mailling-list if you are interested in creating new Haskell packages for Debian.