Packaging

These notes will be updated to proper documentation soon.

IMPORTANT — when building for the PPA, be very, very careful that you upload the proper, bona-fide upstream tarball available from the downloads page. Oh yes.

General:

  • Packaging info kept in main tree, under packages
  • Build script is “packages/make.py”
  • Package directories are merged with the main tree to create packages, eg. packages/ubuntu/debian gets moves to the top level

Policy:

  • Only use packaging control files and patches against the source tree. Do not directly modify source tree files and keep them under packaging. Most distros have some sort of build-time patch system.
  • Don't go nuts trying anything fancy with distro detection, just create new packaging directories

Build script:

  • “packages/make.py” is the build script for packages
  • Run it with “make.py distro command” eg. “make.py debian binary” or “make ubuntu-karmic ppa”
  • It should give a usage message if run incorrectly, or with ”–help”
  • The output files will end up in the directory above your RabbitVCS dir, or you can specify another with ”-o/–ouputdir”
  • The build script uses a temporary directory to build: usually ”/tmp/rabbitvcs-” + (some random letters). All non-directory files are then copied back to your output dir, and the temporary dir is removed.
  • The script selects “builders” based on whether the directory matches a regular expression.
Distribution Regexp Builder Comments
generic Generic tarball: Builds a simple tarball of the current state of the tree
debian.*, ubuntu.* Debian binary: builds a binary deb package
source: builds a source package (a .dsc etc package)
ppa: builds a source-based package ready for upload to the PPA
official: a binary package as per Debian requirements for upload
fedora.* Fedora Not implemented yet, coming soon

PBuilder

PBuilder is a personal package builder for Debian/Ubuntu packages. It builds packages inside a chroot, in effect emulating how your package would build on a completely pristine installation. It is incredibly useful for identifying build dependencies and other problems.

Useful trick: Using pbuilder (along with my config files detailed under that link below), I can create a port for any Debian/Ubuntu distro using DIST=whatever make ubuntu binary -p (where “whatever” is the target distro, eg. “jaunty”, “squeeze”, etc).

Here are some useful notes on PBuilder notes.