Difference between revisions of "Creating Debian packages from Cabal package"
Tomjaguarpaw (talk | contribs) (Warn that the page is outdated) |
m (Webpage "...PackageTemplate" doesn't exist) |
||
Line 124: | Line 124: | ||
TBD |
TBD |
||
+ | |||
+ | [[Category:Pages with broken file links]] |
Latest revision as of 04:59, 12 July 2021
[WARNING: This page is *extremely* out of date and likely to be obsolete]
Packaging a Cabal library package with haskell-devscripts for unstable
This is a little bit outdated. For up-to-date information about packaging for Debian, with the Debian Haskell Group, check: http://wiki.debian.org/Haskell/CollabMaint/PackageTemplate
This is the recommended way to package a Cabal library for Debian now. Example of how a package could be created, using:
- $package as the package name
- $version as the version of the package.
- $maintainerName as the name of the maintainer
- $maintainerEmail as the email of the maintainer
- $packageShortDescription as the Cabal short description of the package
- $packageLongDescription as the Cabal long description of the package
- wget http://hackage.haskell.org/packages/archive/$package/$version/$package-$version.tar.gz -O haskell-${package}_$version.orig.tar.gz
- tar -zxf haskell-$package_$version.orig.tar.gz
- cd $package-$version
- mkdir debian
cat << EOF > debian/control Source: haskell-$package Section: libdevel Priority: optional Maintainer: $maintainerName <$maintainerEmail> Standards-Version: 3.8.1 Build-Depends: debhelper (>= 5), cdbs, dpatch, haskell-devscripts (>= 0.6.15+nmu1), ghc6, ghc6-prof Build-Depends-Indep: ghc6-doc, haddock, hscolour Homepage: http://hackage.haskell.org/cgi-bin/$package/package/$package Package: libghc6-$package-dev Architecture: any Depends: ${haskell:Depends}, ${shlibs:Depends}, ${misc:Depends} Suggests: libghc6-$package-doc (= ${binary:Version}), libghc6-$package-prof (= ${binary:Version}) Description: $packageShortDescription This package provides a library for the Haskell programming language. See http://www.haskell.org/ for more information on Haskell. . $packageLongDescription Package: libghc6-$package-prof Architecture: any Depends: libghc6-$package-dev (= ${binary:Version}), ${haskell:Depends}, ${shlibs:Depends}, ${misc:Depends} Description: $packageShortDescription; profiling libraries This package provides a library for the Haskell programming language, compiled for profiling. See http://www.haskell.org/ for more information on Haskell. . $packageLongDescription Package: libghc6-$package-doc Section: doc Architecture: all Depends: ${misc:Depends} Recommends: ghc6-doc (>= 6.8.2) Suggests: libghc6-$package-dev (= ${binary:Version}) Description: $packageShortDescription; documentation This package provides the documentation for a library for the Haskell programming language. See http://www.haskell.org/ for more information on Haskell. . $packageLongDescription EOF
- echo 5 > debian/compat
- Create debian/copyright with your favorite editor:
Debianised by ... Author ... Copyright: BSD ... /usr/share/common-licenses/BSD ... EOF
cat << EOF > debian/rules #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/hlibrary.mk EOF
cat << EOF > debian/watch version=3 http://hackage.haskell.org/packages/archive/$package/([\d\.]+)/$package-([\d\.]+).tar.gz EOF
- dch --create -D unstable --package haskell-$package --newversion $version-1
- debuild -us -uc
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.
- wget http://hackage.haskell.org/packages/archive/mtl/1.0/mtl-1.0.tar.gz -O haskell-mtl_1.0.1.orig.tar.gz
- tar -zxf haskell-mtl_1.0.1.orig.tar.gz
- cd mtl-1.0
- mkdir -p debian/varfiles
- 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.) - Create debian/copyright with your favorite editor:
Debianised by ... Author ... Copyright: BSD ... /usr/share/common-licenses/BSD ... EOF
- dch --create -D unstable --package haskell-mtl --newversion 1.0.1-1
- update-debian-haskell-files
- debian/rules update-generated-files
- 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