Skip to content

Commit

Permalink
redhat: Add option to build pkg with grpc support
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Winter <[email protected]>
  • Loading branch information
mwinter-osr committed Jun 20, 2024
1 parent 17fdfe9 commit a761db8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 14 deletions.
31 changes: 17 additions & 14 deletions doc/developer/packaging-redhat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,27 @@ Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24.

############### FRRouting (FRR) configure options #################
# with-feature options
%{!?with_pam: %global with_pam 0 }
%{!?with_ospfclient: %global with_ospfclient 1 }
%{!?with_ospfapi: %global with_ospfapi 1 }
%{!?with_irdp: %global with_irdp 1 }
%{!?with_rtadv: %global with_rtadv 1 }
%{!?with_babeld: %global with_babeld 1 }
%{!?with_bfdd: %global with_bfdd 1 }
%{!?with_bgp_vnc: %global with_bgp_vnc 0 }
%{!?with_cumulus: %global with_cumulus 0 }
%{!?with_eigrpd: %global with_eigrpd 1 }
%{!?with_fpm: %global with_fpm 1 }
%{!?with_mgmtd_test_be_client: %global with_mgmtd_test_be_client 0 }
%{!?with_ldpd: %global with_ldpd 1 }
%{!?with_nhrpd: %global with_nhrpd 1 }
%{!?with_eigrp: %global with_eigrpd 1 }
%{!?with_shared: %global with_shared 1 }
%{!?with_multipath: %global with_multipath 256 }
%{!?frr_user: %global frr_user frr }
%{!?vty_group: %global vty_group frrvty }
%{!?with_fpm: %global with_fpm 0 }
%{!?with_watchfrr: %global with_watchfrr 1 }
%{!?with_bgp_vnc: %global with_bgp_vnc 0 }
%{!?with_nhrpd: %global with_nhrpd 1 }
%{!?with_ospfapi: %global with_ospfapi 1 }
%{!?with_ospfclient: %global with_ospfclient 1 }
%{!?with_pam: %global with_pam 0 }
%{!?with_pbrd: %global with_pbrd 1 }
%{!?with_pimd: %global with_pimd 1 }
%{!?with_pim6d: %global with_pim6d 1 }
%{!?with_rpki: %global with_rpki 0 }
%{!?with_vrrpd: %global with_vrrpd 1 }
%{!?with_rtadv: %global with_rtadv 1 }
%{!?with_watchfrr: %global with_watchfrr 1 }
%{!?with_pathd: %global with_pathd 1 }
%{!?with_grpc: %global with_grpc 0 }

8. Build the RPM::

Expand Down
29 changes: 29 additions & 0 deletions redhat/frr.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
%{!?with_rtadv: %global with_rtadv 1 }
%{!?with_watchfrr: %global with_watchfrr 1 }
%{!?with_pathd: %global with_pathd 1 }
%{!?with_grpc: %global with_grpc 0 }

# user and group
%{!?frr_user: %global frr_user frr }
Expand Down Expand Up @@ -201,6 +202,12 @@ BuildRequires: python3-devel
BuildRequires: python3-sphinx
%endif
%endif
%if %{with_grpc}
BuildRequires: grpc-devel >= 1.16.1
BuildRequires: protobuf-devel >= 3.6.1
BuildRequires: protobuf-compiler >= 3.6.1
BuildRequires: protobuf-c-devel
%endif
%if 0%{?rhel} > 7
#platform-python-devel is needed for /usr/bin/pathfix.py
BuildRequires: platform-python-devel
Expand Down Expand Up @@ -301,6 +308,17 @@ through the AgentX protocol. Provides read-only access to current
routing state through standard SNMP MIBs.


%if %{with_grpc}
%package grpc
Summary: GRPC support for FRR daemons
Group: System Environment/Daemons
License: GPLv3+
Requires: %{name} = %{version}-%{release}

%description grpc
Adds GRPC support to the individual FRR daemons.
%endif

%prep
%setup -q -n frr-%{frrversion}

Expand Down Expand Up @@ -424,6 +442,11 @@ routing state through standard SNMP MIBs.
--enable-pathd \
%else
--disable-pathd \
%endif
%if %{with_grpc}
--enable-grpc \
%else
--disable-grpc \
%endif
--enable-snmp
# end
Expand Down Expand Up @@ -783,6 +806,12 @@ sed -i 's/ -M rpki//' %{_sysconfdir}/frr/daemons
%{_libdir}/frr/modules/*snmp.so


%if %{with_grpc}
%files grpc
%{_libdir}/libfrrgrpc_pb.*
%{_libdir}/frr/modules/grpc.so
%endif

%files devel
%{_libdir}/lib*.so
%dir %{_includedir}/%{name}
Expand Down

0 comments on commit a761db8

Please sign in to comment.