gbp-buildpackagegbp-buildpackage — Build Debian™ packages from a Git repository |
gbp buildpackage
[--git-[no-]ignore-new
] [--git-tag
] [--git-verbose
] [--git-color=
[auto|on|off]] [--git-color-scheme
=COLOR_SCHEME
] [--git-notify=
[auto|on|off]] [--git-upstream-branch=
TREEISH
] [--git-debian-branch=
BRANCH_NAME
] [--git-ignore-branch
] [--git-[no-]submodules
] [--git-builder=
BUILD_CMD
] [--git-cleaner=
CLEAN_CMD
] [--git-[no-]overlay
] [--git-[no-]pbuilder
] [--git-[no-]qemubuilder
] [--git-dist=
DIST
] [--git-arch=
ARCH
] [--git-[no-]pbuilder-autoconf
] [--git-pbuilder-options
=PBUILDER_OPTIONS
] [--git-[no-]sign-tags
] [--git-keyid=
GPG-KEYID
] [--git-preexport=
COMMAND
] [--git-postexport=
COMMAND
] [--git-prebuild=
COMMAND
] [--git-postbuild=
COMMAND
] [--git-posttag=
COMMAND
] [--git-[no-]hooks
] [--git-debian-tag=
tag-format
] [--git-debian-tag-msg=
tag-msg-format
] [--git-upstream-tag=
tag-format
] [--git-force-create
] [--git-no-create-orig
] [--git-upstream-signatures=
[auto|on|off]] [--git-upstream-tree=
[BRANCH|SLOPPY|TAG|TREEISH]
] [--git-tarball-dir=
DIRECTORY
] [--git-compression=
TYPE
] [--git-compression-level=
LEVEL
] [--git-component=
component
...] [--git-export-dir=
DIRECTORY
] [--git-export=
TREEISH
] [--git-[no-]pristine-tar
] [--git-[no-]pristine-tar-commit
] [--git-[no-]-purge
] [--git-tag-only
] [--git-retag
] [OPTION_PASSED_TO_BUILD_CMD
...]
gbp buildpackage is used to build Debian™ source and .deb packages from a Git repository. For a complete description of concepts, git repository layout and recommended workflows, see the online manual at https://gbp.sigxcpu.org/manual/
gbp buildpackage will, in order:
Verify that it is being executed from the proper location.
Verify that the repository doesn't contain any uncommitted source changes.
Verify that it is being executed from the correct branch.
(Optionally) run a clean command specified
with --git-cleaner
.
(Optionally) export the source tree to a separate build area.
Build an orig tarball if it doesn't exist. Optionally using pristine-tar.
(Optionally) call a pre build hook.
Call debuild(1) or Cowbuilder
(via --git-pbuilder
) or the application
specified via --git-builder
passing along
all arguments given to gbp buildpackage on the command
line that don't start with --git-.
(Optionally) tag the current commit after a successful build.
(Optionally) call a post build hook - e.g. to run lintian.
(Optionally) call a post tag hook - e.g. to push the results to a remote repository after creating the tag.
All options are prefixed with git-
to
distinguish options for gbp buildpackage from options passed
to the BUILD_CMD
:
When gbp buildpackage doesn't find a suitable upstream tarball it will create one either using pristine-tar or git archive. These options determine how the tarball is created:
|
Use pristine-tar when generating the upstream tarball if
it doesn't exist. If this mode is enabled
the |
|
Use this tag format when looking for tags of upstream
versions to build the upstream tarballs. Default
is |
|
How to find the upstream sources used to generate the tarball.
Other values are interpreted as treeishs.
This doesn't have any effect if |
|
Branch to build the orig tarball from if
|
|
Search for upstream tarballs in |
|
When generating tarballs create an additional upstream
tarball of directory This is considered an experimental feature and might change incompatibly. |
|
Commit the pristine-tar delta to the pristine-tar branch if a new tarball was generated and the pristine-tar data isn't already there. |
|
Force creation of an upstream tarball (overwriting a pre-existing one if present). |
|
Don't try to create any upstream tarballs or to create
symlinks to existing tarballs in |
|
Whether to export the upstream tarball with signatures. |
|
Include Git submodules in the orig tarball if present. |
|
Specifies the upstream tarball compression type. This will be used to
locate and build the upstream tarball if necessary. The default is
|
|
Specifies the upstream tarball compression level if an upstream tarball needs to be built. |
gbp buildpackage can invoke different types of builders to produce the source and binary packages. These options determine which builder is invoked and how.
|
Use |
|
Use |
|
Build the package using git-pbuilder (which
uses cowbuilder by default). Note that this overwrites
any |
|
Build package using git-pbuilder with
qemubuilder. Note that this overwrites any
|
|
Build for distribution |
|
Build for architecture |
|
Whether to try to autoconfigure git-pbuilder or to rely on
the settings in .pbuilderrc. See the git-pbuilder manpage
for details. Only takes effect when using git-pbuilder
(either via |
|
Options to pass to pbuilder when building via git-pbuilder (either
via
As an example, to tell pbuilder to use an alternate
.pbuilderrc file, you may run gbp buildpackage with
If unset the |
|
Whether to send a desktop notification after the build. This needs python3-notify2 installed. |
Hooks allow you to run arbitrary commands at different stages of the build. These options configure what will be run:
|
Execute
Exported environment variables are: |
|
Execute
Exported environment variables are: |
|
Execute
Exported environment variables are: |
|
Execute
Exported environment variables are: |
|
Execute
Exported environment variables are: |
|
Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and
posttag) hooks. Note: the |
|
Add a git tag after a successful build. It tags the currently checked out commit except when you're on a patch-queue branch. In that case the corresponding debian branch is tagged.
This is a command line only option that cannot be
specified via |
|
GPG sign all created tags. |
|
Use this keyid for gpg signing tags. |
|
Use this tag format when tagging Debian™ versions, default is
|
|
Use this tag message format when signing Debian™ versions,
default is |
|
Don't fail tag operations if a tag with the same version
already exists. This is a command line only option that
cannot be specified via |
|
Don't build, only tag and run post-tag hooks. This is a
command line only option that cannot be specified via
|
gbp buildpackage can export the source tree to a different build-area before performing the build. This options specify if and how this is done:
|
Export the current branch head (or the treeish object given via
|
|
Instead of exporting the current branch head, export the treeish
object
Note that using |
|
Purge (remove) temporary build area after build. This is the default but it can be turned off for e.g. debugging purposes. |
|
Extract upstream tarball from This option allows one to keep only the debian/ dir in the version control system. |
In order to make sure what you build is what you upload gbp buildpackage performs several safety checks. These options allow one to configure and disable them:
|
If you're not on this branch when invoking gbp buildpackage it will
fail. Default is |
|
Don't check if the current branch matches
|
|
Don't abort if there are uncommitted changes in the source tree or
the current branch doesn't match the
|
|
Verbose execution. Useful for debugging and bug reports. |
|
Whether to use colored output. |
|
Colors to use in output (when color is enabled). The format for COLOR_SCHEME is '<debug>:<info>:<warning>:<error>'. Numerical values and color names are accepted, empty fields imply the default color. For example --git-color-scheme='cyan:34::' would show debug messages in cyan, info messages in blue and other messages in default (i.e. warning and error messages in red). |
Build a Debian™ package using git-pbuilder which in turn invokes cowbuilder. Instruct cowbuilder to build within a Wheezy chroot for i386.
gbp buildpackage --git-pbuilder --git-arch=i386 --git-dist=wheezy
Note that the above needs a cowbuilder chroot already. This can be created using:
DIST=wheezy ARCH=i386 git-pbuilder create
To export the source tree without performing any build you can use:
gbp buildpackage --git-export-dir=/where/to/export --git-builder=/bin/true --git-no-pbuilder --git-no-hooks --git-no-purge
Several gbp.conf
files are parsed
to set defaults for the above command-line arguments. See the
gbp.conf(5) manpage for details.
All options in the config files must be specified without the 'git-'
prefix. So
e.g. --git-debian-branch
=debian/latest
becomes in gbp.conf
:
[buildpackage] debian-branch = debian/latest
gbp-import-dsc(1), gbp-import-dscs(1), gbp-import-orig(1), gbp-dch(1), git-pbuilder(1), cowbuilder(8), dpkg-source(1), git-submodule(1), gbp.conf(5), debuild(1), git(1), pristine-tar(1), The Git-Buildpackage Manual