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:
- 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
- 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.
- Build a source package- debuild -S, or bzr builddeb -S
- Revert your changes – bzr revert.
- Import the dsc – bzr import-dsc ../*.dsc
- 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.
- bzr uncommit
- bzr revert .bzrignore (and any other files that you want to get back)
- debcommit
- All done, see point 6 for details.
Hope-this-helps
Advertisements
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 http://example.org/fooproject/fooproject-1.2.3.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.
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.