Building packages from the Git repository

In order to build a Debian package from the Git repository you use: git-buildpackage. During the development phase (when you're either not on the debian-branch or when you have uncommitted changes in your repository) you'll usually use:

git-buildpackage --git-ignore-new

If git-buildpackage doesn't find a valid upstream tarball it will create one by looking at the tag matching the upstream version, if no tag can be found it uses the tip of the current upstream-branch. Any other treeish objecto to create the upstream tarball from can be given with the --upstream-branch option.

Once you're satisfied with the build and want to do a relese you commit all your changes and issue:

git-buildpackage --git-tag

This will again build the debian package and tag the final result after extracting the current version from the changelog. If you want GPG signed tags you can use the --git-sign and --git-keyid options. To safe typing these option can be specified via the configuration files. You can futhermore change the tag format used when creating tags with the debian-tag option.


Using a separate build dir

Tools like svn-buildpackage use a separate build-area. To achieve a similar behaviour with git-buildpackage use the --export-dir option:

git-buildpackage --export-dir=../build-area/

This will export the current branch head to ../build-area/package-version, check out the corresponding upstream tree to build the .orig.tar.gz if necessary and build the package. If you don't want to export the current branch head you can use --export to export any treeish object, here are some examples:

git-buildpackage --export-dir=../build-area --export=debian/0.4.3
git-buildpackage --export-dir=../build-area --export=etch
git-buildpackage --export-dir=../build-area --export=8caed309653d69b7ab440e3d35abc090eb4c6697

If you want to default to build in a separate build area you can specify the directory to use in the gbp.conf.

[git-buildpackage]
# use a build area relative to the git repository
build-area=../build-area
# to use the same build area for all packages use an absolute path:
#build-area=/home/debian-packages/build-area