forked from Mirror/frr

Now we can run dpkg-buildpackage from a dirty directory and it properly cleans up. Signed-off-by: David Lamparter <equinox@diac24.net>
165 lines
3.9 KiB
Makefile
Executable file
165 lines
3.9 KiB
Makefile
Executable file
#!/usr/bin/make -f
|
|
|
|
# FRRouting Configuration options
|
|
######################################
|
|
#
|
|
# WANT_xxxx --> Set to 1 for enable, 0 for disable
|
|
# The following are the defaults. They can be overridden by setting a
|
|
# env variable to a different value
|
|
|
|
# -Werror - don't enable this unless you're doing a dev package build
|
|
WANT_WERROR ?= 0
|
|
|
|
WANT_OSPFAPI ?= 1
|
|
WANT_BGP_VNC ?= 1
|
|
WANT_CUMULUS_MODE ?= 0
|
|
WANT_MULTIPATH ?= 1
|
|
|
|
# NOTES:
|
|
# If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
|
|
# Please be aware that 0 is NOT disabled, but treated as unlimited
|
|
|
|
MULTIPATH ?= 256
|
|
|
|
# Set the following to the value required (or leave alone for the default below)
|
|
# WANT_FRR_USER is used for the username and groupname of the FRR user account
|
|
|
|
WANT_FRR_USER ?= frr
|
|
WANT_FRR_VTY_GROUP ?= frrvty
|
|
|
|
# Don't build PDF docs by default
|
|
# add build deps: texlive-latex-base, texlive-generic-recommended
|
|
GENERATE_PDF ?= 0
|
|
|
|
#
|
|
####################################
|
|
|
|
export DH_VERBOSE=1
|
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|
export DH_OPTIONS=-v
|
|
|
|
ifeq ($(WANT_OSPFAPI), 1)
|
|
USE_OSPFAPI=--enable-ospfapi=yes
|
|
else
|
|
USE_OSPFAPI=--enable-ospfapi=no
|
|
endif
|
|
|
|
ifeq ($(WANT_BGP_VNC), 1)
|
|
USE_BGP_VNC=--enable-bgp-vnc=yes
|
|
else
|
|
USE_BGP_VNC=--enable-bgp-vnc=no
|
|
endif
|
|
|
|
USE_FRR_USER=--enable-user=$(WANT_FRR_USER)
|
|
USE_FRR_GROUP=--enable-group=$(WANT_FRR_USER)
|
|
USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
|
|
|
|
ifeq ($(WANT_MULTIPATH), 1)
|
|
USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
|
|
else
|
|
USE_MULTIPATH=--disable-multipath
|
|
endif
|
|
|
|
ifeq ($(WANT_CUMULUS_MODE), 1)
|
|
USE_CUMULUS=--enable-cumulus=yes
|
|
else
|
|
USE_CUMULUS=--enable-cumulus=no
|
|
endif
|
|
|
|
ifeq ($(WANT_WERROR), 1)
|
|
USE_WERROR=--enable-werror
|
|
else
|
|
USE_WERROR=--disable-werror
|
|
endif
|
|
|
|
#
|
|
# generic debian options
|
|
#
|
|
|
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
endif
|
|
|
|
ifdef DEBIAN_JOBS
|
|
MAKEFLAGS += -j$(DEBIAN_JOBS)
|
|
endif
|
|
|
|
#
|
|
# build profiles
|
|
#
|
|
|
|
ifeq ($(filter pkg.frr.rtrlib,$(DEB_BUILD_PROFILES)),)
|
|
USE_RPKI=--disable-rpki
|
|
else
|
|
USE_RPKI=--enable-rpki
|
|
endif
|
|
|
|
ifeq ($(filter pkg.frr.snmp,$(DEB_BUILD_PROFILES)),)
|
|
USE_SNMP=--disable-snmp
|
|
else
|
|
USE_SNMP=--enable-snmp
|
|
endif
|
|
|
|
ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
|
|
DH_WITH_SYSTEMD=systemd,
|
|
USE_SYSTEMD=--enable-systemd=yes
|
|
else
|
|
DH_WITH_SYSTEMD=
|
|
USE_SYSTEMD=--enable-systemd=no
|
|
endif
|
|
|
|
%:
|
|
dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel --dbg-package=frr-dbg --list-missing
|
|
|
|
override_dh_auto_configure:
|
|
if ! [ -e config.status ]; then \
|
|
dh_auto_configure -- \
|
|
--enable-exampledir=/usr/share/doc/frr/examples/ \
|
|
--localstatedir=/var/run/frr \
|
|
--sbindir=/usr/lib/frr \
|
|
--sysconfdir=/etc/frr \
|
|
$(USE_SNMP) \
|
|
$(USE_OSPFAPI) \
|
|
$(USE_MULTIPATH) \
|
|
--enable-fpm \
|
|
$(USE_FRR_USER) $(USE_FRR_GROUP) \
|
|
$(USE_FRR_VTY_GROUP) \
|
|
--enable-configfile-mask=0640 \
|
|
--enable-logfile-mask=0640 \
|
|
$(USE_WERROR) \
|
|
--with-libpam \
|
|
$(USE_SYSTEMD) \
|
|
$(USE_CUMULUS) \
|
|
--disable-dependency-tracking \
|
|
$(USE_BGP_VNC) \
|
|
$(USE_RPKI) \
|
|
$(shell dpkg-buildflags --export=configure); \
|
|
fi
|
|
|
|
override_dh_auto_install:
|
|
dh_auto_install
|
|
|
|
# installed in frr-pythontools
|
|
rm debian/tmp/usr/lib/frr/frr-reload.py
|
|
|
|
# let dh_systemd_* and dh_installinit do their thing automatically
|
|
ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
|
|
cp tools/frr.service debian/frr.service
|
|
else
|
|
cp tools/frr debian/frr.init
|
|
endif
|
|
|
|
# install config files
|
|
mkdir -p debian/tmp/etc/frr/
|
|
perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
|
|
|
|
# we don't need .la files
|
|
rm debian/tmp/usr/lib/*.la
|
|
rm debian/tmp/usr/lib/frr/modules/*.la
|
|
rm debian/tmp/usr/lib/frr/libyang_plugins/*.la
|
|
|
|
override_dh_auto_clean:
|
|
# we generally do NOT want a full distclean since that wipes both
|
|
# debianpkg/changelog and config.version
|
|
if test -f Makefile; then make redistclean; fi
|