Debian packaging for Python applications and
                  libraries

           Sheffield Python Group
            25 September 2012

              Thomas Kluyver
Overview
●   Making a package
    –   The debian/ directory
    –   Source packages
    –   Binary packages
●   PPAs & recipe builds
●   Submitting to Debian or Ubuntu
●   The future
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
Source package
●   taxonome_0.12.orig.tar.gz
●   taxonome_0.12-1ppa2.debian.tar.gz
●   taxonome_0.12-1ppa2.dsc
●   taxonome_0.12-1ppa2_source.changes
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)
Demos
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
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
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
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.

Debian packaging talk, Pysheff sept 2012

  • 1.
    Debian packaging forPython 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
  • 4.
    Source package ● taxonome_0.12.orig.tar.gz ● taxonome_0.12-1ppa2.debian.tar.gz ● taxonome_0.12-1ppa2.dsc ● taxonome_0.12-1ppa2_source.changes
  • 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)
  • 6.
  • 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 weuse 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.