Blame SPECS/frr.spec

dfe9c0
%global frrversion	7.5.1
dfe9c0
%global frr_libdir /usr/libexec/frr
e092ad
e092ad
%global _hardened_build 1
dfe9c0
%global selinuxtype targeted
dfe9c0
%bcond_without selinux
e092ad
e092ad
Name: frr
dfe9c0
Version: 7.5.1
10e54d
Release: 7%{?checkout}%{?dist}
e092ad
Summary: Routing daemon
e092ad
License: GPLv2+
e092ad
URL: http://www.frrouting.org
e092ad
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{frrversion}/%{name}-%{frrversion}.tar.gz
ce3795
Source1: %{name}-tmpfiles.conf
dfe9c0
Source2: frr.fc
dfe9c0
Source3: frr.te
dfe9c0
Source4: frr.if
e092ad
BuildRequires: perl-generators
e092ad
BuildRequires: gcc
e092ad
BuildRequires: net-snmp-devel
ce3795
BuildRequires: texinfo libcap-devel autoconf automake libtool patch groff
e092ad
BuildRequires: readline readline-devel ncurses ncurses-devel
e092ad
BuildRequires: git pam-devel c-ares-devel
e092ad
BuildRequires: json-c-devel bison >= 2.7 flex perl-XML-LibXML
e092ad
BuildRequires: python3-devel python3-sphinx python3-pytest
e092ad
BuildRequires: systemd systemd-devel
ce3795
BuildRequires: libyang-devel >= 1.0.184
4d1074
Requires: net-snmp ncurses
e092ad
Requires(post): systemd /sbin/install-info
e092ad
Requires(preun): systemd /sbin/install-info
e092ad
Requires(postun): systemd
23b54f
Requires: iproute
23b54f
Requires: initscripts
dfe9c0
dfe9c0
%if 0%{?with_selinux}
10e54d
Requires: (%{name}-selinux = %{version}-%{release} if selinux-policy-%{selinuxtype})
dfe9c0
%endif
dfe9c0
e092ad
Provides: routingdaemon = %{version}-%{release}
ce3795
Obsoletes: frr-sysvinit quagga frr-contrib
e092ad
e092ad
Patch0000: 0000-remove-babeld-and-ldpd.patch
e092ad
Patch0001: 0001-use-python3.patch
4d1074
Patch0002: 0002-enable-openssl.patch
4d1074
Patch0003: 0003-disable-eigrp-crypto.patch
4d1074
Patch0004: 0004-fips-mode.patch
ce3795
Patch0006: 0006-CVE-2020-12831.patch
ce3795
Patch0007: 0007-frrinit.patch
dfe9c0
Patch0008: 0008-designated-router.patch
dfe9c0
Patch0009: 0009-routemap.patch
dfe9c0
Patch0010: 0010-moving-executables.patch
dfe9c0
Patch0011: 0011-reload-bfd-profile.patch
10e54d
Patch0012: 0012-graceful-restart.patch
10e54d
Patch0013: 0013-CVE-2022-37032.patch
e092ad
e092ad
%description
e092ad
FRRouting is free software that manages TCP/IP based routing protocols. It takes
e092ad
a multi-server and multi-threaded approach to resolve the current complexity
e092ad
of the Internet.
e092ad
e092ad
FRRouting supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, NHRP, PBR, EIGRP and BFD.
e092ad
e092ad
FRRouting is a fork of Quagga.
e092ad
dfe9c0
%if 0%{?with_selinux}
dfe9c0
%package selinux
dfe9c0
Summary:       Selinux policy for FRR
dfe9c0
BuildArch:     noarch
dfe9c0
Requires:      selinux-policy-%{selinuxtype}
dfe9c0
Requires(post):        selinux-policy-%{selinuxtype}
dfe9c0
BuildRequires: selinux-policy-devel
dfe9c0
%{?selinux_requires}
dfe9c0
dfe9c0
%description selinux
dfe9c0
SELinux policy modules for FRR package
dfe9c0
dfe9c0
%endif
dfe9c0
e092ad
%prep
e092ad
%autosetup -S git
dfe9c0
#SELinux
dfe9c0
mkdir selinux
dfe9c0
cp -p %{SOURCE2} %{SOURCE3} %{SOURCE4} selinux
e092ad
e092ad
%build
e092ad
autoreconf -ivf
e092ad
e092ad
%configure \
e092ad
    --sbindir=%{frr_libdir} \
e092ad
    --sysconfdir=%{_sysconfdir}/frr \
e092ad
    --libdir=%{_libdir}/frr \
e092ad
    --libexecdir=%{_libexecdir}/frr \
e092ad
    --localstatedir=%{_localstatedir}/run/frr \
