1. Debian packaging for Python applications and
libraries
Sheffield Python Group
25 September 2012
Thomas Kluyver
2. Overview
● Making a package
– The debian/ directory
– Source packages
– Binary packages
● PPAs & recipe builds
● Submitting to Debian or Ubuntu
● The future
3. debian/
● control – metadata for your source package
and binary package(s)
● rules – makefile describing how to build your
package
● changelog – records each version of the
package, defines version number
● patches/ – changes applied to the source
before building it.
● copyright – license info for every file
● watch – where to check for newer versions
5. Binary packages
taxonome_0.12-1ppa1_all.deb
● This is what you install
● Different ways to build:
– Local build
– pbuilder (creates a separate installation)
– Build servers (for all published packages)
7. PPAs
● Personal Package Archives
● Build and publish your own packages
● Users add PPA to install packages:
– sudo apt-add-repository
ppa:takluyver/taxonome
● Recipe builds: build from VCS every day
– Testing, dogfooding
8. Submitting packages
● ITP: intent to package
● RFS: request for sponsorship
● lintian: automated nitpicking
– --pedantic
– lintian4py
● DFSG: Debian Free Software Guidelines
– be very clear about copyright
● Ubuntu MyApps system
– Applications only, should be simpler
– Some teething trouble with reviewing
9. The Future
Can we use distutils metadata to make Debian
packages automatically?
● Stdeb (not exactly future)
– https://github.com/astraw/stdeb
● pkgme
– https://launchpad.net/pkgme
● PyPI to Debian repository convertor
– https://gitorious.org/pypi2deb
10. More information
● Lots of info on the web, but alternative tools
make it confusing.
● A clear starting point is the Ubuntu packaging
guide:
http://developer.ubuntu.com/packaging/html/python-packaging.html
● Debian Python Modules Team (DPMT) and
Python Apps Packaging Team (PAPT) can
help, but aren’t always newcomer-friendly.