Attempt at writing bdist_dpkg
[This is a repeat of a note sent to the distutils-sig. This list
seems like a better place for discussing bdist_dpkg.]
I've found myself making a lot of Debian packages for various Python modules,
so I've started working on a bdist_dpkg.py module for Distutils. Currently
it's in nondist/sandbox/Lib/ in the Python CVS; you can download
a copy from
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondist/sandbox/Lib/bdist_dpkg.py
.
When you run "setup.py bdist_dpkg", it creates a debian/ subdirectory
containing a dummy changelog and default versions of control and rules.
prerm and postinst are also created to compile .py files to .pyc and to
remove them. Generated debian/ files contain a special marker and only
files containing this marker will be overwritten, so if you have a custom
rules or preinst file it won't be stomped on.
Currently it works well enough for building simple packages; I've already
built some packages for internal use and they seem to be fine. The code
still needs more polishing to be generally useful.
Issues:
* I can't figure out a way to put the marker in the 'control' and
'changelog' files, because their formats don't seem to support
comments. Any suggestions about how to do this?
* The bdist_dpkg command needs to grow many options (e.g. setting the
package name, build number, using a particular file as the change log,
etc.) I'll get around to adding them before too long.
* For packages with C extensions: how do I figure out what to put in
the 'Architecture:' line in the control file? Is uname -a correct?
Suggestions and patches are welcome. If you have write access to the Python
CVS tree, feel free to modify the code and check in your changes.
--amk
Reply to: