stdeb produces Debian source packages from Python packages via a new
distutils command, sdist_dsc
. Automatic defaults are provided for
the Debian package, but many aspects of the resulting package can be
customized via a configuration file. An additional command,
bdist_deb
, creates a Debian binary package, a .deb file.
Contents
- 2009-11-02: Version 0.4.2 Released. See the download page. See the changelog and release notes.
- 2009-10-04: Version 0.4.1 Released. See the download page. See the changelog and release notes.
- 2009-09-27: Version 0.4 Released. See the download page. This version switches to debhelper 7, and thus requires Ubuntu Intrepid or Debian Lenny at a minimum (unless you use backports). See the Changelog for 0.4
- 2009-10-04: Version 0.3.2 Released. See the download page. See the Changelog for 0.3.2
- 2009-09-27: Version 0.3.1 Released. See the download page. See the Changelog for 0.3.1
- 2009-03-21: Version 0.3 Released. See the download page. See the Changelog for 0.3
- 2009-02-17: Version 0.2.3 Released. See the download page. See the Changelog for 0.2.3
- 2009-01-29: Version 0.2.2 Released. See the download page. See the Changelog for 0.2.2
- 2008-04-26: Version 0.2.1 Released. See the download page. See the Changelog for 0.2.1
- 2008-04-26: Version 0.2 Released. See the download page. See the Changelog for 0.2
- 2007-04-02: Version 0.2.a1 Released. See the old download page.
- 2006-06-19: Version 0.1 Released. See the old download page.
All methods eventually result in a call to the sdist_dsc
distutils
command. You may prefer to do so directly:
python -c "import stdeb; execfile('setup.py')" sdist_dsc
Alternatively, two scripts are provided:
stdeb_run_setup [options] # calls "python setup.py sdist_dsc [options]" py2dsc [options] mypackage-0.1.tar.gz # uses pre-built Python source package
In all cases, a Debian source package is produced from unmodified
Python packages. The following files are produced in a newly created
subdirectory deb_dist
:
packagename_versionname.orig.tar.gz
packagename_versionname-debianversion.dsc
packagename_versionname-debianversion.diff.gz
These can then be compiled into binary packages using the standard Debian machinery (e.g. dpkg-buildpackage).
Also, a bdist_deb
distutils command is installed. This calls the
sdist_dsc command and then runs dpkg-buildpackage on the result:
python -c "import stdeb; execfile('setup.py')" bdist_deb
Do this from the directory with your setup.py file:
python -c "import stdeb; execfile('setup.py')" bdist_deb
This will make a Debian source package (.dsc, .orig.tar.gz and
.diff.gz files) and then compile it to a Debian binary package (.deb)
for your current system. The result will be in deb_dist
.
Warning: installing the .deb file on other versions of Ubuntu or Debian than the one on which it was compiled will result in undefined behavior. If you have extension modules, they will probably break. Even in the absence of extension modules, bad stuff will likely happen.
For this reason, it is much better to build the Debian source package and then compile that (e.g. using Ubuntu's PPA) for each target version of Debian or Ubuntu.