Source: frr
Version: 10.6.1-2
Severity: wishlist
Tags: patch
X-Debbugs-Cc: [email protected], [email protected]

FRR supports out of tree dataplane plugins that are built as shared
libraries loaded at runtime. These plugins need access to FRR internal
C headers and to the frr.pc pkg-config file to compile. For example,
grout (a graph router based on DPDK) provides a zebra dataplane plugin
to integrate with FRR.

Add a frr-headers package that installs the C headers and the pkg-config
file. The package depends on libjson-c-dev and libyang-dev which are
required by the headers. Add version constraints via Breaks so that when
frr is also installed, both packages must come from the same source
version.

There are -Wno-* flags in the pkg-config file (needed due to warnings in
FRR headers). This causes lintian *errors*. Silence them with via
a lintian-overrides file.

Signed-off-by: Robin Jarry <[email protected]>
---
 debian/control                       | 16 ++++++++++++++++
 debian/frr-headers.install           |  2 ++
 debian/frr-headers.lintian-overrides |  3 +++
 debian/not-installed                 |  1 -
 debian/rules                         |  3 +--
 5 files changed, 22 insertions(+), 3 deletions(-)
 create mode 100644 debian/frr-headers.install
 create mode 100644 debian/frr-headers.lintian-overrides

diff --git a/debian/control b/debian/control
index 9c834fd85466..b1054d98debe 100644
--- a/debian/control
+++ b/debian/control
@@ -140,3 +140,19 @@ Description: FRRouting Internet routing protocol suite 
(SNMP support)
  .
  This allows read-only access to current routing state through standard SNMP
  MIBs.
+
+Package: frr-headers
+Section: net
+Architecture: linux-any
+Depends:
+ ${misc:Depends},
+ libjson-c-dev,
+ libyang-dev,
+Breaks:
+ frr (<< ${source:Version}~),
+ frr (>> ${source:Version}.0~),
+Description: FRRouting Internet routing protocol suite (development headers)
+ FRRouting (FRR) is a Internet routing protocol suite implementing BGP, OSPF,
+ RIP, IS-IS, PIM, LDP, BFD, Babel, PBR, OpenFabric, VRRP, EIGRP and NHRP.
+ .
+ This package adds C headers needed to build out of tree dataplane plugins.
diff --git a/debian/frr-headers.install b/debian/frr-headers.install
new file mode 100644
index 000000000000..757f1f3fd097
--- /dev/null
+++ b/debian/frr-headers.install
@@ -0,0 +1,2 @@
+usr/include/frr
+usr/lib/*/pkgconfig/frr.pc
diff --git a/debian/frr-headers.lintian-overrides 
b/debian/frr-headers.lintian-overrides
new file mode 100644
index 000000000000..7539c16a28b6
--- /dev/null
+++ b/debian/frr-headers.lintian-overrides
@@ -0,0 +1,3 @@
+# The -Wno-* flags are intentional: FRR headers trigger many warnings
+# without them, and consumers need these flags to compile cleanly.
+frr-headers: pkg-config-bad-directive *
diff --git a/debian/not-installed b/debian/not-installed
index 8999dd948b31..6a113d14fd7b 100644
--- a/debian/not-installed
+++ b/debian/not-installed
@@ -1,4 +1,3 @@
-usr/include
 usr/lib/frr/ospfclient
 usr/lib/frr/rfptest
 usr/lib/*/frr/modules/dplane_sample_plugin.so
diff --git a/debian/rules b/debian/rules
index 9079d72ace2d..b51d9aaf03c6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,6 +36,7 @@ override_dh_auto_configure:
                --with-vtysh-pager=/usr/bin/pager \
                --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr \
                --with-moduledir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr/modules \
+               --with-pkgconfigdir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
                LIBTOOLFLAGS="-rpath /usr/lib/$(DEB_HOST_MULTIARCH)/frr" \
                --disable-dependency-tracking \
                \
@@ -77,8 +78,6 @@ execute_after_dh_auto_install:
 
        # drop dev-only files
        find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs 
rm -f
-       rm -rf debian/tmp/usr/include
-       rm -f debian/tmp/usr/lib/*/frr/pkgconfig/frr.pc
        rm -f debian/tmp/usr/lib/frr/ssd
 
        # drop test-tools files
-- 
2.53.0

Reply via email to