(Tested on Ubuntu 14.04, 16.04, 17.10, 18.04, Debian jessie, stretch and buster.)
Install the Debian packaging tools:
sudo apt install fakeroot debhelper devscripts
Checkout FRR under an unprivileged user account:
git clone https://github.com/frrouting/frr.git frr cd frr
If you wish to build a package for a branch other than master:
git checkout <branch>
Install build dependencies using the mk-build-deps tool from the devscripts package:
sudo mk-build-deps --install --remove debian/control
Alternatively, you can manually install build dependencies for your platform as outlined in Building FRR.
Install git-buildpackage package:
sudo apt-get install git-buildpackage
(optional) Append a distribution identifier if needed (see below under Multi-Distribution builds.)
Build Debian Binary and/or Source Packages:
gbp buildpackage --git-builder=dpkg-buildpackage --git-debian-branch="$(git rev-parse --abbrev-ref HEAD)" $options
Where $options may contain any or all of the following items:
build profiles specified with
-Ppkg.frr.nortrlib,pkg.frr.rtrlib. Multiple values are separated by commas and there must not be a space after the
The following build profiles are currently available:
builds frr-rpki-rtrlib package (or not)
-uc -usoptions to disable signing the packages with your GPG key
(git builds of the master or stable/X.X branches won’t be signed by default since their target release is set to
--build=typeaccepts following options (see
sourcebuilds the source package
anybuilds the architecture specific binary packages
allbuild the architecture independent binary packages
binarybuild the architecture specific and independent binary packages (alias for
fullbuilds everything (alias for
Alternatively, you might want to replace
debuildwrapper that also runs
debsignon the final packages.
If all worked correctly, then you should end up with the Debian packages in the parent directory of where debuild ran. If distributed, please make sure you distribute it together with the sources (
A package created from master or stable/X.X is slightly different from
a package created from the debian branch. The changelog for the former
is autogenerated and sets the Debian revision to
-0, which causes an
intentional lintian warning. The debian branch on the other hand has
a manually maintained changelog that contains proper Debian release
You can optionally append a distribution identifier in case you want to make multiple versions of the package available in the same repository.
dch -l '~deb8u' 'build for Debian 8 (jessie)' dch -l '~deb9u' 'build for Debian 9 (stretch)' dch -l '~ubuntu14.04.' 'build for Ubuntu 14.04 (trusty)' dch -l '~ubuntu16.04.' 'build for Ubuntu 16.04 (xenial)' dch -l '~ubuntu18.04.' 'build for Ubuntu 18.04 (bionic)'
Between building packages for specific distributions, the only difference in the package itself lies in the automatically generated shared library dependencies, e.g. libjson-c2 or libjson-c3. This means that the architecture independent packages should not have a suffix appended. Also, the current Debian testing/unstable releases should not have any suffix appended.
For example, at the end of 2018 (i.e.
buster/Debian 10 is the current
“testing” release), the following is a complete list of .deb files for
Debian 8, 9 and 10 packages for FRR 6.0.1-1 with RPKI support:
frr_6.0.1-1_amd64.deb frr_6.0.1-1~deb8u1_amd64.deb frr_6.0.1-1~deb9u1_amd64.deb frr-dbg_6.0.1-1_amd64.deb frr-dbg_6.0.1-1~deb8u1_amd64.deb frr-dbg_6.0.1-1~deb9u1_amd64.deb frr-rpki-rtrlib_6.0.1-1_amd64.deb frr-rpki-rtrlib_6.0.1-1~deb8u1_amd64.deb frr-rpki-rtrlib_6.0.1-1~deb9u1_amd64.deb frr-doc_6.0.1-1_all.deb frr-pythontools_6.0.1-1_all.deb
Note that there are no extra versions of the frr-doc and frr-pythontools
packages (because they are for architecture
amd64), and the
version for Debian 10 does not have a
Do not use the
- character in the version suffix. The last
the version number is the separator between upstream version and Debian
6.0.1-1~foobar-2 means upstream version
2. This is not what you want.
The only allowed characters in the Debian version are
0-9 A-Z a-z + . ~
The separating character for the suffix must be the tilde (
because the tilde is ordered in version-comparison before the empty
string. That means the order of the above packages is the following:
6.0.1-1 newer than
6.0.1-1~deb9u1 newer than
If you use another character (e.g.
+), the untagged version will be
regarded as the “oldest”!