[Distutils] bdist_debian

Bastian Kleineidam calvin@cs.uni-sb.de
Sun Sep 3 16:42:00 2000

               Debian Packages with Distutils:

1) You are on a Debian system
   a) execute "dh_make --native" or see dh_make(1)
   b) adjust your debian/rules file:
              rm -rf debian/tmp # Distutils chokes on broken symlinks
              python setup.py build
              python setup.py clean --all
      install: build
              python setup.py install --root=`pwd`/debian/tmp
2) But I am running a non-Debian system
   a) Read something about the .deb format in deb(5):
      The  file is an ar archive with a magic number of !<arch>.
      The first member is named  debian-binary  and  contains  a
      series  of  lines,  separated by newlines.
      The second required member is named control.tar.gz. It is  
      a  gzipped  tar archive containing the package control
      The third, last required member is named data.tar.gz .  It
      contains the filesystem archive as a gzipped tar  archive.

   b) Be sure that you follow all of the Debian standards and
      requirements so that the package fits smoothly in any Debian
      Look at the documents in the debian-policy package.
      There are scripts to do this automatically: see debhelper(1).
      All this can be checked with the lintian Debian package.

Number 2) has two disadvantages:

1. All this code to produce Debian packages is existing, tested and
   working code. bdist_debain would only duplicate this effort.
   Espacially for 2b) there are numerous existing helper scripts in
   a Debian system.

2. Okay, lets assume implementing this whole number 2) thingy
   is not very hard (or you have enough spare time to do it),
   but then you remember deep in your mind the Debian FAQ 6.2:

   This internal format is subject to change (between major releases 
   of Debian GNU/Linux), therefore please always use dpkg-deb(8) for 
   manipulating .deb files.

   So you will run into problems sooner or later and you have to 
   update your software as the internal format changes. You can look 
   at the discussions about bdist_rpm and the RPM versions, thats 
   pretty much the same.

Bastian Kleineidam