From 3b2a8d25461e5295cc64e1a5976c66046dba40b9 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 3 Oct 2018 19:14:27 +0200 Subject: [PATCH] debianpkg: create frr-snmp and frr-rpki-rtrlib This splits off SNMP and RPKI support so that users can install these packages (with the appropriate dependencies) independently of main FRR. It also obsoletes out the weird multi-variant package distribution we've been doing for RPKI support. The snmpd dependency is also changed to Recommends: on frr-snmp since the frr-snmp package is essentially useless without snmpd. Signed-off-by: David Lamparter --- debianpkg/README.Debian | 34 +++++++++++++++++++-- debianpkg/control | 30 +++++++++++++++++-- debianpkg/frr-rpki-rtrlib.install | 1 + debianpkg/frr-snmp.install | 6 ++++ debianpkg/frr-snmp.lintian-overrides | 1 + debianpkg/frr.install | 7 ++++- debianpkg/rules | 45 +++++++++++++--------------- debianpkg/subdir.am | 3 ++ 8 files changed, 96 insertions(+), 31 deletions(-) create mode 100644 debianpkg/frr-rpki-rtrlib.install create mode 100644 debianpkg/frr-snmp.install create mode 100644 debianpkg/frr-snmp.lintian-overrides diff --git a/debianpkg/README.Debian b/debianpkg/README.Debian index cd7be5e801..09313ac6d5 100644 --- a/debianpkg/README.Debian +++ b/debianpkg/README.Debian @@ -22,6 +22,36 @@ which itself is a fork of Zebra. Zebra was developed by Kunihiro Ishiguro. +* Build Profiles used in the upstream debianpkg/ +================================================ + +The following Build Profiles have been added: + +- pkg.frr.rtrlib (pkg.frr.nortrlib) + controls whether the RPKI module is built. + Will be enabled by default at some point, adds some extra dependencies. + +- pkg.frr.snmp (pkg.frr.nosnmp) + controls whether the SNMP module is built, see below for license issues. + Will remain default-off as long as the license issue persists. + +- pkg.frr.nosystemd + Disables both systemd unit file installation as well as watchfrr sd_notify + support at startup. Removes libsystemd dependency. + +Note that all options have a "no" form; if you want to have your decision +be sticky regardless of changes to what it defaults to, then always use one +of the two. For example, all occurrences of will at some +point be replaced with . + +The main frr package has the exact same contents regardless of rtrlib or snmp +choices. The options only control frr-snmp and frr-rpki-rtrlib packages. + +The main frr package does NOT have the same contents if pkg.frr.nosystemd is +used. This option should only be used for systems that do not have systemd, +e.g. Ubuntu 14.04. + + * Why has SNMP support been disabled? ===================================== FRR used to link against the NetSNMP libraries to provide SNMP @@ -43,9 +73,7 @@ during the last days before the Sarge release :-( It is allowed by the used licence mix that you fetch the sources and build FRR yourself with SNMP with - - # export WANT_SNMP=1 - # apt-get -b source frr + # apt-get -b source -Ppkg.frr.snmp frr Just distributing it in binary form, linked against OpenSSL, is forbidden. diff --git a/debianpkg/control b/debianpkg/control index a89e4d96ad..7db983f802 100644 --- a/debianpkg/control +++ b/debianpkg/control @@ -23,7 +23,9 @@ Build-Depends: libpcre3-dev, libpython-dev | libpython3-dev, libreadline-dev, - libsnmp-dev, + librtr-dev , + libsnmp-dev , + libssh-dev , libsystemd-dev , pkg-config, python (>= 2.7) | python3, @@ -42,7 +44,6 @@ Depends: Pre-Depends: adduser Conflicts: zebra, zebra-pj, quagga Replaces: zebra, zebra-pj -Suggests: snmpd Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon forked from Quagga FRR is free software which manages TCP/IP based routing protocols. It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, RIPng, @@ -51,6 +52,31 @@ Description: BGP/OSPF/RIP/RIPng/ISIS/PIM/LDP routing daemon forked from Quagga FRR is a fork of Quagga with an open community model. The main git lives on https://github.com/frrouting/frr.git +Package: frr-snmp +Section: net +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + frr (= ${binary:Version}) +Recommends: snmpd +Description: FRRouting SNMP support + Adds SNMP support to FRR's daemons by attaching to net-snmp's snmpd + through the AgentX protocol. +Build-Profiles: + +Package: frr-rpki-rtrlib +Section: net +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + frr (= ${binary:Version}) +Description: FRRouting RTRlib RPKI support + Adds RPKI support to FRR's bgpd, allowing validation of BGP routes against + cryptographic information stored in WHOIS databases. +Build-Profiles: + Package: frr-dbg Architecture: any Depends: diff --git a/debianpkg/frr-rpki-rtrlib.install b/debianpkg/frr-rpki-rtrlib.install new file mode 100644 index 0000000000..3c9d4557ed --- /dev/null +++ b/debianpkg/frr-rpki-rtrlib.install @@ -0,0 +1 @@ +usr/lib/frr/modules/bgpd_rpki.so diff --git a/debianpkg/frr-snmp.install b/debianpkg/frr-snmp.install new file mode 100644 index 0000000000..a400c07f81 --- /dev/null +++ b/debianpkg/frr-snmp.install @@ -0,0 +1,6 @@ +usr/lib/libfrrsnmp.* +usr/lib/frr/modules/bgpd_snmp.so +usr/lib/frr/modules/ospfd_snmp.so +usr/lib/frr/modules/ospf6d_snmp.so +usr/lib/frr/modules/ripd_snmp.so +usr/lib/frr/modules/zebra_snmp.so diff --git a/debianpkg/frr-snmp.lintian-overrides b/debianpkg/frr-snmp.lintian-overrides new file mode 100644 index 0000000000..3853070284 --- /dev/null +++ b/debianpkg/frr-snmp.lintian-overrides @@ -0,0 +1 @@ +frr: package-name-doesnt-match-sonames libfrrsnmp0 diff --git a/debianpkg/frr.install b/debianpkg/frr.install index 13c5dd27a4..0443e6198e 100644 --- a/debianpkg/frr.install +++ b/debianpkg/frr.install @@ -2,7 +2,12 @@ etc/frr/ usr/bin/vtysh usr/bin/mtracebis usr/include/frr/ -usr/lib/ +usr/lib/libfrr.* +usr/lib/libfrrospfapiclient.* +usr/lib/frr/*d +usr/lib/frr/watchfrr +usr/lib/frr/zebra +usr/lib/frr/modules/zebra_irdp.so usr/share/doc/frr/ usr/share/man/ usr/share/yang/ diff --git a/debianpkg/rules b/debianpkg/rules index a4812293b0..f924c89f46 100755 --- a/debianpkg/rules +++ b/debianpkg/rules @@ -14,19 +14,8 @@ WANT_OSPFAPI ?= 1 WANT_BGP_VNC ?= 1 WANT_CUMULUS_MODE ?= 0 WANT_MULTIPATH ?= 1 -WANT_SNMP ?= 0 -WANT_RPKI ?= 0 # NOTES: -# -# If you use WANT_RPKI, then there is a new dependency for librtr0 package -# and a build dependency of the librtr-dev package. -# While the librtr0 is added to the depenencies automatically, the build -# dependency can't be changed dynamically and building will fail if the -# librtr-dev isn't installed during package build -# Tested versions of both packages can be found at -# https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact -# # 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 @@ -49,14 +38,6 @@ export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DH_OPTIONS=-v -ifeq ($(WANT_SNMP), 1) - USE_SNMP=--enable-snmp - $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience") -else - USE_SNMP=--disable-snmp - $(warning "DEBIAN: SNMP disabled, see README.Debian") -endif - ifeq ($(WANT_OSPFAPI), 1) USE_OSPFAPI=--enable-ospfapi=yes else @@ -85,18 +66,16 @@ else USE_CUMULUS=--enable-cumulus=no endif -ifeq ($(WANT_RPKI), 1) - USE_RPKI=--enable-rpki -else - USE_RPKI=--disable-rpki -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 @@ -105,6 +84,22 @@ 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 diff --git a/debianpkg/subdir.am b/debianpkg/subdir.am index e9a8d764b5..4193eadc15 100644 --- a/debianpkg/subdir.am +++ b/debianpkg/subdir.am @@ -21,6 +21,9 @@ EXTRA_DIST += \ debianpkg/frr-doc.install \ debianpkg/frr-doc.lintian-overrides \ debianpkg/frr-pythontools.install \ + debianpkg/frr-rpki-rtrlib.install \ + debianpkg/frr-snmp.install \ + debianpkg/frr-snmp.lintian-overrides \ debianpkg/frr.conf \ debianpkg/frr.dirs \ debianpkg/frr.docs \ -- 2.39.5