gbp Command Examples in Linux

GBP stands for “Git Build Package” and is a set of tools for managing Debian package builds using Git. It allows developers to maintain the Debian package source code and build scripts in a Git repository, making it easy to manage revisions, collaborate with others, and automate the build process.

The main components of GBP are:

  • gbp buildpackage: a command to build Debian packages from a Git repository. It automatically creates a source tarball from the repository, and runs the appropriate build commands (such as dpkg-buildpackage) to create the binary packages.
  • gbp import-dsc: a command to import an existing Debian source package into a Git repository. It creates a new branch and imports the package’s files and build scripts into it, allowing developers to start making changes and create new versions of the package.
  • gbp export-dsc: a command to create a Debian source package from a Git repository. It exports the package’s files and build scripts from the repository into a source tarball and a .dsc file, which can be used to build binary packages.

GBP also provides additional commands for managing branches, tags, and releases, as well as support for various packaging formats (such as quilt and gbp-pq) and integration with other tools (such as git-buildpackage, salsa and jenkins-debian-glue).

gbp Command Examples

1. Convert an existing Debian package to gbp:

# gbp import-dsc path/to/package.dsc

2. Build the package in the current directory using the default builder (`debuild`):

# gbp buildpackage -jauto -us -uc

3. Build a package in a `pbuilder` environment for Debian Bullseye:

# DIST=bullseye ARCH=amd64 gbp buildpackage -jauto -us -uc --git-builder=git-pbuilder

4. Specify a package to be a source-only upload in the `.changes` file (see https://wiki.debian.org/SourceOnlyUpload):

# gbp buildpackage -jauto -us -uc --changes-options=-S

5. Import a new upstream release:

# gbp import-orig --pristine-tar path/to/package.tar.gz

Summary

Overall, GBP is a powerful tool for managing Debian package builds with Git and streamlining the development process. It allows developers to easily create, test, and deploy new versions of their packages, while also making it easy to collaborate with others and keep track of changes.

Related Post