Skip to content

Commit

Permalink
redhat: Add option to build pkg without docs and rpki support
Browse files Browse the repository at this point in the history
Signed-off-by: Lou Berger <[email protected]>
  • Loading branch information
louberger committed Jan 8, 2025
1 parent 21fe1f4 commit 4fc0975
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions redhat/frr.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
%{!?with_watchfrr: %global with_watchfrr 1 }
%{!?with_pathd: %global with_pathd 1 }
%{!?with_grpc: %global with_grpc 0 }
%{!?with_rpki: %global with_rpki 1 }
%{!?with_docs: %global with_docs 1 }

# user and group
%{!?frr_user: %global frr_user frr }
Expand Down Expand Up @@ -193,16 +195,22 @@ BuildRequires: pcre2-devel
%if 0%{?rhel} && 0%{?rhel} < 7
#python27-devel is available from ius community repo for RedHat/CentOS 6
BuildRequires: python27-devel
%if %{with_docs}
BuildRequires: python27-sphinx
%endif
%else
%if %{use_python2}
BuildRequires: python-devel >= 2.7
%if %{with_docs}
BuildRequires: python-sphinx
%endif
%else
BuildRequires: python3-devel
%if %{with_docs}
BuildRequires: python3-sphinx
%endif
%endif
%endif
%if %{with_grpc}
BuildRequires: grpc-devel >= 1.16.1
BuildRequires: protobuf-devel >= 3.6.1
Expand Down Expand Up @@ -283,6 +291,7 @@ The frr-devel package contains the header and object files necessary for
developing OSPF-API and frr applications.


%if %{with_rpki}
%package rpki-rtrlib
Summary: BGP RPKI support (rtrlib)
Group: System Environment/Daemons
Expand All @@ -295,6 +304,7 @@ against cryptographic information stored in WHOIS databases. This is
used to prevent hijacking of networks on the wider internet. It is only
relevant to internet service providers using their own autonomous system
number.
%endif


%package snmp
Expand Down Expand Up @@ -433,7 +443,9 @@ Adds GRPC support to the individual FRR daemons.
--disable-bgp-vnc \
%endif
--enable-isisd \
%if %{with_rpki}
--enable-rpki \
%endif
%if %{with_bfdd}
--enable-bfdd \
%else
Expand Down Expand Up @@ -465,9 +477,11 @@ sed -e '1c #!/usr/bin/python3' -i %{zeb_src}/tools/frr-reload.py
sed -e '1c #!/usr/bin/python3' -i %{zeb_src}/tools/generate_support_bundle.py
%endif

%if %{with_docs}
pushd doc
make info
popd
%endif


%install
Expand Down Expand Up @@ -605,7 +619,9 @@ zebra_spec_add_service fabricd 2618/tcp "Fabricd vty"
%__sed -i 's|watchfrr_enable=no|watchfrr_enable=yes|g' %{configdir}/daemons 2> /dev/null || true
%endif

%if %{with_docs}
/sbin/install-info %{_infodir}/frr.info.gz %{_infodir}/dir
%endif

# Create dummy config file if they don't exist so basic functions can be used.
if [ ! -e %{configdir}/frr.conf ] && [ ! -e %{configdir}/zebra.conf ]; then
Expand Down Expand Up @@ -673,7 +689,9 @@ fi
/sbin/chkconfig --del frr
fi
%endif
%if %{with_docs}
/sbin/install-info --delete %{_infodir}/frr.info.gz %{_infodir}/dir
%endif


%files
Expand All @@ -690,8 +708,10 @@ fi
%dir %attr(755,root,root) %{_localstatedir}/log/frr
%dir %attr(750,root,root) %{_runstatedir}/frr
%endif
%if %{with_docs}
%{_infodir}/frr.info.gz
%{_mandir}/man*/*
%endif
%{_sbindir}/zebra
%{_sbindir}/staticd
%{_sbindir}/ospfd
Expand Down Expand Up @@ -752,6 +772,7 @@ fi
%{_libdir}/frr/modules/bgpd_bmp.so
%{_libdir}/libfrr_pb.so*
%{_libdir}/libfrrfpm_pb.so*
%{_libdir}/libfrrzmq.so*
%{_libdir}/libmgmt_be_nb.so*
%{_bindir}/*
%config(noreplace) %{configdir}/[!v]*.conf*
Expand Down Expand Up @@ -791,6 +812,7 @@ fi
%endif


%if %{with_rpki}
%post rpki-rtrlib
# add rpki module to daemons
sed -i -e 's/^\(bgpd_options=\)\(.*\)\(".*\)/\1\2 -M rpki\3/' %{_sysconfdir}/frr/daemons
Expand All @@ -801,6 +823,7 @@ sed -i 's/ -M rpki//' %{_sysconfdir}/frr/daemons

%files rpki-rtrlib
%{_libdir}/frr/modules/bgpd_rpki.so
%endif


%files snmp
Expand Down

0 comments on commit 4fc0975

Please sign in to comment.