Debianize python package

From Wikitech
(Difference between revisions)
Jump to: navigation, search
 
Line 55: Line 55:
 
  python-voluptuous_0.6_all.deb
 
  python-voluptuous_0.6_all.deb
 
  $
 
  $
 +
 +
[[Category:Package management]]

Latest revision as of 08:09, 10 February 2013

Create an instance in labs.

sudo -s
gem install fpm
mkdir /mnt/workdir
cd /mnt/workdir

[edit] Official way

http://wiki.debian.org/Python/Packaging


[edit] Using fpm

Pass to fpm the source type (-s python) and the target package system (-t deb) then the package name.

Quick example:

# fpm -s python -t deb  voluptuous
Created deb package {:path=>"/mnt/workdir/take2/python-voluptuous_0.6_all.deb"}
# ls *.deb
python-voluptuous_0.6_all.deb

Long example:

fpm -s python -t deb \
  --maintainer "First Last <user@host.tld>" \
  --iteration wmf1 \
  --license BSD \
  --description 'Voluptuous, despite the name, is a Python data validation library. It is primarily intended for validating data coming into Python as JSON, YAML, etc.' voluptuous

You have now a very basic package.

[edit] Using debianize.sh

debianiaze.sh is a wrapper around fpm that will take care of fetching any dependencies for you and build them as well.

git://github.com/specialunderwear/debianize.sh.git

Lookup your package at http://pypi.python.org/ . We will use voluptuous as an example.

# cd /mnt/workdir
// download:
# wget http://pypi.python.org/packages/source/v/voluptuous/voluptuous-0.6.tar.gz
// uncompress
# tar -xvzf voluptuous-0.6.tar.gz
# cd /mnt/workdir/voluptuous-0.6
// build!
# ../debianize.sh/debianize.sh -m "Antoine Musso <hashar@free.fr>"

If all goes well, you will end up with some deb packages:

$ ls -1 *.deb
python-distribute_0.6.34_all.deb
python-voluptuous_0.6_all.deb
$
Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox