Blame SPECS/frr.spec

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