]> git.proxmox.com Git - mirror_frr.git/blame - debianpkg/rules
debianpkg: fix remaining lintian warnings
[mirror_frr.git] / debianpkg / rules
CommitLineData
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
dcdf2f0d 7# The following are the defaults. They can be overridden by setting a
7dc9a305 8# env variable to a different value
9782a8db 9
8369dd11
DL
10# -Werror - don't enable this unless you're doing a dev package build
11WANT_WERROR ?= 0
12
9782a8db 13WANT_OSPFAPI ?= 1
f1aaa729 14WANT_BGP_VNC ?= 1
9782a8db 15WANT_CUMULUS_MODE ?= 0
16WANT_MULTIPATH ?= 1
9782a8db 17
100c355e 18# NOTES:
7dc9a305 19# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
100c355e 20# Please be aware that 0 is NOT disabled, but treated as unlimited
9782a8db 21
22MULTIPATH ?= 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
27WANT_FRR_USER ?= frr
28WANT_FRR_VTY_GROUP ?= frrvty
29
351c5664 30# Don't build PDF docs by default
f9df93fe 31# add build deps: texlive-latex-base, texlive-generic-recommended
351c5664
QY
32GENERATE_PDF ?= 0
33
7dc9a305
MW
34#
35####################################
36
4c2db6ed 37export DEB_BUILD_MAINT_OPTIONS = hardening=+all
4d916382 38
9782a8db 39ifeq ($(WANT_OSPFAPI), 1)
7dc9a305
MW
40 USE_OSPFAPI=--enable-ospfapi=yes
41else
42 USE_OSPFAPI=--enable-ospfapi=no
43endif
44
9782a8db 45ifeq ($(WANT_BGP_VNC), 1)
7dc9a305
MW
46 USE_BGP_VNC=--enable-bgp-vnc=yes
47else
48 USE_BGP_VNC=--enable-bgp-vnc=no
49endif
50
9782a8db 51USE_FRR_USER=--enable-user=$(WANT_FRR_USER)
52USE_FRR_GROUP=--enable-group=$(WANT_FRR_USER)
53USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
7dc9a305 54
9782a8db 55ifeq ($(WANT_MULTIPATH), 1)
56 USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
7dc9a305
MW
57else
58 USE_MULTIPATH=--disable-multipath
59endif
60
a2ec1de2 61ifeq ($(WANT_CUMULUS_MODE), 1)
7dc9a305
MW
62 USE_CUMULUS=--enable-cumulus=yes
63else
64 USE_CUMULUS=--enable-cumulus=no
65endif
66
8369dd11
DL
67ifeq ($(WANT_WERROR), 1)
68 USE_WERROR=--enable-werror
7134904b 69else
8369dd11 70 USE_WERROR=--disable-werror
7134904b
RZ
71endif
72
d84e22b8
DL
73#
74# generic debian options
75#
76
35dab95b
DS
77ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
78 DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
79endif
35dab95b
DS
80ifdef DEBIAN_JOBS
81MAKEFLAGS += -j$(DEBIAN_JOBS)
82endif
83
55795c9c
DL
84ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
85MAKE_SILENT="V=0"
86export DH_VERBOSE=0
87else
88MAKE_SILENT="V=1"
89export DH_VERBOSE=1
90export DH_OPTIONS=-v
91endif
92
d84e22b8
DL
93#
94# build profiles
95#
96
55795c9c 97ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
1b44f500 98 USE_DOC=--enable-doc --enable-doc-html
55795c9c
DL
99else
100 USE_DOC=--disable-doc
101endif
102
d84e22b8
DL
103ifeq ($(filter pkg.frr.rtrlib,$(DEB_BUILD_PROFILES)),)
104 USE_RPKI=--disable-rpki
105else
106 USE_RPKI=--enable-rpki
107endif
108
109ifeq ($(filter pkg.frr.snmp,$(DEB_BUILD_PROFILES)),)
110 USE_SNMP=--disable-snmp
111else
112 USE_SNMP=--enable-snmp
113endif
114
adcc6fb3
DL
115ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
116 DH_WITH_SYSTEMD=systemd,
117 USE_SYSTEMD=--enable-systemd=yes
89073ff1 118else
adcc6fb3
DL
119 DH_WITH_SYSTEMD=
120 USE_SYSTEMD=--enable-systemd=no
100c355e
MW
121endif
122
7480ba75
DL
123export PYTHON=python3
124
adcc6fb3 125%:
cffd0247 126 dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel --dbg-package=frr-dbg
adcc6fb3 127
4d916382 128override_dh_auto_configure:
d0af8528 129 if ! [ -e config.status ]; then \
4d916382 130 dh_auto_configure -- \
d8e4c438
DS
131 --enable-exampledir=/usr/share/doc/frr/examples/ \
132 --localstatedir=/var/run/frr \
133 --sbindir=/usr/lib/frr \
134 --sysconfdir=/etc/frr \
55795c9c
DL
135 --with-vtysh-pager=/usr/bin/pager \
136 $(USE_DOC) \
f1db66bf 137 $(USE_SNMP) \
7dc9a305
MW
138 $(USE_OSPFAPI) \
139 $(USE_MULTIPATH) \
6fa781c4
DL
140 --disable-fpm \
141 --disable-zeromq \
7dc9a305
MW
142 $(USE_FRR_USER) $(USE_FRR_GROUP) \
143 $(USE_FRR_VTY_GROUP) \
f1db66bf
DS
144 --enable-configfile-mask=0640 \
145 --enable-logfile-mask=0640 \
8369dd11 146 $(USE_WERROR) \
6fb16c6b 147 --with-libpam \
adcc6fb3 148 $(USE_SYSTEMD) \
7dc9a305 149 $(USE_CUMULUS) \
8369dd11 150 --disable-dependency-tracking \
4c2db6ed 151 $(USE_BGP_VNC) \
100c355e 152 $(USE_RPKI) \
4c2db6ed 153 $(shell dpkg-buildflags --export=configure); \
d0af8528 154 fi
4d916382 155
4d916382
DS
156override_dh_auto_install:
157 dh_auto_install
f1db66bf 158
7480ba75 159 sed -e '1c #!/usr/bin/python3' -i debian/tmp/usr/lib/frr/frr-reload.py
c650c681 160
dcdf2f0d 161# let dh_systemd_* and dh_installinit do their thing automatically
adcc6fb3
DL
162ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
163 cp tools/frr.service debian/frr.service
adcc6fb3 164endif
0c42b656 165 cp tools/frr debian/frr.init
f1db66bf 166
dcdf2f0d 167# install config files
d8e4c438
DS
168 mkdir -p debian/tmp/etc/frr/
169 perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
f1db66bf 170
dcdf2f0d 171# drop dev-only files
4bcac45b
DL
172 find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f
173 rm -rf debian/tmp/usr/include
9e554357 174
1b44f500
DL
175# use installed js libraries
176 -rm -f debian/tmp/usr/share/doc/frr/html/_static/jquery.js
177 ln -s /usr/share/javascript/jquery/jquery.js debian/tmp/usr/share/doc/frr/html/_static/jquery.js
178 -rm -f debian/tmp/usr/share/doc/frr/html/_static/underscore.js
179 ln -s /usr/share/javascript/underscore/underscore.js debian/tmp/usr/share/doc/frr/html/_static/underscore.js
180
55795c9c
DL
181override_dh_auto_build:
182 dh_auto_build -- $(MAKE_SILENT)
183
cffd0247
DL
184override_dh_missing:
185 dh_missing --fail-missing
186
9e554357
DL
187override_dh_auto_clean:
188# we generally do NOT want a full distclean since that wipes both
189# debianpkg/changelog and config.version
190 if test -f Makefile; then make redistclean; fi