This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/sonic-frr/sonic_frr.rules
Rodny Molina d30fbf1d72 [build]: Adding support for Free-Range-Routing stack. (#510)
- Extending SONiC building infrastructure to provide users
           with greater flexibility, by allowing them to elect a
           routing-stack different than the default one (quagga). The desired
           routing-stack will be defined in rules/config file.

         - As part of these changes I'm adding support for
           Free-Range-Routing (FRR) stack. Quagga will continue to be
           the default routing-stack.

Signed-off-by: Rodny Molina <rodny@linkedin.com>
2017-04-20 09:12:27 -07:00

100 lines
2.5 KiB
Makefile
Executable File

#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_HARDENING=1
export DH_OPTIONS=-v
ifeq ($(WANT_SNMP), 1)
USE_SNMP=--enable-snmp
$(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
else
$(warning "DEBIAN: SNMP disabled, see README.Debian")
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
ifdef DEBIAN_JOBS
MAKEFLAGS += -j$(DEBIAN_JOBS)
endif
%:
dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing
override_dh_auto_configure:
# Frr needs /proc to check some BSD vs Linux specific stuff.
# Else it fails with an obscure error message pointing out that
# IPCTL_FORWARDING is an undefined symbol which is not very helpful.
@if ! [ -d /proc/1 ]; then \
echo "./configure needs a mounted /proc"; \
exit 1; \
fi
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) \
--enable-vtysh=yes \
--enable-isisd=yes \
--enable-multipath=256 \
--enable-user=frr \
--enable-group=frr \
--enable-vty-group=frrvty \
--enable-configfile-mask=0640 \
--enable-logfile-mask=0640 \
--enable-werror \
--enable-gcc-rdynamic \
--with-libpam \
--enable-systemd=yes \
--enable-poll=yes \
--enable-dependency-tracking \
--enable-bgp-vnc=no \
--enable-tcp-zebra \
--enable-fpm; \
fi
override_dh_auto_build:
#dh_auto_build
$(MAKE)
dh_auto_build -- -C doc draft-zebra-00.txt
# doc/ is a bit crazy
ifeq ($(GENERATE_PDF), 1)
dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
endif
rm -vf doc/frr.info
dh_auto_build -- -C doc frr.info
rm -vf doc/frr.info.html*
override_dh_auto_test:
override_dh_auto_install:
dh_auto_install
# cleaning up the info dir
rm -f debian/tmp/usr/share/info/dir*
# 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*
# installing frr initialization script
mkdir -p debian/tmp/etc/init.d/
cp debian/tmp/usr/lib/frr/frr debian/tmp/etc/init.d/
# installing the Frr specific SNMP MIB
ifeq ($(WANT_SNMP), 1)
install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
else
mkdir -p debian/tmp/usr/share/snmp/mibs/
endif
# cleaning .la files
sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la