Difference between revisions of "Creating Debian packages from Cabal package"

From HaskellWiki
Jump to navigation Jump to search
(I was bitten.)
(Separating packaging of libraries and programs (no info on the latter though), and some beautification)
Line 1: Line 1:
== Packaging a Cabal package in 10 easy steps ==
+
== Packaging a Cabal library package in 10 easy steps ==
   
 
''This process requires the <tt>haskell-utils</tt> package.''
 
''This process requires the <tt>haskell-utils</tt> package.''
   
Here is an example on was created a new Debian package out of an Haskell [[Cabal]] package: [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mtl-1.0 mtl].
+
Here is an example on was created a new Debian package out of an Haskell [[Cabal]] library package: [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mtl-1.0 mtl].
   
  +
<ol>
1. <tt>wget http://hackage.haskell.org/packages/archive/mtl/1.0/mtl-1.0.tar.gz -O haskell-mtl_1.0.1.orig.tar.gz</tt>
+
<li><tt>wget http://hackage.haskell.org/packages/archive/mtl/1.0/mtl-1.0.tar.gz -O haskell-mtl_1.0.1.orig.tar.gz</tt></li>
 
2. <tt>tar -zxf haskell-mtl_1.0.1.orig.tar.gz</tt>
+
<li><tt>tar -zxf haskell-mtl_1.0.1.orig.tar.gz</tt></li>
  +
<li><tt>cd mtl-1.0</tt>`</li>
 
3. <tt>cd mtl-1.0</tt>`
+
<li><tt>mkdir -p debian/varfiles</tt></li>
 
<li>Create <tt>debian/varfiles/varfile</tt> with your favorite editor:
 
 
<pre> maintainer="Ian Lynagh (wibble) <igloo@debian.org>"
4. <tt>mkdir -p debian/varfiles</tt>
 
 
short_description="Haskell monad transformer library for GHC"
 
 
long_description=" MTL is a monad transformer library, inspired by the paper \"Functional
5. Create <tt>debian/varfiles/varfile</tt> with your favorite editor:
 
 
Programming with Overloading and Higher-Order Polymorphism\",
<pre>maintainer="Ian Lynagh (wibble) <igloo@debian.org>"
 
 
by Mark P Jones (<http://www.cse.ogi.edu/~mpj/>), Advanced School
short_description="Haskell monad transformer library for GHC"
 
 
of Functional Programming, 1995."
long_description=" MTL is a monad transformer library, inspired by the paper \"Functional
 
 
c_dev_libs=""
Programming with Overloading and Higher-Order Polymorphism\",
 
 
extra_build_deps=""</pre>
by Mark P Jones (<http://www.cse.ogi.edu/~mpj/>), Advanced School
 
 
(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.)</li>
of Functional Programming, 1995."
 
  +
<li>Create <tt>debian/copyright</tt> with your favorite editor:
c_dev_libs=""
 
 
<pre> Debianised by ...
extra_build_deps=""
 
 
Author ...
</pre>
 
 
Copyright: BSD ... /usr/share/common-licenses/BSD ...
 
  +
EOF</pre></li>
(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.)
 
 
<li><tt>dch --create -D unstable --package haskell-mtl --newversion 1.0.1-1</tt></li>
 
6. Create <tt>debian/copyright</tt> with your favorite editor:
+
<li><tt>update-debian-haskell-files</tt></li>
 
<li><tt>debian/rules update-generated-files</tt></li>
<pre>
 
 
<li><tt>debuild -us -uc</tt></li>
Debianised by ...
 
 
</ol>
Author ...
 
Copyright: BSD ... /usr/share/common-licenses/BSD ...
 
EOF
 
</pre>
 
 
7. <tt>dch --create -D unstable --package haskell-mtl --newversion 1.0.1-1</tt>
 
 
8. <tt>update-debian-haskell-files</tt>
 
 
9. <tt>debian/rules update-generated-files</tt>
 
 
10. <tt>debuild -us -uc</tt>
 
   
 
With luck the <tt>.cabal</tt> file will provide most of the text for steps 5 and 6.
 
With luck the <tt>.cabal</tt> file will provide most of the text for steps 5 and 6.
Line 49: Line 38:
   
 
Please subscribe to the [http://urchin.earth.li/mailman/listinfo/debian-haskell debian-haskell] mailling-list if you are interested in creating new Haskell packages for Debian.
 
Please subscribe to the [http://urchin.earth.li/mailman/listinfo/debian-haskell debian-haskell] mailling-list if you are interested in creating new Haskell packages for Debian.
  +
  +
== Packaging a Cabal program package in N easy steps ==
  +
  +
TBD

Revision as of 07:02, 1 April 2008

Packaging a Cabal library 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 library package: mtl.

  1. wget http://hackage.haskell.org/packages/archive/mtl/1.0/mtl-1.0.tar.gz -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) <igloo@debian.org>"
        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 (<http://www.cse.ogi.edu/~mpj/>), Advanced School
        of Functional Programming, 1995."
        c_dev_libs=""
        extra_build_deps=""
    (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 ...
        EOF
  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.

Packaging a Cabal program package in N easy steps

TBD