Building packages from the &git; repository
In order to build a &debian; package from the &git; repository you use:
&git-buildpackage;. This builds the upstream tarball as will be described below and
invokes &debuild; to build the package. To use another build command you
can use the option as described later in the manual
but &debuild; is nice since it can invoke linda
und lintian.
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;
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 . Any
other treeish objecto to create the upstream tarball from can be given with
the option.Once you're satisfied with the build and want to do a release you commit all
your changes and issue:
&git-buildpackage;
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 and
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
option, the default is debian/<version>.Using a separate build dirTools like &svn-buildpackage; use a separate build-area. To achieve a similar behaviour
with &git-buildpackage; use the option:
&git-buildpackage; =../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
to export any treeish object, here are some
examples:
&git-buildpackage; =../build-area =debian/0.4.3
&git-buildpackage; =../build-area =etch
&git-buildpackage; =../build-area =8caed309653d69b7ab440e3d35abc090eb4c6697If 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
export-dir=../build-area
# to use the same build area for all packages use an absolute path:
#export-dir=/home/debian-packages/build-area
Pushing into a remote repository:If you want to push your changes automatically after a succesful build and tag
you can use &git-buildpackage;'s posttag hook:
git-buildpackage ="git push && git push --tags"
This assumes you have set up a remote repository to push to in either
.git/config or
.git/remotes/. Setting up the posttag hook in
.gbp.conf looks like:
="git push git.debian.org && git push --tags git.debian.org"