]> git.proxmox.com Git - mirror_frr.git/blame - debianpkg/rules
debianpkg: disable zeromq and FPM
[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
7# The following are the defaults. They can be overridden by setting a
8# env variable to a different value
9782a8db 9
4108d884
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
563fbfb3 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
4108d884
DL
67ifeq ($(WANT_WERROR), 1)
68 USE_WERROR=--enable-werror
7134904b 69else
4108d884 70 USE_WERROR=--disable-werror
7134904b
RZ
71endif
72
3b2a8d25
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
5d2f5756
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
3b2a8d25
DL
93#
94# build profiles
95#
96
5d2f5756
DL
97ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
98 USE_DOC=--enable-doc
99else
100 USE_DOC=--disable-doc
101endif
102
3b2a8d25
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
6397fb88
DL
115ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
116 DH_WITH_SYSTEMD=systemd,
117 USE_SYSTEMD=--enable-systemd=yes
89073ff1 118else
6397fb88
DL
119 DH_WITH_SYSTEMD=
120 USE_SYSTEMD=--enable-systemd=no
100c355e
MW
121endif
122
6397fb88 123%:
6e484e36 124 dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel --dbg-package=frr-dbg
6397fb88 125
4d916382 126override_dh_auto_configure:
d0af8528 127 if ! [ -e config.status ]; then \
4d916382 128 dh_auto_configure -- \
d8e4c438
DS
129 --enable-exampledir=/usr/share/doc/frr/examples/ \
130 --localstatedir=/var/run/frr \
131 --sbindir=/usr/lib/frr \
132 --sysconfdir=/etc/frr \
5d2f5756
DL
133 --with-vtysh-pager=/usr/bin/pager \
134 $(USE_DOC) \
f1db66bf 135 $(USE_SNMP) \
7dc9a305
MW
136 $(USE_OSPFAPI) \
137 $(USE_MULTIPATH) \
5d91b470
DL
138 --disable-fpm \
139 --disable-zeromq \
7dc9a305
MW
140 $(USE_FRR_USER) $(USE_FRR_GROUP) \
141 $(USE_FRR_VTY_GROUP) \
f1db66bf
DS
142 --enable-configfile-mask=0640 \
143 --enable-logfile-mask=0640 \
4108d884 144 $(USE_WERROR) \
6fb16c6b 145 --with-libpam \
6397fb88 146 $(USE_SYSTEMD) \
7dc9a305 147 $(USE_CUMULUS) \
4108d884 148 --disable-dependency-tracking \
4c2db6ed 149 $(USE_BGP_VNC) \
100c355e 150 $(USE_RPKI) \
4c2db6ed 151 $(shell dpkg-buildflags --export=configure); \
d0af8528 152 fi
4d916382 153
4d916382
DS
154override_dh_auto_install:
155 dh_auto_install
f1db66bf 156
c650c681 157 # installed in frr-pythontools
158 rm debian/tmp/usr/lib/frr/frr-reload.py
159
6397fb88
DL
160 # let dh_systemd_* and dh_installinit do their thing automatically
161ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
162 cp tools/frr.service debian/frr.service
163else
164 cp tools/frr debian/frr.init
165endif
f1db66bf 166
4d916382 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
08427130
DL
171 # drop dev-only files
172 find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f
173 rm -rf debian/tmp/usr/include
02334d76 174
5d2f5756
DL
175override_dh_auto_build:
176 dh_auto_build -- $(MAKE_SILENT)
177
6e484e36
DL
178override_dh_missing:
179 dh_missing --fail-missing
180
02334d76
DL
181override_dh_auto_clean:
182# we generally do NOT want a full distclean since that wipes both
183# debianpkg/changelog and config.version
184 if test -f Makefile; then make redistclean; fi