Debianize python package

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(Created page with "Create an instance in labs. sudo -s gem install fpm mkdir /mnt/workdir cd /mnt/workdir git://github.com/specialunderwear/debianize.sh.git Lookup your package at http://...")
 
Line 5: Line 5:
 
  mkdir /mnt/workdir
 
  mkdir /mnt/workdir
 
  cd /mnt/workdir
 
  cd /mnt/workdir
 +
 +
== 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.
 +
 +
== 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
 
  git://github.com/specialunderwear/debianize.sh.git
  

Revision as of 13:38, 17 January 2013

Create an instance in labs.

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

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.

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