]> git.proxmox.com Git - mirror_frr.git/blame - debianpkg/rules
debianpkg: ditch development-only files
[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
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
DL
97ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
98 USE_DOC=--enable-doc
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
adcc6fb3
DL
123%:
124 dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel --dbg-package=frr-dbg --list-missing
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 \
55795c9c
DL
133 --with-vtysh-pager=/usr/bin/pager \
134 $(USE_DOC) \
f1db66bf 135 $(USE_SNMP) \
7dc9a305
MW
136 $(USE_OSPFAPI) \
137 $(USE_MULTIPATH) \
23b53dca 138 --enable-fpm \
7dc9a305
MW
139 $(USE_FRR_USER) $(USE_FRR_GROUP) \
140 $(USE_FRR_VTY_GROUP) \
f1db66bf
DS
141 --enable-configfile-mask=0640 \
142 --enable-logfile-mask=0640 \
8369dd11 143 $(USE_WERROR) \
6fb16c6b 144 --with-libpam \
adcc6fb3 145 $(USE_SYSTEMD) \
7dc9a305 146 $(USE_CUMULUS) \
8369dd11 147 --disable-dependency-tracking \
4c2db6ed 148 $(USE_BGP_VNC) \
100c355e 149 $(USE_RPKI) \
4c2db6ed 150 $(shell dpkg-buildflags --export=configure); \
d0af8528 151 fi
4d916382 152
4d916382
DS
153override_dh_auto_install:
154 dh_auto_install
f1db66bf 155
c650c681 156 # installed in frr-pythontools
157 rm debian/tmp/usr/lib/frr/frr-reload.py
158
adcc6fb3
DL
159 # let dh_systemd_* and dh_installinit do their thing automatically
160ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
161 cp tools/frr.service debian/frr.service
162else
163 cp tools/frr debian/frr.init
164endif
f1db66bf 165
4d916382 166 # install config files
d8e4c438
DS
167 mkdir -p debian/tmp/etc/frr/
168 perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
f1db66bf 169
4bcac45b
DL
170 # drop dev-only files
171 find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f
172 rm -rf debian/tmp/usr/include
9e554357 173
55795c9c
DL
174override_dh_auto_build:
175 dh_auto_build -- $(MAKE_SILENT)
176
9e554357
DL
177override_dh_auto_clean:
178# we generally do NOT want a full distclean since that wipes both
179# debianpkg/changelog and config.version
180 if test -f Makefile; then make redistclean; fi