[Distutils] Attempt at writing bdist_dpkg

amk at amk.ca amk at amk.ca
Mon Sep 22 08:22:28 EDT 2003

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

When you run it, 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.  


   * 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
   * Right now the .deb for a packaged "foo" is named "foo";
     it should be pythonX.Y-foo or whatever the Debian convention is.
   * The bdist_dpkg command needs to grow many options (e.g. setting
     the package name, using a particular file as the change log, etc.)

Suggestions are welcome.  If you have CVS access, feel free to modify the
code and check in your changes.


More information about the Distutils-SIG mailing list