Blame SPECS/frr.spec

c0b7e4
%global frr_uid  92
c0b7e4
%global frr_gid  92
c0b7e4
%global vty_group   frrvty
c0b7e4
%global vty_gid     85
c0b7e4
%global frrversion	7.0
c0b7e4
%global frr_libdir /usr/lib/frr
c0b7e4
c0b7e4
%global _hardened_build 1
c0b7e4
c0b7e4
Name: frr
c0b7e4
Version: 7.0
715177
Release: 10%{?checkout}%{?dist}
c0b7e4
Summary: Routing daemon
c0b7e4
License: GPLv2+
c0b7e4
URL: http://www.frrouting.org
c0b7e4
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{frrversion}/%{name}-%{frrversion}.tar.gz
c0b7e4
BuildRequires: perl-generators
c0b7e4
BuildRequires: systemd
c0b7e4
BuildRequires: gcc
c0b7e4
BuildRequires: net-snmp-devel
c0b7e4
BuildRequires: texinfo libcap-devel texi2html autoconf automake libtool patch groff
c0b7e4
BuildRequires: readline readline-devel ncurses ncurses-devel
c0b7e4
BuildRequires: git pam-devel c-ares-devel
c0b7e4
BuildRequires: json-c-devel bison >= 2.7 flex perl-XML-LibXML
c0b7e4
BuildRequires: python3-devel python3-sphinx python3-pytest
c0b7e4
BuildRequires: systemd systemd-devel
c0b7e4
BuildRequires: libyang-devel
c0b7e4
Requires: net-snmp ncurses
c0b7e4
Requires(post): systemd /sbin/install-info
c0b7e4
Requires(preun): systemd /sbin/install-info
c0b7e4
Requires(postun): systemd
715177
Requires: iproute
715177
Requires: initscripts
c0b7e4
Provides: routingdaemon = %{version}-%{release}
c0b7e4
Obsoletes: frr-sysvinit quagga
c0b7e4
c0b7e4
Patch0000: 0000-remove-babeld-and-ldpd.patch
c0b7e4
Patch0001: 0001-use-python3.patch
c0b7e4
Patch0002: 0002-enable-openssl.patch
c0b7e4
Patch0003: 0003-disable-eigrp-crypto.patch
c0b7e4
Patch0004: 0004-fips-mode.patch
715177
Patch0005: 0005-igmp-trusted-query.patch
715177
Patch0006: 0006-CVE-2020-12831.patch
715177
Patch0007: 0007-bfd-port-range.patch
c0b7e4
c0b7e4
%description
c0b7e4
FRRouting is free software that manages TCP/IP based routing protocols. It takes
c0b7e4
a multi-server and multi-threaded approach to resolve the current complexity
c0b7e4
of the Internet.
c0b7e4
c0b7e4
FRRouting supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, NHRP, PBR, EIGRP and BFD.
c0b7e4
c0b7e4
FRRouting is a fork of Quagga.
c0b7e4
c0b7e4
%package contrib
c0b7e4
Summary: Contrib tools for frr
c0b7e4
Requires: %{name}%{?_isa} = %{version}-%{release}
c0b7e4
c0b7e4
%description contrib
c0b7e4
Contributed/3rd party tools which may be of use with frr.
c0b7e4
c0b7e4
%package devel
c0b7e4
Summary: Header and object files for frr development
c0b7e4
Requires: %{name}%{?_isa} = %{version}-%{release}
c0b7e4
c0b7e4
%description devel
c0b7e4
The frr-devel package contains the header and object files necessary for
c0b7e4
developing OSPF-API and frr applications.
c0b7e4
c0b7e4
%prep
c0b7e4
%autosetup -S git
c0b7e4
c0b7e4
%build
c0b7e4
autoreconf -ivf
c0b7e4
c0b7e4
%configure \
c0b7e4
    --sbindir=%{frr_libdir} \
c0b7e4
    --sysconfdir=%{_sysconfdir}/frr \
c0b7e4
    --libdir=%{_libdir}/frr \
c0b7e4
    --libexecdir=%{_libexecdir}/frr \
c0b7e4
    --localstatedir=%{_localstatedir}/run/frr \
c0b7e4
    --enable-snmp=agentx \
c0b7e4
    --enable-multipath=64 \
c0b7e4
    --enable-vtysh=yes \
c0b7e4
    --enable-ospfclient=no \
c0b7e4
    --enable-ospfapi=no \