e092ad
    --enable-snmp=agentx \
e092ad
    --enable-multipath=64 \
e092ad
    --enable-vtysh=yes \
e092ad
    --enable-ospfclient=no \
e092ad
    --enable-ospfapi=no \
e092ad
    --enable-user=frr \
e092ad
    --enable-group=frr \
ce3795
    --enable-vty-group=frrvty \
e092ad
    --enable-rtadv \
e092ad
    --disable-exampledir \
e092ad
    --enable-systemd=yes \
e092ad
    --enable-static=no \
e092ad
    --disable-ldpd \
e092ad
    --disable-babeld \
e092ad
    --with-moduledir=%{_libdir}/frr/modules \
4d1074
    --with-crypto=openssl \
e092ad
    --enable-fpm
e092ad
e092ad
%make_build MAKEINFO="makeinfo --no-split" PYTHON=%{__python3}
e092ad
e092ad
pushd doc
e092ad
make info
e092ad
popd
e092ad
dfe9c0
#SELinux policy
dfe9c0
%if 0%{?with_selinux}
dfe9c0
make -C selinux -f %{_datadir}/selinux/devel/Makefile %{name}.pp
dfe9c0
bzip2 -9 selinux/%{name}.pp
dfe9c0
%endif
dfe9c0
e092ad
%install
e092ad
mkdir -p %{buildroot}/etc/{frr,rc.d/init.d,sysconfig,logrotate.d,pam.d,default} \
e092ad
         %{buildroot}/var/log/frr %{buildroot}%{_infodir} \
e092ad
         %{buildroot}%{_unitdir}
e092ad
e092ad
mkdir -p -m 0755 %{buildroot}%{_libdir}/frr
ce3795
mkdir -p %{buildroot}%{_tmpfilesdir}
e092ad
e092ad
%make_install
e092ad
e092ad
# Remove this file, as it is uninstalled and causes errors when building on RH9
e092ad
rm -rf %{buildroot}/usr/share/info/dir
e092ad
ce3795
install -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
ce3795
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/tools/etc/frr/daemons %{buildroot}/etc/frr/daemons
ce3795
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/tools/frr.service %{buildroot}%{_unitdir}/frr.service
ce3795
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/frrinit.sh %{buildroot}%{frr_libdir}/frr
ce3795
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/frrcommon.sh %{buildroot}%{frr_libdir}/frrcommon.sh
ce3795
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/watchfrr.sh %{buildroot}%{frr_libdir}/watchfrr.sh
ce3795
e092ad
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.logrotate %{buildroot}/etc/logrotate.d/frr
e092ad
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.pam %{buildroot}/etc/pam.d/frr
e092ad
install -d -m 775 %{buildroot}/run/frr
e092ad
dfe9c0
%if 0%{?with_selinux}
dfe9c0
install -D -m 644 selinux/%{name}.pp.bz2 \
dfe9c0
       %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
