'\" -*- coding: us-ascii -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH gbp-buildpackage 1 "21 March 2019" "" "git-buildpackage Manual" .SH NAME gbp-buildpackage \- Build Debian packages from a Git repository .SH SYNOPSIS 'nh .fi .ad l \fBgbp\ buildpackage\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [\fB--git-[no-]ignore-new\fR] [\fB--git-tag\fR] [\fB--git-verbose\fR] [\fB--git-color=\fR[auto|on|off]] [\fB--git-color-scheme\fR= \fICOLOR_SCHEME\fR] [\fB--git-notify=\fR[auto|on|off]] [\fB--git-upstream-branch=\fR \fITREEISH\fR] [\fB--git-debian-branch=\fR \fIBRANCH_NAME\fR] [\fB--git-ignore-branch\fR] [\fB--git-[no-]submodules\fR] [\fB--git-builder=\fR \fIBUILD_CMD\fR] [\fB--git-cleaner=\fR \fICLEAN_CMD\fR] [\fB--git-[no-]overlay\fR] [\fB--git-[no-]pbuilder\fR] [\fB--git-[no-]qemubuilder\fR] [\fB--git-dist=\fR \fIDIST\fR] [\fB--git-arch=\fR \fIARCH\fR] [\fB--git-[no-]pbuilder-autoconf\fR] [\fB--git-pbuilder-options\fR= \fIPBUILDER_OPTIONS\fR] [\fB--git-[no-]sign-tags\fR] [\fB--git-keyid=\fR \fIGPG-KEYID\fR] [\fB--git-preexport=\fR \fICOMMAND\fR] [\fB--git-postexport=\fR \fICOMMAND\fR] [\fB--git-prebuild=\fR \fICOMMAND\fR] [\fB--git-postbuild=\fR \fICOMMAND\fR] [\fB--git-posttag=\fR \fICOMMAND\fR] [\fB--git-[no-]hooks\fR] [\fB--git-debian-tag=\fR \fItag-format\fR] [\fB--git-debian-tag-msg=\fR \fItag-msg-format\fR] [\fB--git-upstream-tag=\fR \fItag-format\fR] [\fB--git-force-create\fR] [\fB--git-no-create-orig\fR] [\fB--git-upstream-tree=\fR \fI[BRANCH|SLOPPY|TAG|TREEISH]\fR] [\fB--git-tarball-dir=\fR \fIDIRECTORY\fR] [\fB--git-compression=\fR \fITYPE\fR] [\fB--git-compression-level=\fR \fILEVEL\fR] [\fB--git-component=\fR \fIcomponent\fR]\&... [\fB--git-export-dir=\fR \fIDIRECTORY\fR] [\fB--git-export=\fR \fITREEISH\fR] [\fB--git-[no-]pristine-tar\fR] [\fB--git-[no-]pristine-tar-commit\fR] [\fB--git-[no-]-purge\fR] [\fB--git-tag-only\fR] [\fB--git-retag\fR] [\fBOPTION_PASSED_TO_BUILD_CMD\fR]\&... 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBgbp\ buildpackage\fR is used to build Debian source and .deb packages from a Git repository. .PP \fBgbp\ buildpackage\fR will, in order: .TP 0.2i \(bu Verify that it is being executed from the proper location. .TP 0.2i \(bu Verify that the repository doesn't contain any uncommitted source changes. .TP 0.2i \(bu Verify that it is being executed from the correct branch. .TP 0.2i \(bu (Optionally) run a clean command specified with \*(T<\fB\-\-git\-cleaner\fR\*(T>. .TP 0.2i \(bu (Optionally) export the source tree to a separate build area. .TP 0.2i \(bu Build an orig tarball if it doesn't exist. Optionally using pristine-tar. .TP 0.2i \(bu (Optionally) call a pre build hook. .TP 0.2i \(bu Call debuild(1) or Cowbuilder (via \*(T<\fB\-\-git\-pbuilder\fR\*(T>) or the application specified via \*(T<\fB\-\-git\-builder\fR\*(T> passing along all arguments given to \fBgbp\ buildpackage\fR on the command line that don't start with --git-. .TP 0.2i \(bu (Optionally) tag the current commit after a successful build. .TP 0.2i \(bu (Optionally) call a post build hook - e.g. to run lintian. .TP 0.2i \(bu (Optionally) call a post tag hook - e.g. to push the results to a remote repository after creating the tag. .SH OPTIONS All options are prefixed with \*(T<\fBgit\-\fR\*(T> to distinguish options for \fBgbp\ buildpackage\fR from options passed to the \fIBUILD_CMD\fR: .SS "UPSTREAM TARBALL CREATION OPTIONS" When \fBgbp\ buildpackage\fR doesn't find a suitable upstream tarball it will create one either using pristine-tar or \fBgit archive\fR. These options determine how the tarball is created: .TP \*(T<\fB\-\-git\-pristine\-tar\fR\*(T> Use pristine-tar when generating the upstream tarball if it doesn't exist. If this mode is enabled the \*(T<\fB\-\-git\-upstream\-tag\fR\*(T>, \*(T<\fB\-\-git\-upstream\-tree\fR\*(T> options have no effect. .TP \*(T<\fB\-\-git\-upstream\-tag=\fR\*(T>\fITAG-FORMAT\fR Use this tag format when looking for tags of upstream versions to build the upstream tarballs. Default is \fIupstream/%(version)s\fR. This must be set correctly if you don't want to pass any other options. The default matches what \fBgbp\ import-orig\fR uses to create tags. .TP \*(T<\fB\-\-git\-upstream\-tree=\fR\*(T>\fI[BRANCH|SLOPPY|TAG|TREEISH]\fR How to find the upstream sources used to generate the tarball. \fITAG\fR (the default) looks at a tag corresponding to the version in the changelog. \fIBRANCH\fR looks at the upstream branch given via the \*(T<\fB\-\-git\-upstream\-branch\fR\*(T> option. The \fISLOPPY\fR option looks at the debian branch given via the \*(T<\fB\-\-git\-debian\-branch\fR\*(T> and drops the \*(T<\fIdebian/\fR\*(T> dir. Other values are interpreted as treeishs. This doesn't have any effect if \*(T<\fB\-\-git\-pristine\-tar\fR\*(T> is being used. .TP \*(T<\fB\-\-git\-upstream\-branch\fR\*(T>=\fIBRANCH_NAME\fR Branch to build the orig tarball from if \*(T<\fB\-\-git\-upstream\-tree\fR\*(T> is set to \fIBRANCH\fR. Default is \fIupstream\fR. .TP \*(T<\fB\-\-git\-tarball\-dir=\fR\*(T>\fIDIRECTORY\fR Search for upstream tarballs in \fIDIRECTORY\fR instead of generating them. If a tarball is not found here it will be generated nevertheless. \fIDIRECTORY\fR can contain a version format substitution pattern, eg: \fIfoo-%(version)s\fR. .TP \*(T<\fB\-\-git\-component=\fR\*(T>\fICOMPONENT\fR When generating tarballs create an additional upstream tarball of directory \fICOMPONENT\fR in the source tree. Using additional upstream tarballs is a feature of the 3.0 (quilt) source format. See the \fBdpkg-source\fR manpage for details. Note that the \fI--git-pristine-tar-commit\fR option is currently incompatible with this option. This is considered an experimental feature and might change incompatibly. .TP \*(T<\fB\-\-git\-pristine\-tar\-commit\fR\*(T> 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. .TP \*(T<\fB\-\-git\-force\-create\fR\*(T> Force creation of an upstream tarball (overwriting a pre-existing one if present). .TP \*(T<\fB\-\-git\-no\-create\-orig\fR\*(T> Don't try to create any upstream tarballs or to create symlinks to existing tarballs in \*(T<\fBtarball\-dir\fR\*(T>. .TP \*(T<\fB\-\-git\-[no\-]submodules\fR\*(T> Include Git submodules in the orig tarball if present. .TP \*(T<\fB\-\-git\-compression=\fR\*(T>\fITYPE\fR Specifies the upstream tarball compression type. This will be used to locate and build the upstream tarball if necessary. The default is \fIauto\fR which derives the compression type from the pristine-tar branch if available and falls back to gzip otherwise. Other options are \fIgzip\fR, \fIbzip2\fR, \fIlzma\fR and \fIxz\fR. .TP \*(T<\fB\-\-git\-compression\-level=\fR\*(T>\fILEVEL\fR Specifies the upstream tarball compression level if an upstream tarball needs to be built. .SS "PACKAGE BUILD OPTIONS" \fBgbp\ buildpackage\fR can invoke different types of builders to produce the source and binary packages. These options determine which builder is invoked and how. .TP \*(T<\fB\-\-git\-builder=\fR\*(T>\fIBUILD_CMD\fR Use \fIBUILD_CMD\fR instead of \fBdebuild -i -I\fR. If you want to use Cowbuilder or Pbuilder see the \*(T<\fB\-\-git\-pbuilder\fR\*(T>. .TP \*(T<\fB\-\-git\-cleaner=\fR\*(T>\fICLEAN_CMD\fR Use \fICLEAN_CMD\fR to clean the source tree before the build. The default is \fB/bin/true\fR (no cleaning). .TP \*(T<\fB\-\-git\-pbuilder\fR\*(T> Build the package using \fBgit-pbuilder\fR (which uses \fBcowbuilder\fR by default). Note that this overwrites any \*(T<\fB\-\-git\-builder\fR\*(T> and \*(T<\fB\-\-git\-cleaner\fR\*(T> options. .TP \*(T<\fB\-\-git\-qemubuilder\fR\*(T> Build package using \fBgit-pbuilder\fR with \fBqemubuilder\fR. Note that this overwrites any \*(T<\fB\-\-git\-builder\fR\*(T> and \*(T<\fB\-\-git\-cleaner\fR\*(T> options. .TP \*(T<\fB\-\-git\-dist=\fR\*(T>\fIDIST\fR Build for distribution \fIDIST\fR when using \fBgit-pbuilder\fR (either via \*(T<\fB\-\-git\-pbuilder\fR\*(T>, \*(T<\fB\-\-git\-qemubuilder\fR\*(T> or the corresponding configuration file options). If unset build for the unstable distribution. The special value \*(T will set the distribution to build for from the branch name. I.e. if you're starting the build from a branch named \fIdebian/wheezy-backports\fR the distribution is set to \fIwheezy-backports\fR. If the branch is named \fIdownstream/sid\fR the distribution is set to \fIdownstream_sid\fR. .TP \*(T<\fB\-\-git\-arch=\fR\*(T>\fIARCH\fR Build for architecture \fIARCH\fR when using \fBgit-pbuilder\fR (either via \*(T<\fB\-\-git\-pbuilder\fR\*(T>, \*(T<\fB\-\-git\-qemubuilder\fR\*(T> or the corresponding configuration file options). If unset no architecture is passed to \fBgit-pbuilder\fR. .TP \*(T<\fB\-\-git\-pbuilder\-autoconf\fR\*(T> Whether to try to autoconfigure \fBgit-pbuilder\fR or to rely on the settings in .pbuilderrc. See the \fBgit-pbuilder\fR manpage for details. Only takes effect when using \fBgit-pbuilder\fR (either via \*(T<\fB\-\-git\-pbuilder\fR\*(T>, \*(T<\fB\-\-git\-qemubuilder\fR\*(T> or the corresponding configuration file options). .TP \*(T<\fB\-\-git\-pbuilder\-options\fR\*(T> Options to pass to pbuilder when building via \fBgit-pbuilder\fR (either via \*(T<\fB\-\-git\-pbuilder\fR\*(T>, \*(T<\fB\-\-git\-qemubuilder\fR\*(T> or the corresponding configuration file options). It does so by using the \fBGIT_PBUILDER_OPTIONS\fR environment variable to pass options to \fBgit-pbuilder\fR. As an example, to tell pbuilder to use an alternate \&.pbuilderrc file, you may run \fBgbp\ buildpackage\fR with \*(T<\fB\-\-git\-pbuilder\-options=\fR\*(T>\fI"--configfile /tmp/my/pbuilderrc"\fR. See \fBpbuilder\fR(8) for more options to pass through here. If unset the \fBGIT_PBUILDER_OPTIONS\fR environment variable will be left untouched. .TP \*(T<\fB\-\-git\-notify=\fR\*(T>[auto|on|off] Whether to send a desktop notification after the build. This needs python3-notify2 installed. .SS "HOOK OPTIONS" Hooks allow you to run arbitrary commands at different stages of the build. These options configure what will be run: .TP \*(T<\fB\-\-git\-preexport=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR before exporting the source tree. Valid only if --git-export-dir has been specified. Exported environment variables are: \fBGBP_GIT_DIR\fR (the repository the package is being built from), \fBGBP_BUILD_DIR\fR (the build dir). .TP \*(T<\fB\-\-git\-postexport=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR after exporting the source tree. Valid only if --git-export-dir has been specified. The working directory of this hook is the toplevel directory of the exported source tree. Exported environment variables are: \fBGBP_GIT_DIR\fR (the repository the package is being built from), \fBGBP_TMP_DIR\fR (the temporary directory where the sources have been initially exported). .TP \*(T<\fB\-\-git\-prebuild=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR from the build directory before calling debuild or the application specified via \*(T<\fB\-\-git\-builder\fR\*(T>. Exported environment variables are: \fBGBP_GIT_DIR\fR (the repository the package is being built from), \fBGBP_BUILD_DIR\fR (the build dir). .TP \*(T<\fB\-\-git\-postbuild=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR after successful build. The working directory of this hook is the directory the package was built in. Exported environment variables are: \fBGBP_CHANGES_FILE\fR (the name of the generated changes file), \fBGBP_BUILD_DIR\fR (the build dir). .TP \*(T<\fB\-\-git\-posttag=\fR\*(T>\fICOMMAND\fR Execute \fICOMMAND\fR after tagging a new version. The working directory of this hook is the toplevel directory of the Git repository. Exported environment variables are: \fBGBP_TAG\fR (the name of the generated tag), \fBGBP_BRANCH\fR (the branch the package was built from) and \fBGBP_SHA1\fR (the sha1 of the commit the tag was created at). .TP \*(T<\fB\-\-git\-[no\-]hooks\fR\*(T> Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and posttag) hooks. Note: the \*(T<\fB\-\-git\-builder\fR\*(T> command is not affected by this option. .SS "TAGGING OPTIONS" .TP \*(T<\fB\-\-git\-tag\fR\*(T> 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 \*(T<\fIgbp.conf\fR\*(T>. .TP \*(T<\fB\-\-git\-[no\-]sign\-tags\fR\*(T> GPG sign all created tags. .TP \*(T<\fB\-\-git\-keyid=\fR\*(T>\fIGPG-KEYID\fR Use this keyid for gpg signing tags. .TP \*(T<\fB\-\-git\-debian\-tag=\fR\*(T>\fITAG-FORMAT\fR Use this tag format when tagging Debian versions, default is \fIdebian/%(version)s\fR. .TP \*(T<\fB\-\-git\-debian\-tag\-msg=\fR\*(T>\fItag-msg-format\fR Use this tag message format when signing Debian versions, default is \fI%(pkg)s Debian release %(version)s\fR .TP \*(T<\fB\-\-git\-retag\fR\*(T> 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 \*(T<\fIgbp.conf\fR\*(T>. .TP \*(T<\fB\-\-git\-tag\-only\fR\*(T> Don't build, only tag and run post-tag hooks. This is a command line only option that cannot be specified via \*(T<\fIgbp.conf\fR\*(T>. .SS "BUILD AREA OPTIONS" \fBgbp\ buildpackage\fR can export the source tree to a different build-area before performing the build. This options specify if and how this is done: .TP \*(T<\fB\-\-git\-export\-dir=\fR\*(T>\fIDIRECTORY\fR Export the current branch head (or the treeish object given via \*(T<\fB\-\-git\-export\fR\*(T> to \fIDIRECTORY\fR before building. If unset the source will not be exported before starting the build. .TP \*(T<\fB\-\-git\-export=\fR\*(T>\fITREEISH\fR Instead of exporting the current branch head, export the treeish object \fITREEISH\fR. The special name \fIINDEX\fR exports the current index whereas the special name \fIWC\fR exports the current working copy as is. Note that using \fIWC\fR enables the \*(T<\fB\-\-git\-ignore\-branch\fR\*(T> and \*(T<\fB\-\-git\-ignore\-new\fR\*(T> options as well since when exporting the working copy there's no point in enforcing any branch or modification checks. .TP \*(T<\fB\-\-git[\-no]\-purge\fR\*(T> Purge (remove) temporary build area after build. This is the default but it can be turned off for e.g. debugging purposes. .TP \*(T<\fB\-\-git\-[no\-]overlay\fR\*(T> Extract upstream tarball from \*(T<\fBtarball\-dir\fR\*(T> when using the \*(T<\fBexport\-dir\fR\*(T> option (in analogy to mergeWithUpstream in svn-bp). Also remove debian/ if contained in the upstream tarball in case of 2.0 and 3.0 source formats. This optios allows one to keep only the debian/ dir in the version control system. .SS "SAFETY OPTIONS" In order to make sure what you build is what you upload \fBgbp\ buildpackage\fR performs several safety checks. These options allow one to configure and disable them: .TP \*(T<\fB\-\-git\-debian\-branch\fR\*(T>=\fIBRANCH_NAME\fR If you're not on this branch when invoking \fBgbp\ buildpackage\fR it will fail. Default is \fImaster\fR. This is done to make sure you don't accidentally release from a topic branch. Not being on this branch will be ignored when using \*(T<\fB\-\-git\-ignore\-new\fR\*(T>. .TP \*(T<\fB\-\-git\-ignore\-branch\fR\*(T> Don't check if the current branch matches \fIDEBIAN-BRANCH\fR. .TP \*(T<\fB\-\-git\-[no\-]ignore\-new\fR\*(T> Don't abort if there are uncommitted changes in the source tree or the current branch doesn't match the \fIDEBIAN-BRANCH\fR. .SS "COLOR AND VERBOSITY OPTIONS" .TP \*(T<\fB\-\-git\-verbose\fR\*(T> Verbose execution. Useful for debugging and bug reports. .TP \*(T<\fB\-\-git\-color=\fR\*(T>[auto|on|off] Whether to use colored output. .TP \*(T<\fB\-\-git\-color\-scheme\fR\*(T>=\fICOLOR_SCHEME\fR Colors to use in output (when color is enabled). The format for COLOR_SCHEME is \&':::'. 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). .SH EXAMPLES Build a Debian package using \fBgit-pbuilder\fR which in turn invokes \fBcowbuilder\fR. Instruct cowbuilder to build within a Wheezy chroot for i386. .PP .nf \*(T< \fBgbp\ buildpackage\fR \-\-git\-pbuilder \-\-git\-arch=i386 \-\-git\-dist=wheezy \*(T> .fi .PP Note that the above needs a \fBcowbuilder\fR chroot already. This can be created using: .PP .nf \*(T< DIST=wheezy ARCH=i386 \fBgit\-pbuilder\fR create \*(T> .fi .SH "CONFIGURATION FILES" Several \*(T<\fIgbp.conf\fR\*(T> files are parsed to set defaults for the above command-line arguments. See the \fBgbp.conf\fR(5) manpage for details. .PP All options in the config files must be specified without the 'git-' prefix. So e.g. \*(T<\fB\-\-git\-debian\-branch\fR\*(T>=\fIdebian/sid\fR becomes in \*(T<\fIgbp.conf\fR\*(T>: .PP .nf \*(T< [buildpackage] debian\-branch = debian/sid \*(T> .fi .SH "SEE ALSO" \fBgbp-import-dsc\fR(1), \fBgbp-import-dscs\fR(1), \fBgbp-import-orig\fR(1), \fBgbp-dch\fR(1), \fBgit-pbuilder\fR(1), \fBcowbuilder\fR(8), \fBdpkg-source\fR(1), \fBgit-submodule\fR(1), \fBgbp.conf\fR(5), \fBdebuild\fR(1), \fBgit\fR(1), \fBpristine-tar\fR(1), .URL file:///usr/share/doc/git-buildpackage/manual-html/index.html " The Git-Buildpackage Manual" .SH AUTHOR Guido G\(:unther <\*(T>