Debianising with bzr-builddeb

Bzr build-deb is very nice, but it can be very tricky to get started. I recently did a fresh debianisation of a project that is in bzr upstream, and I thought I’d record the recipe to make it work (at least until the various bugs making it hard re fixed).

Assuming that the upstream uses bzr, it goes like this:

  1. Start with a branch that is close to the code you want to Debianise. E.g. if the release was off trunk, 3 commits back: bzr branch trunk -r -3 debian
  2. Debianise as normal: put the tarball with the right name in the parent dir,  add a debian directory and fiddle until you build a package you’re happy with. Don’t commit while doing this.
  3. Build a source package- debuild -S, or bzr builddeb -S
  4. Revert your changes – bzr revert.
  5. Import the dsc – bzr import-dsc ../*.dsc
  6. Now, you may find that some dot files, such as .bzrignore have been discarded inappropriately (there is a bug open on this). If that happened, keep going. Otherwise, you’re done: you can now use merge-upstream on future upstream releases, and debcommit etc.
  7. bzr uncommit
  8. bzr revert .bzrignore (and any other files that you want to get back)
  9. debcommit
  10. All done, see point  6 for details.



2 thoughts on “Debianising with bzr-builddeb

  1. I find it far simpler to track the Debian packaging as its own branch, separate from the pristine source.

    * bzr init-repository fooproject/
    * mkdir fooproject/tarballs/
    * wget -O fooproject/tarballs/fooproject_1.2.3.orig.tar.gz
    * bzr init fooproject/fooproject.debian/
    * cd fooproject/fooproject.debian/
    * mkdir debian/
    * emacs debian/{control,changelog,watch,rules}
    * bzr-buildpackage –merge –source
    * pbuilder –build ../build-area/foopackage_1.2.3-1.dsc

    No need for reverting or messing around with versions; apply the packaging onto the pristine source, which mirrors how it will be done when building the package anyway.

  2. The style I describe has a separate branch, but permits simple ‘bzr merge’ commands to get patches from upstream into the package, and from the package into upstream; its also the way that the packaging branches for Ubuntu /all/ work.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s