Build Debian Package With gbp on Ubuntu

Build Debian Package With gbp on Ubuntu

Why gbp? gbp integrates Git, the other build and package tools to simplify the packaging flow and make the flow managable more easily.

Packaging Debian package in Different Ways

There are differnt ways to package a Debian package. The key step is to package and deploy files in the spec of Debian package. It does not matter much which packaging tool you use to package. However, by using apporiate tools or wrapers for you to package, it could help you save a lot of time to manage tedious things like boilerplate for configuration files.

The following are some well-known tools to package a deb:

Git is the modern and popular version control tools. gbp combines Git manipulation and the usual flow to package a deb. Thus it is suggested to follow the gbp flow to package a deb. In some projects or Debian teams, following gbp flow is even mandatory or strongly suggested[1].

[1] Of the two predominant git-based patch regimes, the Debian Python team has chosen gbp pq. from Debian Python Team Wiki - Using Git for Team Packages

Examples

gbp can be used along with sbuild, whish is a tool to create usespace build environment when packaging source code. Here is an example when packaing rasdaemon deb and the other for poetry deb.

You may need this pre-setup scripts to get ready to use sbuild priori to run the above examples.

Reference