Blame SPECS/frr.spec

b57a21
%global frrversion	7.5.1
b57a21
%global frr_libdir /usr/libexec/frr
c0b7e4
c0b7e4
%global _hardened_build 1
b57a21
%global selinuxtype targeted
b57a21
%bcond_without selinux
c0b7e4
c0b7e4
Name: frr
b57a21
Version: 7.5.1
8cf488
Release: 7%{?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
1657d5
Source1: %{name}-tmpfiles.conf
b57a21
Source2: frr.fc
b57a21
Source3: frr.te
b57a21
Source4: frr.if
c0b7e4
BuildRequires: perl-generators
c0b7e4
BuildRequires: gcc
c0b7e4
BuildRequires: net-snmp-devel
1657d5
BuildRequires: texinfo libcap-devel 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
1657d5
BuildRequires: libyang-devel >= 1.0.184
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
b57a21
b57a21
%if 0%{?with_selinux}
b57a21
Requires: (%{name}-selinux = %{version}-%{release} if selinux-policy-%{selinuxtype})
b57a21
%endif
b57a21
c0b7e4
Provides: routingdaemon = %{version}-%{release}
1657d5
Obsoletes: frr-sysvinit quagga frr-contrib
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
Patch0006: 0006-CVE-2020-12831.patch
1657d5
Patch0007: 0007-frrinit.patch
b57a21
Patch0008: 0008-designated-router.patch
b57a21
Patch0009: 0009-routemap.patch
b57a21
Patch0010: 0010-moving-executables.patch
b57a21
Patch0011: 0011-reload-bfd-profile.patch
8cf488
Patch0012: 0012-graceful-restart.patch
8cf488
Patch0013: 0013-CVE-2022-37032.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
b57a21
%if 0%{?with_selinux}
b57a21
%package selinux
b57a21
Summary:       Selinux policy for FRR
b57a21
BuildArch:     noarch
b57a21
Requires:      selinux-policy-%{selinuxtype}
b57a21
Requires(post):        selinux-policy-%{selinuxtype}
b57a21
BuildRequires: selinux-policy-devel
b57a21
%{?selinux_requires}
b57a21
b57a21
%description selinux
b57a21
SELinux policy modules for FRR package
b57a21
b57a21
%endif
b57a21
c0b7e4
%prep
c0b7e4
%autosetup -S git
b57a21
#SELinux
b57a21
mkdir selinux
b57a21
cp -p %{SOURCE2} %{SOURCE3} %{SOURCE4} selinux
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 \
1657d5
    --enable-vty-group=frrvty \
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
b57a21
#SELinux policy
b57a21
%if 0%{?with_selinux}
b57a21
make -C selinux -f %{_datadir}/selinux/devel/Makefile %{name}.pp
b57a21
bzip2 -9 selinux/%{name}.pp
b57a21
%endif
b57a21
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
1657d5
mkdir -p %{buildroot}%{_tmpfilesdir}
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
1657d5
install -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
1657d5
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/tools/etc/frr/daemons %{buildroot}/etc/frr/daemons
1657d5
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/tools/frr.service %{buildroot}%{_unitdir}/frr.service
1657d5
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/frrinit.sh %{buildroot}%{frr_libdir}/frr
1657d5
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/frrcommon.sh %{buildroot}%{frr_libdir}/frrcommon.sh
1657d5
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/watchfrr.sh %{buildroot}%{frr_libdir}/watchfrr.sh
1657d5
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
b57a21
%if 0%{?with_selinux}
b57a21
install -D -m 644 selinux/%{name}.pp.bz2 \
b57a21
       %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
b57a21
install -D -m 644 selinux/%{name}.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/%{name}.if
b57a21
%endif
b57a21
c0b7e4
rm %{buildroot}%{_libdir}/frr/*.la
c0b7e4
rm %{buildroot}%{_libdir}/frr/modules/*.la
c0b7e4
1657d5
#Upstream does not maintain a stable API, these headers from -devel subpackage are no longer needed
1657d5
rm %{buildroot}%{_libdir}/frr/*.so
1657d5
rm -r %{buildroot}%{_includedir}/frr/
1657d5
c0b7e4
%pre
1657d5
getent group fttvty >/dev/null 2>&1 || groupadd -r frrvty >/dev/null 2>&1 || :
1657d5
getent group frr >/dev/null 2>&1 || groupadd -r frr >/dev/null 2>&1 || :
1657d5
getent passwd frr >/dev/null 2>&1 || useradd -M -r -g frr -s /sbin/nologin \
c0b7e4
 -c "FRRouting suite" -d %{_localstatedir}/run/frr frr || :
1657d5
usermod -aG frrvty frr
c0b7e4
c0b7e4
%post
b57a21
#Because we move files to /usr/libexec, we need to reload .service files as well
b57a21
/usr/bin/systemctl daemon-reload
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
1657d5
    echo 'no service integrated-vtysh-config' > %{_sysconfdir}/frr/vtysh.conf
c0b7e4
    chmod 640 %{_sysconfdir}/frr/vtysh.conf
1657d5
    chown frr:frrvty %{_sysconfdir}/frr/vtysh.conf
1657d5
fi
1657d5
1657d5
#Making sure that the old format of config file still works
1657d5
#Checking whether .rpmnew conf file is present - in that case I want to change the old config
1657d5
if [ -e %{_sysconfdir}/frr/daemons.rpmnew ]; then
1657d5
    sed -i s'/watchfrr_/#watchfrr_/g' %{_sysconfdir}/frr/daemons
1657d5
    sed -i s'/zebra=/#zebra=/g' %{_sysconfdir}/frr/daemons
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
b57a21
#SELinux
b57a21
%if 0%{?with_selinux}
b57a21
%pre selinux
b57a21
%selinux_relabel_pre -s %{selinuxtype}
b57a21
b57a21
%post selinux
b57a21
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
b57a21
%selinux_relabel_post -s %{selinuxtype}
b57a21
#/var/tmp and /var/run need to be relabeled as well if FRR is running before upgrade
8cf488
if [ $1 == 2 ]; then
8cf488
	%{_sbindir}/restorecon -R /var/tmp/frr &> /dev/null
8cf488
	%{_sbindir}/restorecon -R /var/run/frr &> /dev/null
8cf488
fi
b57a21
b57a21
%postun selinux
b57a21
if [ $1 -eq 0 ]; then
b57a21
    %selinux_modules_uninstall -s %{selinuxtype} %{name}
b57a21
    %selinux_relabel_post -s %{selinuxtype}
b57a21
fi
b57a21
b57a21
%endif
b57a21
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
1657d5
%dir %attr(740,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*/*
1657d5
%dir %{frr_libdir}/
c0b7e4
%{frr_libdir}/*
c0b7e4
%{_bindir}/*
c0b7e4
%dir %{_libdir}/frr
c0b7e4
%{_libdir}/frr/*.so.*
1657d5
%dir %{_libdir}/frr/modules/
c0b7e4
%{_libdir}/frr/modules/*
c0b7e4
%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr
1657d5
%config(noreplace) %attr(644,frr,frr) /etc/frr/daemons
c0b7e4
%config(noreplace) /etc/pam.d/frr
c0b7e4
%{_unitdir}/*.service
1657d5
%dir /usr/share/yang
c0b7e4
/usr/share/yang/*.yang
1657d5
%{_tmpfilesdir}/%{name}.conf
c0b7e4
b57a21
%if 0%{?with_selinux}
b57a21
%files selinux
b57a21
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.*
b57a21
%{_datadir}/selinux/devel/include/distributed/%{name}.if
b57a21
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
b57a21
%endif
b57a21
c0b7e4
%changelog
8cf488
* Wed Nov 30 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-7
8cf488
- Resolves: #2128737 - out-of-bounds read in the BGP daemon may lead to information disclosure or denial of service
8cf488
8cf488
* Tue Nov 29 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-6
8cf488
- Resolves: #1939516 - frr service cannot reload itself, due to executing in the wrong SELinux context
8cf488
8cf488
* Mon Nov 14 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-5
8cf488
- Resolves: #2127140 - Frr is unable to push routes to the system routing table
8cf488
8cf488
* Mon Nov 14 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-4
8cf488
- Resolves: #1948422 - BGP incorrectly withdraws routes on graceful restart capable routers
b57a21
b57a21
* Thu Aug 25 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-3
b57a21
- Resolves: #2054160 - FRR reloader does not disable BFD when unsetting BFD profile
b57a21
b57a21
* Wed Aug 24 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-2
b57a21
- Resolves: #1941765 - AVCs while running frr tests on RHEL 8.4.0 Beta-1.2
b57a21
- Resolves: #1714984 - SELinux policy (daemons) changes required for package
b57a21
b57a21
* Wed May 11 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-1
b57a21
- Resolves: #2018451 - Rebase of frr to version 7.5.1
b57a21
- Resolves: #1975361 - the dynamic routing setup does not work any more
b57a21
133c55
* Wed Jan 05 2022 Michal Ruprich <mruprich@redhat.com> - 7.5-11
133c55
- Resolves: #2034328 - Bfdd crash in metallb CI
17297e
133c55
* Tue Jan 04 2022 Michal Ruprich <mruprich@redhat.com> - 7.5-10
133c55
- Resolves: #2020878 - frr ospfd show ip ospf interface does not show designated router info
133c55
133c55
* Fri Dec 10 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-9
133c55
- Resolves: #2029958 - FRR reloader generating invalid BFD configurations, exits with error
133c55
133c55
* Tue Nov 16 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-8
133c55
- Resolves: #2021819 - Rebuilding for the new json-c
133c55
133c55
* Thu Sep 30 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-7
133c55
- Related: #1917269 - Wrong value in gating file
133c55
133c55
* Fri Sep 17 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-6
133c55
- Related: #1917269 - Incomplete patch, adding gating rules
133c55
133c55
* Thu Sep 16 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-5
133c55
- Resolves: #1979426 - Unable to configure OSPF in multi-instance mode
133c55
- Resolves: #1917269 - vtysh running-config output not showing bgp ttl-security hops option
17297e
1657d5
* Tue Jan 12 2021 root - 7.5-4
1657d5
- Related: #1889323 - Fixing start-up with old config file
1657d5
1657d5
* Mon Jan 11 2021 root - 7.5-3
1657d5
- Related: #1889323 - Reverting to non-integrated cofiguration
1657d5
1657d5
* Thu Jan 07 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-2
1657d5
- Related: #1889323 - Obsoleting frr-contrib
1657d5
1657d5
* Thu Jan 07 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-1
1657d5
- Resolves: #1889323 - [RFE] Rebase FRR to 7.5
1657d5
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