]>
Commit | Line | Data |
---|---|---|
4d916382 DS |
1 | #!/usr/bin/make -f |
2 | ||
7dc9a305 MW |
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 | |
9782a8db | 9 | |
10 | WANT_LDP ?= 1 | |
11 | WANT_PIM ?= 1 | |
12 | WANT_OSPFAPI ?= 1 | |
13 | WANT_TCP_ZEBRA ?= 0 | |
f1aaa729 | 14 | WANT_BGP_VNC ?= 1 |
9782a8db | 15 | WANT_CUMULUS_MODE ?= 0 |
16 | WANT_MULTIPATH ?= 1 | |
17 | WANT_SNMP ?= 0 | |
9782a8db | 18 | |
7dc9a305 MW |
19 | # If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here |
20 | # Please be aware that 0 is NOT disabled, but treated as unlimited | |
9782a8db | 21 | |
22 | MULTIPATH ?= 256 | |
23 | ||
24 | # Set the following to the value required (or leave alone for the default below) | |
7dc9a305 | 25 | # WANT_FRR_USER is used for the username and groupname of the FRR user account |
9782a8db | 26 | |
27 | WANT_FRR_USER ?= frr | |
28 | WANT_FRR_VTY_GROUP ?= frrvty | |
29 | ||
351c5664 QY |
30 | # Don't build PDF docs by default |
31 | GENERATE_PDF ?= 0 | |
32 | ||
7dc9a305 MW |
33 | # |
34 | #################################### | |
35 | ||
4d916382 | 36 | export DH_VERBOSE=1 |
4c2db6ed | 37 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
d0af8528 | 38 | export DH_OPTIONS=-v |
4d916382 DS |
39 | |
40 | ifeq ($(WANT_SNMP), 1) | |
41 | USE_SNMP=--enable-snmp | |
42 | $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience") | |
43 | else | |
9782a8db | 44 | USE_SNMP=--disable-snmp |
4d916382 DS |
45 | $(warning "DEBIAN: SNMP disabled, see README.Debian") |
46 | endif | |
47 | ||
9782a8db | 48 | ifeq ($(WANT_LDP), 1) |
7dc9a305 MW |
49 | USE_LDP=--enable-ldpd |
50 | else | |
51 | USE_LDP=--disable-ldpd | |
52 | endif | |
53 | ||
9782a8db | 54 | ifeq ($(WANT_PIM), 1) |
7dc9a305 MW |
55 | USE_PIM=--enable-pimd |
56 | else | |
57 | USE_PIM=--disable-pimd | |
58 | endif | |
59 | ||
9782a8db | 60 | ifeq ($(WANT_OSPFAPI), 1) |
7dc9a305 MW |
61 | USE_OSPFAPI=--enable-ospfapi=yes |
62 | else | |
63 | USE_OSPFAPI=--enable-ospfapi=no | |
64 | endif | |
65 | ||
7dc9a305 MW |
66 | ifeq ($(WANT_TCP_ZEBRA),1) |
67 | USE_TCP_ZEBRA=--enable-tcp-zebra | |
9782a8db | 68 | else |
69 | USE_TCP_ZEBRA=--disable-tcp-zebra | |
7dc9a305 MW |
70 | endif |
71 | ||
9782a8db | 72 | ifeq ($(WANT_BGP_VNC), 1) |
7dc9a305 MW |
73 | USE_BGP_VNC=--enable-bgp-vnc=yes |
74 | else | |
75 | USE_BGP_VNC=--enable-bgp-vnc=no | |
76 | endif | |
77 | ||
9782a8db | 78 | USE_FRR_USER=--enable-user=$(WANT_FRR_USER) |
79 | USE_FRR_GROUP=--enable-group=$(WANT_FRR_USER) | |
80 | USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP) | |
7dc9a305 | 81 | |
9782a8db | 82 | ifeq ($(WANT_MULTIPATH), 1) |
83 | USE_MULTIPATH=--enable-multipath=$(MULTIPATH) | |
7dc9a305 MW |
84 | else |
85 | USE_MULTIPATH=--disable-multipath | |
86 | endif | |
87 | ||
a2ec1de2 | 88 | ifeq ($(WANT_CUMULUS_MODE), 1) |
7dc9a305 MW |
89 | USE_CUMULUS=--enable-cumulus=yes |
90 | else | |
91 | USE_CUMULUS=--enable-cumulus=no | |
92 | endif | |
93 | ||
35dab95b DS |
94 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
95 | DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
96 | endif | |
97 | ||
98 | ifdef DEBIAN_JOBS | |
99 | MAKEFLAGS += -j$(DEBIAN_JOBS) | |
100 | endif | |
101 | ||
4d916382 | 102 | %: |
d8e4c438 | 103 | dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing |
4d916382 DS |
104 | |
105 | override_dh_auto_configure: | |
d8e4c438 | 106 | # Frr needs /proc to check some BSD vs Linux specific stuff. |
4d916382 DS |
107 | # Else it fails with an obscure error message pointing out that |
108 | # IPCTL_FORWARDING is an undefined symbol which is not very helpful. | |
109 | @if ! [ -d /proc/1 ]; then \ | |
f1db66bf DS |
110 | echo "./configure needs a mounted /proc"; \ |
111 | exit 1; \ | |
4d916382 | 112 | fi |
d0af8528 DS |
113 | |
114 | if ! [ -e config.status ]; then \ | |
4d916382 | 115 | dh_auto_configure -- \ |
d8e4c438 DS |
116 | --enable-exampledir=/usr/share/doc/frr/examples/ \ |
117 | --localstatedir=/var/run/frr \ | |
118 | --sbindir=/usr/lib/frr \ | |
119 | --sysconfdir=/etc/frr \ | |
f1db66bf | 120 | $(USE_SNMP) \ |
7dc9a305 MW |
121 | $(USE_OSPFAPI) \ |
122 | $(USE_MULTIPATH) \ | |
123 | $(USE_LDP) \ | |
124 | $(USE_TCP_ZEBRA) \ | |
23b53dca | 125 | --enable-fpm \ |
7dc9a305 MW |
126 | $(USE_FRR_USER) $(USE_FRR_GROUP) \ |
127 | $(USE_FRR_VTY_GROUP) \ | |
f1db66bf DS |
128 | --enable-configfile-mask=0640 \ |
129 | --enable-logfile-mask=0640 \ | |
d6db5772 | 130 | --enable-werror \ |
6fb16c6b | 131 | --with-libpam \ |
f87adf0a | 132 | --enable-systemd=yes \ |
f879bbf4 | 133 | --enable-poll=yes \ |
7dc9a305 MW |
134 | $(USE_CUMULUS) \ |
135 | $(USE_PIM) \ | |
9ad5ef40 | 136 | --enable-dependency-tracking \ |
4c2db6ed MW |
137 | $(USE_BGP_VNC) \ |
138 | $(shell dpkg-buildflags --export=configure); \ | |
d0af8528 | 139 | fi |
4d916382 DS |
140 | |
141 | override_dh_auto_build: | |
4d916382 | 142 | # doc/ is a bit crazy |
76ed358f | 143 | ifeq ($(GENERATE_PDF), 1) |
edc33b2f | 144 | dh_auto_build -- -C doc pdf |
76ed358f | 145 | endif |
b59555c6 | 146 | rm -vf doc/user/_build/texinfo/frr.info |
edc33b2f | 147 | dh_auto_build -- -C doc info |
d0af8528 DS |
148 | |
149 | override_dh_auto_test: | |
f1db66bf | 150 | |
4d916382 DS |
151 | override_dh_auto_install: |
152 | dh_auto_install | |
f1db66bf | 153 | |
c650c681 | 154 | # installed in frr-pythontools |
155 | rm debian/tmp/usr/lib/frr/frr-reload.py | |
156 | ||
4d916382 DS |
157 | # cleaning up the info dir |
158 | rm -f debian/tmp/usr/share/info/dir* | |
f1db66bf | 159 | |
4d916382 | 160 | # install config files |
d8e4c438 DS |
161 | mkdir -p debian/tmp/etc/frr/ |
162 | perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample* | |
f1db66bf | 163 | |
d8e4c438 | 164 | # installing the Frr specific SNMP MIB |
3d85ffa5 | 165 | ifeq ($(WANT_SNMP), 1) |
4d916382 | 166 | install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB |
3d85ffa5 DS |
167 | else |
168 | mkdir -p debian/tmp/usr/share/snmp/mibs/ | |
169 | endif | |
f1db66bf | 170 | |
4d916382 DS |
171 | # cleaning .la files |
172 | sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la | |
27232291 | 173 | sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/frr/modules/*.la |
4d916382 | 174 | |
858aa29c | 175 | override_dh_systemd_start: |
d8e4c438 | 176 | dh_systemd_start frr.service |
858aa29c DS |
177 | |
178 | override_dh_systemd_enable: | |
d8e4c438 | 179 | dh_systemd_enable frr.service |
858aa29c | 180 | |
a8247b21 SM |
181 | # backports |
182 | SRCPKG = frr | |
2f29e6d7 | 183 | KNOWN_BACKPORTS = debian8 debian9 ubuntu12.04 ubuntu14.04 ubuntu16.04 ubuntu17.10 |
a8247b21 | 184 | DEBIAN_VERSION := $(shell dh_testdir && \ |
79c81c26 SM |
185 | dpkg-parsechangelog -c1 < debian/changelog | \ |
186 | sed -rn 's/^Version: ?//p') | |
5eee7099 | 187 | ORIG_VERSION := $(DEBIAN_VERSION) |
a8247b21 SM |
188 | -include debian/backports/rules |
189 | ||
190 | ifneq ($(TARBALLDIR),) | |
0f4ac621 | 191 | ifeq ($(wildcard frr-$(ORIG_VERSION).tar.gz),frr-$(ORIG_VERSION).tar.gz) |
ee9d7744 SM |
192 | |
193 | $(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: \ | |
0f4ac621 | 194 | frr-$(ORIG_VERSION).tar.gz |
495feb8a | 195 | cp $< $@ |
ee9d7744 | 196 | |
0f4ac621 | 197 | else # wildcard frr-$(ORIG_VERSION).tar.gz |
ee9d7744 | 198 | |
a8247b21 SM |
199 | # better error message on missing .orig.tar.gz |
200 | $(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: | |
ee9d7744 | 201 | @ echo "\`$(TARBALLDIR)/$(SRCPKG)-$(ORIG_VERSION).tar.gz'" not \ |
a8247b21 SM |
202 | found and not generated by debian/rules. Provided you have the \ |
203 | necessary packages installed, you can generate it yourself via \ | |
ee9d7744 | 204 | "\"./bootstrap.sh && ./configure && make dist\"". |
a8247b21 | 205 | exit 1 |
ee9d7744 | 206 | |
0f4ac621 | 207 | endif # wildcard frr-$(ORIG_VERSION).tar.gz |
ee9d7744 | 208 | endif # TARBALLDIR nonempty |