Building PureOS packages with git-buildpackage (gbp)
The goal is to have a standardized, repeatable way to build packages via the git distributed version source control tool. Inspired by [[ https://dep-team.pages.debian.net/deps/dep14/ | DEP-14 ]]
== Description ==
[[ https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/ | Git buildpackage ]], or gbp for short, is a tool to maintain Debian packages via git. Using git as the distributed version control system to store the data as well as packaging meta-data means that packages can be built directly from a git repository.
This page is dedicated to the use of gbp in PureOS but it should be applicable in any Debian-based distro.
== Installation ==
On PureOS, gbp is installed via this command;
```
sudo apt install git-buildpackage
```
== Terminology ==
If you're not familiar with Debian packaging it's likely a good idea to mention some terms we use in this document. Gbp builds packages from git branches. The branches used refer to specific artifacts, like the upstream tarball. The terms we'll refer to are;
| **Term** | **Meaning** |
| pristine tarball| the untouched source code stored as a binary tar archive.|
== Packaging workflow ==
== Pristine tar ==
In our example, we'll use tar to create a pristine tarball. One can use git archive as well;
```
tar cvfJ stream-0.1.0.orig.tar.xz --exclude-vcs Stream/
```
== Build package ==
== Push to repo ==
== gitlab-ci example =