Wednesday 7 June 2023

git-ubuntu build

Hi folks,

As git-ubuntu sees increasing use, including for such things as requests for
sponsorship of Debian merges, I've had an itch to scratch regarding the
complexity of passing correct flags to dpkg-buildpackage, so I spent some
time prototyping a git-ubuntu wrapper for it.

bzr-builddeb hasn't been useful for general work on Ubuntu packages for
quite a while, but the behavior of this wrapper is inspired by it.
Hopefully some of you will find using this tool pleasantly familiar!

The intent is that this will eventually become a git-ubuntu subcommand,
though there are some namespace questions to sort out first - the obvious
name for such a command IMHO would be 'git-ubuntu build' but that already
exists and does other things.

From initial feedback, I know a lot of developers are using sbuild to build
their source packages rather than invoking dpkg-buildpackage directly. I
would like to provide a corresponding wrapper for sbuild as a next step - I
would suggest this should eventually be called 'git-ubuntu sbuild'.

Anyway, I've been using this script in anger for a week, so I'd like to
welcome other folks to give it a try now as well.

To get started:

git clone lp:git-ubuntu
cd git-ubuntu
sudo mk-build-deps -i -r . (or: sudo apt build-dep .)
export PATH=$PATH:$(pwd)/sandbox

then cd to a git-ubuntu repo, and:

gu-build

Note that this calls the equivalent of `git-ubuntu prepare-upload args`
under the hood, so will push to a launchpad branch under your user.

Why this is useful:

- the syntax 'dpkg-buildpackage $(git-ubuntu prepare-upload args)' is
onerous and repetitive - but we want to encourage inclusion of these
headers in .changes files, as this lets us automate closure of git-ubuntu
MPs
- there are certain options that can be inferred as correct for any
git-ubuntu repo (-i -I)
- orig.tar.xz should be reconstituted or downloaded when needed, without
extra commands (we have pristine-tar branches in git-ubuntu which often
save having to do a duplicate download; having to clone a git repository
*and* apt source the package is meh)
- getting the correct options to dpkg-buildpackage by hand for a package
merge is tedious; this automates -v and -sa arguments.

Enjoy,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org