sabato 17 novembre 2012

Python-stdeb

This is what i've done, to make a shiny python library of mine becomes a fully respectable deb package.
~$ sudo apt-get install python-stdeb
view raw gistfile1.sh hosted with ❤ by GitHub
Move in your python directory, where everything has been started and create your setup.py file, more or less like this sample:
from setuptools import setup
setup(
name='my_py_lib',
version='1.2.0',
description='PyLib is what you need',
packages=['mypylib']
)
view raw gistfile1.py hosted with ❤ by GitHub
So, in your directory you list:
* setup.py
* mypylib/__init__.py
view raw gistfile1.txt hosted with ❤ by GitHub
Create the stdeb configuration file stdeb.cfg
[mypylib]
Package: mypylib
Maintainer: ZMo <simoneroselli78 gmail.com>
view raw gistfile1.txt hosted with ❤ by GitHub
This file will write parameters in the soon generated DEBIAN/control file. A complete list of the parameters translation is here: http://pypi.python.org/pypi/stdeb#stdeb-cfg-configuration-file
Given that, build your package with:
~$ python setup.py --command-packages=stdeb.command bdist_deb
view raw gistfile1.sh hosted with ❤ by GitHub
NOTE: It will compile the package with mypylib-"version"; the version is the one written in setup.py (version="")

enjoy your deb_dist directory.

Nessun commento:

Posta un commento