c0b7e4
    --enable-user=frr \
c0b7e4
    --enable-group=frr \
c0b7e4
    --enable-vty-group=%vty_group \
c0b7e4
    --enable-rtadv \
c0b7e4
    --disable-exampledir \
c0b7e4
    --enable-systemd=yes \
c0b7e4
    --enable-static=no \
c0b7e4
    --disable-ldpd \
c0b7e4
    --disable-babeld \
c0b7e4
    --with-moduledir=%{_libdir}/frr/modules \
c0b7e4
    --with-crypto=openssl \
c0b7e4
    --enable-fpm
c0b7e4
c0b7e4
%make_build MAKEINFO="makeinfo --no-split" PYTHON=%{__python3}
c0b7e4
c0b7e4
pushd doc
c0b7e4
make info
c0b7e4
popd
c0b7e4
c0b7e4
%install
c0b7e4
mkdir -p %{buildroot}/etc/{frr,rc.d/init.d,sysconfig,logrotate.d,pam.d,default} \
c0b7e4
         %{buildroot}/var/log/frr %{buildroot}%{_infodir} \
c0b7e4
         %{buildroot}%{_unitdir}
c0b7e4
c0b7e4
mkdir -p -m 0755 %{buildroot}%{_libdir}/frr
c0b7e4
c0b7e4
%make_install
c0b7e4
c0b7e4
# Remove this file, as it is uninstalled and causes errors when building on RH9
c0b7e4
rm -rf %{buildroot}/usr/share/info/dir
c0b7e4
c0b7e4
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/daemons %{buildroot}/etc/frr/daemons
c0b7e4
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.service %{buildroot}%{_unitdir}/frr.service
c0b7e4
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/redhat/frr.init %{buildroot}%{frr_libdir}/frr
c0b7e4
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.logrotate %{buildroot}/etc/logrotate.d/frr
c0b7e4
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.pam %{buildroot}/etc/pam.d/frr
c0b7e4
install -d -m 775 %{buildroot}/run/frr
c0b7e4
c0b7e4
rm %{buildroot}%{_libdir}/frr/*.la
c0b7e4
rm %{buildroot}%{_libdir}/frr/modules/*.la
c0b7e4
c0b7e4
%pre
c0b7e4
getent group %vty_group >/dev/null 2>&1 || groupadd -r %vty_group >/dev/null 2>&1 || :
c0b7e4
getent group frr >/dev/null 2>&1 || groupadd -g frr >/dev/null 2>&1 || :
c0b7e4
getent passwd frr >/dev/null 2>&1 || useradd -M -r -s /sbin/nologin \
c0b7e4
 -c "FRRouting suite" -d %{_localstatedir}/run/frr frr || :
c0b7e4
usermod -aG %vty_group frr
c0b7e4
c0b7e4
%post
c0b7e4
%systemd_post frr.service
c0b7e4
c0b7e4
if [ -f %{_infodir}/%{name}.inf* ]; then
c0b7e4
    install-info %{_infodir}/frr.info %{_infodir}/dir || :
c0b7e4
fi
c0b7e4
c0b7e4
# Create dummy files if they don't exist so basic functions can be used.
c0b7e4
if [ ! -e %{_sysconfdir}/frr/zebra.conf ]; then
c0b7e4
    echo "hostname `hostname`" > %{_sysconfdir}/frr/zebra.conf
c0b7e4
    chown frr:frr %{_sysconfdir}/frr/zebra.conf
c0b7e4
    chmod 640 %{_sysconfdir}/frr/zebra.conf
c0b7e4
fi
c0b7e4
c0b7e4
if [ ! -e %{_sysconfdir}/frr/vtysh.conf ]; then
c0b7e4
    touch %{_sysconfdir}/frr/vtysh.conf
c0b7e4
    chmod 640 %{_sysconfdir}/frr/vtysh.conf
c0b7e4
    chown frr:%{vty_group} %{_sysconfdir}/frr/vtysh.conf
c0b7e4
fi
c0b7e4
c0b7e4
%postun
c0b7e4
%systemd_postun_with_restart frr.service
c0b7e4
c0b7e4
#only when removing the package
c0b7e4
if [ $1 -ge 0 ]; then 
c0b7e4
	if [ -f %{_infodir}/%{name}.inf* ]; then
c0b7e4
    	install-info --delete %{_infodir}/frr.info %{_infodir}/dir || :
c0b7e4
	fi
c0b7e4
fi
c0b7e4
c0b7e4
%preun
c0b7e4
%systemd_preun frr.service
c0b7e4
c0b7e4
%check
c0b7e4
make check PYTHON=%{__python3}
c0b7e4
c0b7e4
%files
c0b7e4
%defattr(-,root,root)
c0b7e4
%license COPYING
c0b7e4
%doc zebra/zebra.conf.sample
c0b7e4
%doc isisd/isisd.conf.sample
c0b7e4
%doc ripd/ripd.conf.sample
c0b7e4
%doc bgpd/bgpd.conf.sample*
c0b7e4
%doc ospfd/ospfd.conf.sample
c0b7e4
%doc ospf6d/ospf6d.conf.sample
c0b7e4
%doc ripngd/ripngd.conf.sample
c0b7e4
%doc pimd/pimd.conf.sample
c0b7e4
%doc doc/mpls
c0b7e4
%dir %attr(755,frr,frr) %{_sysconfdir}/frr
c0b7e4
%dir %attr(755,frr,frr) /var/log/frr
c0b7e4
%dir %attr(755,frr,frr) /run/frr
c0b7e4
%{_infodir}/*info*
c0b7e4
%{_mandir}/man*/*
c0b7e4
%{frr_libdir}/*
c0b7e4
%{_bindir}/*
c0b7e4
%dir %{_libdir}/frr
c0b7e4
%{_libdir}/frr/*.so.*
c0b7e4
%{_libdir}/frr/modules/*
c0b7e4
%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr
c0b7e4
%config(noreplace) /etc/frr/daemons
c0b7e4
%config(noreplace) /etc/pam.d/frr
c0b7e4
%{_unitdir}/*.service
c0b7e4
/usr/share/yang/*.yang
c0b7e4
#%%{_libdir}/frr/frr/libyang_plugins/*
c0b7e4
c0b7e4
%files contrib
c0b7e4
%defattr(-,root,root)
c0b7e4
%doc COPYING
c0b7e4
%doc %attr(0644,root,root) tools/frrinit.sh
c0b7e4
%doc %attr(0644,root,root) tools/watchfrr.sh
c0b7e4
%doc %attr(0644,root,root) tools/zebra.el
c0b7e4
%doc %attr(0644,root,root) tools/rrcheck.pl
c0b7e4
%doc %attr(0644,root,root) tools/rrlookup.pl
c0b7e4
c0b7e4
%files devel
c0b7e4
%defattr(-,root,root)
c0b7e4
%doc COPYING
c0b7e4
%dir %{_libdir}/frr/
c0b7e4
%{_libdir}/frr/*.so
c0b7e4
%dir %{_includedir}/frr
c0b7e4
%{_includedir}/frr/*.h
c0b7e4
%dir %{_includedir}/frr/ospfd
c0b7e4
%{_includedir}/frr/ospfd/*.h
c0b7e4
%dir %{_includedir}/frr/eigrpd
c0b7e4
%{_includedir}/frr/eigrpd/*.h
c0b7e4
c0b7e4
%changelog
715177
* Thu Aug 20 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-10
715177
- Resolves: #1867793 - FRR does not conform to the source port range specified in RFC5881
715177
715177
* Thu Aug 20 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-9
715177
- Resolves: #1852476 - default permission issue eases information leaks
715177
715177
* Tue May 05 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-8
715177
- Resolves: #1819319 - frr fails to start start if the initscripts package is missing
715177
715177
* Mon May 04 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-7
715177
- Resolves: #1758544 - IGMPv3 queries may lead to DoS
715177
715177
* Tue Mar 10 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-6
715177
- Resolves: #1776342 - frr has missing dependency on iproute
715177
c0b7e4
* Tue Sep 03 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-5
c0b7e4
- Resolves: #1719465 - Removal of component Frr or its crypto
c0b7e4
c0b7e4
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-4
c0b7e4
- Related: #1657029 - frr-contrib is back, it is breaking the rpmdeplint test
c0b7e4
c0b7e4
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-3
c0b7e4
- Related: #1657029 - more cleanup, removed frr-contrib, frrvt changed to frrvty
c0b7e4
c0b7e4
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-2
c0b7e4
- Related: #1657029 - cleaning specfile, adding Requires on libyang-devel
c0b7e4
c0b7e4
* Wed May 29 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-1
c0b7e4
- Resolves: #1657029 - Add FRR as a replacement of Quagga in RHEL 8