]> git.proxmox.com Git - mirror_frr.git/blame - debianpkg/rules
Merge pull request #3121 from pguibert6WIND/flowspec_json_issue
[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
17WANT_SNMP ?= 0
100c355e 18WANT_RPKI ?= 0
9782a8db 19
100c355e
MW
20# NOTES:
21#
22# If you use WANT_RPKI, then there is a new dependency for librtr0 package
23# and a build dependency of the librtr-dev package.
24# While the librtr0 is added to the depenencies automatically, the build
25# dependency can't be changed dynamically and building will fail if the
26# librtr-dev isn't installed during package build
27# Tested versions of both packages can be found at
28# https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact
29#
7dc9a305 30# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
100c355e 31# Please be aware that 0 is NOT disabled, but treated as unlimited
9782a8db 32
33MULTIPATH ?= 256
34
35# Set the following to the value required (or leave alone for the default below)
7dc9a305 36# WANT_FRR_USER is used for the username and groupname of the FRR user account
9782a8db 37
38WANT_FRR_USER ?= frr
39WANT_FRR_VTY_GROUP ?= frrvty
40
351c5664 41# Don't build PDF docs by default
563fbfb3 42# add build deps: texlive-latex-base, texlive-generic-recommended
351c5664
QY
43GENERATE_PDF ?= 0
44
7dc9a305
MW
45#
46####################################
47
4d916382 48export DH_VERBOSE=1
4c2db6ed 49export DEB_BUILD_MAINT_OPTIONS = hardening=+all
d0af8528 50export DH_OPTIONS=-v
4d916382
DS
51
52ifeq ($(WANT_SNMP), 1)
53 USE_SNMP=--enable-snmp
54 $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
55else
9782a8db 56 USE_SNMP=--disable-snmp
4d916382
DS
57 $(warning "DEBIAN: SNMP disabled, see README.Debian")
58endif
59
9782a8db 60ifeq ($(WANT_OSPFAPI), 1)
7dc9a305
MW
61 USE_OSPFAPI=--enable-ospfapi=yes
62else
63 USE_OSPFAPI=--enable-ospfapi=no
64endif
65
9782a8db 66ifeq ($(WANT_BGP_VNC), 1)
7dc9a305
MW
67 USE_BGP_VNC=--enable-bgp-vnc=yes
68else
69 USE_BGP_VNC=--enable-bgp-vnc=no
70endif
71
9782a8db 72USE_FRR_USER=--enable-user=$(WANT_FRR_USER)
73USE_FRR_GROUP=--enable-group=$(WANT_FRR_USER)
74USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
7dc9a305 75
9782a8db 76ifeq ($(WANT_MULTIPATH), 1)
77 USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
7dc9a305
MW
78else
79 USE_MULTIPATH=--disable-multipath
80endif
81
a2ec1de2 82ifeq ($(WANT_CUMULUS_MODE), 1)
7dc9a305
MW
83 USE_CUMULUS=--enable-cumulus=yes
84else
85 USE_CUMULUS=--enable-cumulus=no
86endif
87
100c355e
MW
88ifeq ($(WANT_RPKI), 1)
89 USE_RPKI=--enable-rpki
90else
91 USE_RPKI=--disable-rpki
92endif
93
4108d884
DL
94ifeq ($(WANT_WERROR), 1)
95 USE_WERROR=--enable-werror
7134904b 96else
4108d884 97 USE_WERROR=--disable-werror
7134904b
RZ
98endif
99
35dab95b
DS
100ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
101 DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
102endif
103
104ifdef DEBIAN_JOBS
105MAKEFLAGS += -j$(DEBIAN_JOBS)
106endif
107
4d916382 108%:
d8e4c438 109 dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing
4d916382 110
100c355e
MW
111override_dh_gencontrol:
112ifeq ($(WANT_RPKI), 1)
113 dh_gencontrol -- -Vdist:Depends="librtr0 (>= 0.5)"
89073ff1
MW
114else
115 dh_gencontrol
100c355e
MW
116endif
117
4d916382 118override_dh_auto_configure:
d0af8528 119 if ! [ -e config.status ]; then \
4d916382 120 dh_auto_configure -- \
d8e4c438
DS
121 --enable-exampledir=/usr/share/doc/frr/examples/ \
122 --localstatedir=/var/run/frr \
123 --sbindir=/usr/lib/frr \
124 --sysconfdir=/etc/frr \
f1db66bf 125 $(USE_SNMP) \
7dc9a305
MW
126 $(USE_OSPFAPI) \
127 $(USE_MULTIPATH) \
23b53dca 128 --enable-fpm \
7dc9a305
MW
129 $(USE_FRR_USER) $(USE_FRR_GROUP) \
130 $(USE_FRR_VTY_GROUP) \
f1db66bf
DS
131 --enable-configfile-mask=0640 \
132 --enable-logfile-mask=0640 \
4108d884 133 $(USE_WERROR) \
6fb16c6b 134 --with-libpam \
f87adf0a 135 --enable-systemd=yes \
7dc9a305 136 $(USE_CUMULUS) \
4108d884 137 --disable-dependency-tracking \
4c2db6ed 138 $(USE_BGP_VNC) \
100c355e 139 $(USE_RPKI) \
4c2db6ed 140 $(shell dpkg-buildflags --export=configure); \
d0af8528 141 fi
4d916382
DS
142
143override_dh_auto_build:
25a886e1 144 dh_auto_build
d0af8528
DS
145
146override_dh_auto_test:
f1db66bf 147
4d916382
DS
148override_dh_auto_install:
149 dh_auto_install
f1db66bf 150
c650c681 151 # installed in frr-pythontools
152 rm debian/tmp/usr/lib/frr/frr-reload.py
153
4d916382
DS
154 # cleaning up the info dir
155 rm -f debian/tmp/usr/share/info/dir*
f1db66bf 156
4d916382 157 # install config files
d8e4c438
DS
158 mkdir -p debian/tmp/etc/frr/
159 perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
f1db66bf 160
25a886e1
DL
161 # we don't need .la files
162 rm debian/tmp/usr/lib/*.la
163 rm debian/tmp/usr/lib/frr/modules/*.la
4d916382 164
858aa29c 165override_dh_systemd_start:
d8e4c438 166 dh_systemd_start frr.service
858aa29c
DS
167
168override_dh_systemd_enable:
d8e4c438 169 dh_systemd_enable frr.service
858aa29c 170
a8247b21
SM
171# backports
172SRCPKG = frr
54c310b8 173KNOWN_BACKPORTS = debian8 debian9 ubuntu12.04 ubuntu14.04 ubuntu16.04 ubuntu17.10 ubuntu18.04
a8247b21 174DEBIAN_VERSION := $(shell dh_testdir && \
79c81c26
SM
175 dpkg-parsechangelog -c1 < debian/changelog | \
176 sed -rn 's/^Version: ?//p')
5eee7099 177ORIG_VERSION := $(DEBIAN_VERSION)
a8247b21
SM
178-include debian/backports/rules
179
180ifneq ($(TARBALLDIR),)
0f4ac621 181ifeq ($(wildcard frr-$(ORIG_VERSION).tar.gz),frr-$(ORIG_VERSION).tar.gz)
ee9d7744
SM
182
183$(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: \
0f4ac621 184 frr-$(ORIG_VERSION).tar.gz
495feb8a 185 cp $< $@
ee9d7744 186
0f4ac621 187else # wildcard frr-$(ORIG_VERSION).tar.gz
ee9d7744 188
a8247b21
SM
189# better error message on missing .orig.tar.gz
190$(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz:
ee9d7744 191 @ echo "\`$(TARBALLDIR)/$(SRCPKG)-$(ORIG_VERSION).tar.gz'" not \
a8247b21
SM
192 found and not generated by debian/rules. Provided you have the \
193 necessary packages installed, you can generate it yourself via \
ee9d7744 194 "\"./bootstrap.sh && ./configure && make dist\"".
a8247b21 195 exit 1
ee9d7744 196
0f4ac621 197endif # wildcard frr-$(ORIG_VERSION).tar.gz
ee9d7744 198endif # TARBALLDIR nonempty