6 (Tested on Ubuntu 14.04, 16.04, 17.10, 18.04, Debian jessie, stretch and
9 1. Install the Debian packaging tools:
13 sudo apt install fakeroot debhelper devscripts
15 2. Checkout FRR under an **unprivileged** user account:
19 git clone https://github.com/frrouting/frr.git frr
22 If you wish to build a package for a branch other than master:
28 3. Install build dependencies using the `mk-build-deps` tool from the
33 sudo mk-build-deps --install --remove debian/control
35 Alternatively, you can manually install build dependencies for your
36 platform as outlined in :ref:`building`.
38 4. Install `git-buildpackage` package:
42 sudo apt-get install git-buildpackage
44 5. (optional) Append a distribution identifier if needed (see below under
47 6. Build Debian Binary and/or Source Packages:
51 gbp buildpackage --git-builder=dpkg-buildpackage --git-debian-branch="$(git rev-parse --abbrev-ref HEAD)" $options
53 Where `$options` may contain any or all of the following items:
55 * build profiles specified with ``-P``, e.g.
56 ``-Ppkg.frr.nortrlib,pkg.frr.rtrlib``.
57 Multiple values are separated by commas and there must not be a space
60 The following build profiles are currently available:
62 +----------------+-------------------+-----------------------------------------+
63 | Profile | Negation | Effect |
64 +================+===================+=========================================+
65 | pkg.frr.rtrlib | pkg.frr.nortrlib | builds frr-rpki-rtrlib package (or not) |
66 +----------------+-------------------+-----------------------------------------+
67 | pkg.frr.lua | pkg.frr.nolua | builds lua scripting extension |
68 +----------------+-------------------+-----------------------------------------+
69 | pkg.frr.pim6d | pkg.frr.nopim6d | builds pim6d (default enabled) |
70 +----------------+-------------------+-----------------------------------------+
72 * the ``-uc -us`` options to disable signing the packages with your GPG key
74 (git builds of the `master` or `stable/X.X` branches won't be signed by
75 default since their target release is set to ``UNRELEASED``.)
77 * the ``--build=type`` accepts following options (see ``dpkg-buildpackage`` manual page):
79 * ``source`` builds the source package
80 * ``any`` builds the architecture specific binary packages
81 * ``all`` build the architecture independent binary packages
82 * ``binary`` build the architecture specific and independent binary packages (alias for ``any,all``)
83 * ``full`` builds everything (alias for ``source,any,all``)
85 Alternatively, you might want to replace ``dpkg-buildpackage`` with
86 ``debuild`` wrapper that also runs ``lintian`` and ``debsign`` on the final
91 If all worked correctly, then you should end up with the Debian packages in
92 the parent directory of where `debuild` ran. If distributed, please make sure
93 you distribute it together with the sources (``frr_*.orig.tar.xz``,
94 ``frr_*.debian.tar.xz`` and ``frr_*.dsc``)
98 A package created from `master` or `stable/X.X` is slightly different from
99 a package created from the `debian` branch. The changelog for the former
100 is autogenerated and sets the Debian revision to ``-0``, which causes an
101 intentional lintian warning. The `debian` branch on the other hand has
102 a manually maintained changelog that contains proper Debian release
108 Multi-Distribution builds
109 =========================
111 You can optionally append a distribution identifier in case you want to
112 make multiple versions of the package available in the same repository.
114 .. code-block:: shell
116 dch -l '~deb8u' 'build for Debian 8 (jessie)'
117 dch -l '~deb9u' 'build for Debian 9 (stretch)'
118 dch -l '~ubuntu14.04.' 'build for Ubuntu 14.04 (trusty)'
119 dch -l '~ubuntu16.04.' 'build for Ubuntu 16.04 (xenial)'
120 dch -l '~ubuntu18.04.' 'build for Ubuntu 18.04 (bionic)'
122 Between building packages for specific distributions, the only difference
123 in the package itself lies in the automatically generated shared library
124 dependencies, e.g. libjson-c2 or libjson-c3. This means that the
125 architecture independent packages should **not** have a suffix appended.
126 Also, the current Debian testing/unstable releases should not have any suffix
129 For example, at the end of 2018 (i.e. ``buster``/Debian 10 is the current
130 "testing" release), the following is a complete list of `.deb` files for
131 Debian 8, 9 and 10 packages for FRR 6.0.1-1 with RPKI support::
133 frr_6.0.1-1_amd64.deb
134 frr_6.0.1-1~deb8u1_amd64.deb
135 frr_6.0.1-1~deb9u1_amd64.deb
136 frr-dbg_6.0.1-1_amd64.deb
137 frr-dbg_6.0.1-1~deb8u1_amd64.deb
138 frr-dbg_6.0.1-1~deb9u1_amd64.deb
139 frr-rpki-rtrlib_6.0.1-1_amd64.deb
140 frr-rpki-rtrlib_6.0.1-1~deb8u1_amd64.deb
141 frr-rpki-rtrlib_6.0.1-1~deb9u1_amd64.deb
142 frr-doc_6.0.1-1_all.deb
143 frr-pythontools_6.0.1-1_all.deb
145 Note that there are no extra versions of the `frr-doc` and `frr-pythontools`
146 packages (because they are for architecture ``all``, not ``amd64``), and the
147 version for Debian 10 does **not** have a ``~deb10u1`` suffix.
151 Do not use the ``-`` character in the version suffix. The last ``-`` in
152 the version number is the separator between upstream version and Debian
153 version. ``6.0.1-1~foobar-2`` means upstream version ``6.0.1-1~foobar``,
154 Debian version ``2``. This is not what you want.
156 The only allowed characters in the Debian version are ``0-9 A-Z a-z + . ~``
160 The separating character for the suffix **must** be the tilde (``~``)
161 because the tilde is ordered in version-comparison before the empty
162 string. That means the order of the above packages is the following:
164 ``6.0.1-1`` newer than ``6.0.1-1~deb9u1`` newer than ``6.0.1-1~deb8u1``
166 If you use another character (e.g. ``+``), the untagged version will be
167 regarded as the "oldest"!