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)
- All done, see point 6 for details.