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 debian/control
35 Alternatively, you can manually install build dependencies for your
36 platform as outlined in :ref:`building`.
38 4. Run ``tools/tarsource.sh -V``:
42 ./tools/tarsource.sh -V
44 This script sets up the ``debian/changelog-auto`` file with proper version
47 5. (optional) Append a distribution identifier if needed (see below under
50 6. Build Debian Package:
54 dpkg-buildpackage $options
56 Where `$options` may contain any or all of the following items:
58 * build profiles specified with ``-P``, e.g.
59 ``-Ppkg.frr.nortrlib,pkg.frr.nosystemd``.
60 Multiple values are separated by commas and there must not be a space
63 The following build profiles are currently available:
65 +----------------+-------------------+-----------------------------------------+
66 | Profile | Negation | Effect |
67 +================+===================+=========================================+
68 | pkg.frr.rtrlib | pkg.frr.nortrlib | builds frr-rpki-rtrlib package (or not) |
69 +----------------+-------------------+-----------------------------------------+
70 | n/a | pkg.frr.nosystemd | removes libsystemd dependency and |
71 | | | disables unit file installation |
72 +----------------+-------------------+-----------------------------------------+
76 The ``pkg.frr.nosystemd`` option is only intended to support Ubuntu
77 14.04 (and should be enabled when building for that.)
79 * the ``-uc -us`` options to disable signing the packages with your GPG key
81 (git builds of the `master` or `stable/X.X` branches won't be signed by
82 default since their target release is set to ``UNRELEASED``.)
86 If all worked correctly, then you should end up with the Debian packages in
87 the parent directory of where `debuild` ran. If distributed, please make sure
88 you distribute it together with the sources (``frr_*.orig.tar.xz``,
89 ``frr_*.debian.tar.xz`` and ``frr_*.dsc``)
93 A package created from `master` or `stable/X.X` is slightly different from
94 a package created from the `debian` branch. The changelog for the former
95 is autogenerated and sets the Debian revision to ``-0``, which causes an
96 intentional lintian warning. The `debian` branch on the other hand has
97 a manually maintained changelog that contains proper Debian release
100 Furthermore, official Debian packages are built in ``3.0 (quilt)`` format
101 with an "orig" tarball and a "debian" tarball. These tarballs are created
102 by the ``tarsource.sh`` tool on any branch. The git repository however
103 contains a ``3.0 (git)`` source format specifier to easily allow direct
109 Multi-Distribution builds
110 =========================
112 You can optionally append a distribution identifier in case you want to
113 make multiple versions of the package available in the same repository.
114 Do the following after creating the changelog with `tarsource.sh`:
116 .. code-block:: shell
118 dch -l '~deb8u' 'build for Debian 8 (jessie)'
119 dch -l '~deb9u' 'build for Debian 9 (stretch)'
120 dch -l '~ubuntu14.04.' 'build for Ubuntu 14.04 (trusty)'
121 dch -l '~ubuntu16.04.' 'build for Ubuntu 16.04 (xenial)'
122 dch -l '~ubuntu18.04.' 'build for Ubuntu 18.04 (bionic)'
124 Between building packages for specific distributions, the only difference
125 in the package itself lies in the automatically generated shared library
126 dependencies, e.g. libjson-c2 or libjson-c3. This means that the
127 architecture independent packages should **not** have a suffix appended.
128 Also, the current Debian testing/unstable releases should not have any suffix
131 For example, at the end of 2018 (i.e. ``buster``/Debian 10 is the current
132 "testing" release), the following is a complete list of `.deb` files for
133 Debian 8, 9 and 10 packages for FRR 6.0.1-1 with RPKI support::
135 frr_6.0.1-1_amd64.deb
136 frr_6.0.1-1~deb8u1_amd64.deb
137 frr_6.0.1-1~deb9u1_amd64.deb
138 frr-dbg_6.0.1-1_amd64.deb
139 frr-dbg_6.0.1-1~deb8u1_amd64.deb
140 frr-dbg_6.0.1-1~deb9u1_amd64.deb
141 frr-rpki-rtrlib_6.0.1-1_amd64.deb
142 frr-rpki-rtrlib_6.0.1-1~deb8u1_amd64.deb
143 frr-rpki-rtrlib_6.0.1-1~deb9u1_amd64.deb
144 frr-doc_6.0.1-1_all.deb
145 frr-pythontools_6.0.1-1_all.deb
147 Note that there are no extra versions of the `frr-doc` and `frr-pythontools`
148 packages (because they are for architecture ``all``, not ``amd64``), and the
149 version for Debian 10 does **not** have a ``~deb10u1`` suffix.
153 Do not use the ``-`` character in the version suffix. The last ``-`` in
154 the version number is the separator between upstream version and Debian
155 version. ``6.0.1-1~foobar-2`` means upstream version ``6.0.1-1~foobar``,
156 Debian version ``2``. This is not what you want.
158 The only allowed characters in the Debian version are ``0-9 A-Z a-z + . ~``
162 The separating character for the suffix **must** be the tilde (``~``)
163 because the tilde is ordered in version-comparison before the empty
164 string. That means the order of the above packages is the following:
166 ``6.0.1-1`` newer than ``6.0.1-1~deb9u1`` newer than ``6.0.1-1~deb8u1``
168 If you use another character (e.g. ``+``), the untagged version will be
169 regarded as the "oldest"!