dfe9c0
install -D -m 644 selinux/%{name}.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/%{name}.if
dfe9c0
%endif
dfe9c0
e092ad
rm %{buildroot}%{_libdir}/frr/*.la
e092ad
rm %{buildroot}%{_libdir}/frr/modules/*.la
e092ad
ce3795
#Upstream does not maintain a stable API, these headers from -devel subpackage are no longer needed
ce3795
rm %{buildroot}%{_libdir}/frr/*.so
ce3795
rm -r %{buildroot}%{_includedir}/frr/
ce3795
e092ad
%pre
ce3795
getent group fttvty >/dev/null 2>&1 || groupadd -r frrvty >/dev/null 2>&1 || :
ce3795
getent group frr >/dev/null 2>&1 || groupadd -r frr >/dev/null 2>&1 || :
ce3795
getent passwd frr >/dev/null 2>&1 || useradd -M -r -g frr -s /sbin/nologin \
e092ad
 -c "FRRouting suite" -d %{_localstatedir}/run/frr frr || :
ce3795
usermod -aG frrvty frr
e092ad
e092ad
%post
dfe9c0
#Because we move files to /usr/libexec, we need to reload .service files as well
dfe9c0
/usr/bin/systemctl daemon-reload
e092ad
%systemd_post frr.service
e092ad
e092ad
if [ -f %{_infodir}/%{name}.inf* ]; then
e092ad
    install-info %{_infodir}/frr.info %{_infodir}/dir || :
e092ad
fi
e092ad
e092ad
# Create dummy files if they don't exist so basic functions can be used.
e092ad
if [ ! -e %{_sysconfdir}/frr/zebra.conf ]; then
e092ad
    echo "hostname `hostname`" > %{_sysconfdir}/frr/zebra.conf
e092ad
    chown frr:frr %{_sysconfdir}/frr/zebra.conf
e092ad
    chmod 640 %{_sysconfdir}/frr/zebra.conf
e092ad
fi
e092ad
e092ad
if [ ! -e %{_sysconfdir}/frr/vtysh.conf ]; then
ce3795
    echo 'no service integrated-vtysh-config' > %{_sysconfdir}/frr/vtysh.conf
e092ad
    chmod 640 %{_sysconfdir}/frr/vtysh.conf
ce3795
    chown frr:frrvty %{_sysconfdir}/frr/vtysh.conf
ce3795
fi
ce3795
ce3795
#Making sure that the old format of config file still works
ce3795
#Checking whether .rpmnew conf file is present - in that case I want to change the old config
ce3795
if [ -e %{_sysconfdir}/frr/daemons.rpmnew ]; then
ce3795
    sed -i s'/watchfrr_/#watchfrr_/g' %{_sysconfdir}/frr/daemons
ce3795
    sed -i s'/zebra=/#zebra=/g' %{_sysconfdir}/frr/daemons
e092ad
fi
e092ad
e092ad
%postun
e092ad
%systemd_postun_with_restart frr.service
e092ad
e092ad
#only when removing the package
e092ad
if [ $1 -ge 0 ]; then 
e092ad
	if [ -f %{_infodir}/%{name}.inf* ]; then
e092ad
    	install-info --delete %{_infodir}/frr.info %{_infodir}/dir || :
e092ad
	fi
e092ad
fi
e092ad
e092ad
%preun
e092ad
%systemd_preun frr.service
e092ad
dfe9c0
#SELinux
dfe9c0
%if 0%{?with_selinux}
dfe9c0
%pre selinux
dfe9c0
%selinux_relabel_pre -s %{selinuxtype}
dfe9c0
dfe9c0
%post selinux
dfe9c0
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
dfe9c0
%selinux_relabel_post -s %{selinuxtype}
dfe9c0
#/var/tmp and /var/run need to be relabeled as well if FRR is running before upgrade
10e54d
if [ $1 == 2 ]; then
10e54d
	%{_sbindir}/restorecon -R /var/tmp/frr &> /dev/null
10e54d
	%{_sbindir}/restorecon -R /var/run/frr &> /dev/null
10e54d
fi
dfe9c0
dfe9c0
%postun selinux
dfe9c0
if [ $1 -eq 0 ]; then
dfe9c0
    %selinux_modules_uninstall -s %{selinuxtype} %{name}
dfe9c0
    %selinux_relabel_post -s %{selinuxtype}
dfe9c0
fi
dfe9c0
dfe9c0
%endif
dfe9c0
e092ad
%check
e092ad
make check PYTHON=%{__python3}
e092ad
e092ad
%files
e092ad
%defattr(-,root,root)
e092ad
%license COPYING
e092ad
%doc zebra/zebra.conf.sample
e092ad
%doc isisd/isisd.conf.sample
e092ad
%doc ripd/ripd.conf.sample
e092ad
%doc bgpd/bgpd.conf.sample*
e092ad
%doc ospfd/ospfd.conf.sample
e092ad
%doc ospf6d/ospf6d.conf.sample
e092ad
%doc ripngd/ripngd.conf.sample
e092ad
%doc pimd/pimd.conf.sample
e092ad
%doc doc/mpls
ce3795
%dir %attr(740,frr,frr) %{_sysconfdir}/frr
e092ad
%dir %attr(755,frr,frr) /var/log/frr
e092ad
%dir %attr(755,frr,frr) /run/frr
e092ad
%{_infodir}/*info*
e092ad
%{_mandir}/man*/*
ce3795
%dir %{frr_libdir}/
e092ad
%{frr_libdir}/*
e092ad
%{_bindir}/*
e092ad
%dir %{_libdir}/frr
e092ad
%{_libdir}/frr/*.so.*
ce3795
%dir %{_libdir}/frr/modules/
e092ad
%{_libdir}/frr/modules/*
e092ad
%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr
ce3795
%config(noreplace) %attr(644,frr,frr) /etc/frr/daemons
e092ad
%config(noreplace) /etc/pam.d/frr
e092ad
%{_unitdir}/*.service
ce3795
%dir /usr/share/yang
e092ad
/usr/share/yang/*.yang
ce3795
%{_tmpfilesdir}/%{name}.conf
e092ad
dfe9c0
%if 0%{?with_selinux}
dfe9c0
%files selinux
dfe9c0
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.*
dfe9c0
%{_datadir}/selinux/devel/include/distributed/%{name}.if
dfe9c0
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
dfe9c0
%endif
dfe9c0
e092ad
%changelog
10e54d
* Wed Nov 30 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-7
10e54d
- Resolves: #2128737 - out-of-bounds read in the BGP daemon may lead to information disclosure or denial of service
10e54d
10e54d
* Tue Nov 29 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-6
10e54d
- Resolves: #1939516 - frr service cannot reload itself, due to executing in the wrong SELinux context
10e54d
10e54d
* Mon Nov 14 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-5
10e54d
- Resolves: #2127140 - Frr is unable to push routes to the system routing table
10e54d
10e54d
* Mon Nov 14 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-4
10e54d
- Resolves: #1948422 - BGP incorrectly withdraws routes on graceful restart capable routers
10e54d
dfe9c0
* Thu Aug 25 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-3
dfe9c0
- Resolves: #2054160 - FRR reloader does not disable BFD when unsetting BFD profile
dfe9c0
dfe9c0
* Wed Aug 24 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-2
dfe9c0
- Resolves: #1941765 - AVCs while running frr tests on RHEL 8.4.0 Beta-1.2
dfe9c0
- Resolves: #1714984 - SELinux policy (daemons) changes required for package
dfe9c0
dfe9c0
* Wed May 11 2022 Michal Ruprich <mruprich@redhat.com> - 7.5.1-1
dfe9c0
- Resolves: #2018451 - Rebase of frr to version 7.5.1
dfe9c0
- Resolves: #1975361 - the dynamic routing setup does not work any more
dfe9c0
caebb1
* Wed Jan 05 2022 Michal Ruprich <mruprich@redhat.com> - 7.5-11
caebb1
- Resolves: #2034328 - Bfdd crash in metallb CI
caebb1
caebb1
* Tue Jan 04 2022 Michal Ruprich <mruprich@redhat.com> - 7.5-10
caebb1
- Resolves: #2020878 - frr ospfd show ip ospf interface does not show designated router info
caebb1
caebb1
* Fri Dec 10 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-9
caebb1
- Resolves: #2029958 - FRR reloader generating invalid BFD configurations, exits with error
caebb1
caebb1
* Tue Nov 16 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-8
caebb1
- Resolves: #2021819 - Rebuilding for the new json-c
caebb1
caebb1
* Thu Sep 30 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-7
caebb1
- Related: #1917269 - Wrong value in gating file
caebb1
caebb1
* Fri Sep 17 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-6
caebb1
- Related: #1917269 - Incomplete patch, adding gating rules
caebb1
caebb1
* Thu Sep 16 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-5
caebb1
- Resolves: #1979426 - Unable to configure OSPF in multi-instance mode
caebb1
- Resolves: #1917269 - vtysh running-config output not showing bgp ttl-security hops option
caebb1
ce3795
* Tue Jan 12 2021 root - 7.5-4
ce3795
- Related: #1889323 - Fixing start-up with old config file
ce3795
ce3795
* Mon Jan 11 2021 root - 7.5-3
ce3795
- Related: #1889323 - Reverting to non-integrated cofiguration
ce3795
ce3795
* Thu Jan 07 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-2
ce3795
- Related: #1889323 - Obsoleting frr-contrib
ce3795
ce3795
* Thu Jan 07 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-1
ce3795
- Resolves: #1889323 - [RFE] Rebase FRR to 7.5
ce3795
ce3795
* Thu Aug 20 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-10
ce3795
- Resolves: #1867793 - FRR does not conform to the source port range specified in RFC5881
ce3795
ce3795
* Thu Aug 20 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-9
ce3795
- Resolves: #1852476 - default permission issue eases information leaks
ce3795
ce3795
* Tue May 05 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-8
23b54f
- Resolves: #1819319 - frr fails to start start if the initscripts package is missing
23b54f
ce3795
* Mon May 04 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-7
23b54f
- Resolves: #1758544 - IGMPv3 queries may lead to DoS
23b54f
23b54f
* Tue Mar 10 2020 Michal Ruprich <mruprich@redhat.com> - 7.0-6
23b54f
- Resolves: #1776342 - frr has missing dependency on iproute
23b54f
4d1074
* Tue Sep 03 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-5
4d1074
- Resolves: #1719465 - Removal of component Frr or its crypto
4d1074
e092ad
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-4
e092ad
- Related: #1657029 - frr-contrib is back, it is breaking the rpmdeplint test
e092ad
e092ad
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-3
e092ad
- Related: #1657029 - more cleanup, removed frr-contrib, frrvt changed to frrvty
e092ad
e092ad
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-2
e092ad
- Related: #1657029 - cleaning specfile, adding Requires on libyang-devel
e092ad
e092ad
* Wed May 29 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-1
e092ad
- Resolves: #1657029 - Add FRR as a replacement of Quagga in RHEL 8