|
| 1 | +#!/usr/bin/make -f |
| 2 | + |
| 3 | +# FRRouting Configuration options |
| 4 | +###################################### |
| 5 | +# |
| 6 | +# WANT_xxxx --> Set to 1 for enable, 0 for disable |
| 7 | +# The following are the defaults. They can be overridden by setting a |
| 8 | +# env variable to a different value |
| 9 | +# |
| 10 | +export WANT_LDP=1 |
| 11 | +export WANT_PIM=0 |
| 12 | +export WANT_OSPFAPI=0 |
| 13 | +export WANT_TCP_ZEBRA=1 |
| 14 | +export WANT_BGP_VNC=1 |
| 15 | +export WANT_CUMULUS_MODE=0 |
| 16 | +export WANT_MULTIPATH=1 |
| 17 | +export WANT_RPKI=0 |
| 18 | +# |
| 19 | +# NOTE: If you use WANT_RPKI, then there is a new dependency for librtr0 package |
| 20 | +# and a build dependency of the librtr-dev package. |
| 21 | +# While the librtr0 is added to the depenencies automatically, the build dependency |
| 22 | +# can't be changed dynamically and building will fail if the librtr-dev isn't |
| 23 | +# installed during package build |
| 24 | +# Tested versions of both packages can be found at |
| 25 | +# https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact |
| 26 | +# |
| 27 | +# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here |
| 28 | +# Please be aware that 0 is NOT disabled, but treated as unlimited |
| 29 | +# export MULTIPATH=256 |
| 30 | +# |
| 31 | +# Set the following to the value required (or leave undefined for the default below) |
| 32 | +# WANT_FRR_USER is used for the username and groupname of the FRR user account |
| 33 | +# export WANT_FRR_USER=frr |
| 34 | +# export WANT_FRR_VTY_GROUP=frrvty |
| 35 | +# |
| 36 | +#################################### |
| 37 | + |
| 38 | +export DH_VERBOSE=1 |
| 39 | +export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 40 | +export DH_OPTIONS=-v |
| 41 | + |
| 42 | +ifeq ($(WANT_SNMP), 1) |
| 43 | + USE_SNMP=--enable-snmp |
| 44 | + $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience") |
| 45 | +else |
| 46 | + $(warning "DEBIAN: SNMP disabled, see README.Debian") |
| 47 | +endif |
| 48 | + |
| 49 | +ifneq ($(WANT_LDP), 0) |
| 50 | + USE_LDP=--enable-ldpd |
| 51 | +else |
| 52 | + USE_LDP=--disable-ldpd |
| 53 | +endif |
| 54 | + |
| 55 | +ifneq ($(WANT_PIM), 0) |
| 56 | + USE_PIM=--enable-pimd |
| 57 | +else |
| 58 | + USE_PIM=--disable-pimd |
| 59 | +endif |
| 60 | + |
| 61 | +ifneq ($(WANT_OSPFAPI), 0) |
| 62 | + USE_OSPFAPI=--enable-ospfapi=yes |
| 63 | +else |
| 64 | + USE_OSPFAPI=--enable-ospfapi=no |
| 65 | +endif |
| 66 | + |
| 67 | +ifeq ($(WANT_TCP_ZEBRA),1) |
| 68 | + USE_TCP_ZEBRA=--enable-tcp-zebra |
| 69 | +endif |
| 70 | + |
| 71 | +ifneq ($(WANT_BGP_VNC), 0) |
| 72 | + USE_BGP_VNC=--enable-bgp-vnc=yes |
| 73 | +else |
| 74 | + USE_BGP_VNC=--enable-bgp-vnc=no |
| 75 | +endif |
| 76 | + |
| 77 | +ifndef WANT_FRR_USER |
| 78 | + USE_FRR_USER=--enable-user=frr |
| 79 | + USE_FRR_GROUP=--enable-group=frr |
| 80 | +else |
| 81 | + USE_FRR_USER=--enable-user=$(WANT_FRR_USER) |
| 82 | + USE_FRR_GROUP=--enable-group=$(WANT_FRR_USER) |
| 83 | +endif |
| 84 | + |
| 85 | +ifndef WANT_FRR_VTY_GROUP |
| 86 | + USE_FRR_VTY_GROUP=--enable-vty-group=frrvty |
| 87 | +else |
| 88 | + USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP) |
| 89 | +endif |
| 90 | + |
| 91 | +ifneq ($(WANT_MULTIPATH), 0) |
| 92 | + ifdef MULTIPATH |
| 93 | + USE_MULTIPATH=--enable-multipath=$(MULTIPATH) |
| 94 | + else |
| 95 | + USE_MULTIPATH=--enable-multipath=256 |
| 96 | + endif |
| 97 | +else |
| 98 | + USE_MULTIPATH=--disable-multipath |
| 99 | +endif |
| 100 | + |
| 101 | +ifeq ($(WANT_CUMULUS_MODE), 1) |
| 102 | + USE_CUMULUS=--enable-cumulus=yes |
| 103 | +else |
| 104 | + USE_CUMULUS=--enable-cumulus=no |
| 105 | +endif |
| 106 | + |
| 107 | +ifeq ($(WANT_RPKI), 1) |
| 108 | + USE_RPKI=--enable-rpki |
| 109 | +else |
| 110 | + USE_RPKI=--disable-rpki |
| 111 | +endif |
| 112 | + |
| 113 | +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| 114 | + DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
| 115 | +endif |
| 116 | + |
| 117 | +ifdef DEBIAN_JOBS |
| 118 | +MAKEFLAGS += -j$(DEBIAN_JOBS) |
| 119 | +endif |
| 120 | + |
| 121 | +%: |
| 122 | + dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing |
| 123 | + |
| 124 | +override_dh_gencontrol: |
| 125 | +ifeq ($(WANT_RPKI), 1) |
| 126 | + dh_gencontrol -- -Vdist:Depends="librtr0 (>= 0.5)" |
| 127 | +else |
| 128 | + dh_gencontrol |
| 129 | +endif |
| 130 | + |
| 131 | +override_dh_auto_configure: |
| 132 | + # Frr needs /proc to check some BSD vs Linux specific stuff. |
| 133 | + # Else it fails with an obscure error message pointing out that |
| 134 | + # IPCTL_FORWARDING is an undefined symbol which is not very helpful. |
| 135 | + @if ! [ -d /proc/1 ]; then \ |
| 136 | + echo "./configure needs a mounted /proc"; \ |
| 137 | + exit 1; \ |
| 138 | + fi |
| 139 | + |
| 140 | + if ! [ -e config.status ]; then \ |
| 141 | + dh_auto_configure -- \ |
| 142 | + --enable-exampledir=/usr/share/doc/frr/examples/ \ |
| 143 | + --localstatedir=/var/run/frr \ |
| 144 | + --sbindir=/usr/lib/frr \ |
| 145 | + --sysconfdir=/etc/frr \ |
| 146 | + $(USE_SNMP) \ |
| 147 | + $(USE_OSPFAPI) \ |
| 148 | + $(USE_MULTIPATH) \ |
| 149 | + $(USE_LDP) \ |
| 150 | + $(USE_TCP_ZEBRA) \ |
| 151 | + --enable-fpm \ |
| 152 | + $(USE_FRR_USER) $(USE_FRR_GROUP) \ |
| 153 | + $(USE_FRR_VTY_GROUP) \ |
| 154 | + --enable-configfile-mask=0640 \ |
| 155 | + --enable-logfile-mask=0640 \ |
| 156 | + --enable-werror \ |
| 157 | + --with-libpam \ |
| 158 | + --enable-systemd=yes \ |
| 159 | + --enable-poll=yes \ |
| 160 | + $(USE_CUMULUS) \ |
| 161 | + $(USE_PIM) \ |
| 162 | + --enable-dependency-tracking \ |
| 163 | + $(USE_BGP_VNC) \ |
| 164 | + $(USE_RPKI) \ |
| 165 | + $(shell dpkg-buildflags --export=configure); \ |
| 166 | + fi |
| 167 | + |
| 168 | +override_dh_auto_build: |
| 169 | + #dh_auto_build |
| 170 | + $(MAKE) |
| 171 | + dh_auto_build -- -C doc draft-zebra-00.txt |
| 172 | + |
| 173 | + |
| 174 | + # doc/ is a bit crazy |
| 175 | +ifeq ($(GENERATE_PDF), 1) |
| 176 | + dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf |
| 177 | +endif |
| 178 | + rm -vf doc/frr.info |
| 179 | + dh_auto_build -- -C doc frr.info |
| 180 | + rm -vf doc/frr.info.html* |
| 181 | + |
| 182 | +override_dh_auto_test: |
| 183 | + |
| 184 | +override_dh_auto_install: |
| 185 | + dh_auto_install |
| 186 | + |
| 187 | + # installed in frr-pythontools |
| 188 | + rm debian/tmp/usr/lib/frr/frr-reload.py |
| 189 | + |
| 190 | + # cleaning up the info dir |
| 191 | + rm -f debian/tmp/usr/share/info/dir* |
| 192 | + |
| 193 | + # install config files |
| 194 | + mkdir -p debian/tmp/etc/frr/ |
| 195 | + perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample* |
| 196 | + |
| 197 | + # installing the Frr specific SNMP MIB |
| 198 | +ifeq ($(WANT_SNMP), 1) |
| 199 | + install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB |
| 200 | +else |
| 201 | + mkdir -p debian/tmp/usr/share/snmp/mibs/ |
| 202 | +endif |
| 203 | + |
| 204 | + # cleaning .la files |
| 205 | + sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la |
| 206 | + sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/frr/modules/*.la |
| 207 | + |
| 208 | +override_dh_systemd_start: |
| 209 | + dh_systemd_start frr.service |
| 210 | + |
| 211 | +override_dh_systemd_enable: |
| 212 | + dh_systemd_enable frr.service |
| 213 | + |
0 commit comments