[Tutor] Standard way to create debian packages for python programs?
Mac Ryan
quasipedia at gmail.com
Thu Aug 18 14:33:21 CEST 2011
Although it's years I program with python, I never distributed my
software with packages (I never created *any* packages in my life,
indeed).
Out there there is ton of information on how to do this, but after a
day of scouring the Internet I still did not wrap my mind around it.
The problem for me is that "there is more than a way to skin a cat",
and all the tutorials/manuals that cover a bit of the process seem to
make certain assumptions which are different from other tutorials, sot
that is not self-evident how I should merge the info from two sources
together. For example: when I find a manual on how to create a binary
package, it is assumed there are makefile for C code, when I find a
page on how to use distutils, it is assumed I want to "package" a
module and not a stand-alone program, etc...
So I am turning to the community to ask for advice/guidance. So far I
seem to have understood the following (please correct me if I
am wrong):
a) I need to create a "binary" .deb package. Such package will be
platform independend (32 vs 64 bit) as all python programs are such.
b) To create a "binary" package I need first to create a source
package.
c) To create the source package I can use either CDBS or debhelper.
Debhelper is the recommended way for beginners.
d) The core of creating a source package is populating the DEBIAN
directory in the source directory with a number of files clarifying
where files need to be copied, what copyright and licensing scheme
they are subject to, what dependencies they have, etc...
e) Step d) can be largely automated the 'dh_make' command IF the python
source also comes with a distutils' setup.py script.
Now my questions:
1. Is my understanding of the process correct? Is there anything I am
missing, or anything that I got wrong?
2. Step e) is really the more confusing to me: specifically the two
points that remains most obscure to me are:
I. How do I write a script that install a stand-alone programe?
II. What are the specificities for DEB packages? The official
documentation only seems to deal with RPM and Windows stuff...
3. Is there any "reasonable sized" source of information that you would
recommend me to read [by "reasonable sized" I mean something
specific to python and concise, rather that the complete debian
policy on packaging].
4. Any word of wisdom / additional info you would like to share?
BTW: This is are the best source of information that I could find myself
so far:
- Ubuntu's python packaging guide (clearly explains steps a-b-c):
https://wiki.ubuntu.com/PackagingGuide/Python#The_debhelper_way
- Creating a .deb package from a python setup.py (it _shows_ the steps
but doesn't _explain_ them enough for me to follow along):
http://ghantoos.org/2008/10/19/creating-a-deb-package-from-a-python-setuppy/
- ShowMeDo video on "creating a .deb package out of a python
program" (it doesn't seem up-to-date and - if I got it right - will
produce packages for personal use, without dependencies and without
key data for distribution with ubuntu/debian):
http://showmedo.com/videotutorials/series?name=linuxJensMakingDebSeries
Thanks in advance for your help and support!
/mac
More information about the Tutor
mailing list