Blame SPECS/frr.spec

d6cd25
%global frr_libdir %{_libexecdir}/frr
d6cd25
d6cd25
%global _hardened_build 1
d6cd25
%define _legacy_common_support 1
8eca10
%global selinuxtype targeted
8eca10
%bcond_without selinux
d6cd25
d6cd25
Name: frr
8eca10
Version: 8.3.1
8eca10
Release: 5%{?checkout}%{?dist}
d6cd25
Summary: Routing daemon
d6cd25
License: GPLv2+
d6cd25
URL: http://www.frrouting.org
d6cd25
Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
d6cd25
Source1: %{name}-tmpfiles.conf
f1b9df
Source2: frr-sysusers.conf
8eca10
Source3: frr.fc
8eca10
Source4: frr.te
8eca10
Source5: frr.if
8eca10
Source6: remove-babeld-ldpd.sh
d6cd25
BuildRequires:  autoconf
d6cd25
BuildRequires:  automake
d6cd25
BuildRequires:  bison >= 2.7
d6cd25
BuildRequires:  c-ares-devel
d6cd25
BuildRequires:  flex
d6cd25
BuildRequires:  gcc
d6cd25
BuildRequires:  gcc-c++
d6cd25
BuildRequires:  git-core
d6cd25
BuildRequires:  groff
d6cd25
BuildRequires:  json-c-devel
d6cd25
BuildRequires:  libcap-devel
d6cd25
BuildRequires:  libtool
d6cd25
BuildRequires:  libyang-devel >= 2.0.0
d6cd25
BuildRequires:  make
d6cd25
BuildRequires:  ncurses
d6cd25
BuildRequires:  ncurses-devel
d6cd25
BuildRequires:  net-snmp-devel
d6cd25
BuildRequires:  pam-devel
d6cd25
BuildRequires:  patch
d6cd25
BuildRequires:  perl-XML-LibXML
d6cd25
BuildRequires:  perl-generators
d6cd25
BuildRequires:  python3-devel
d6cd25
BuildRequires:  python3-pytest
d6cd25
BuildRequires:  python3-sphinx
d6cd25
BuildRequires:  readline-devel
d6cd25
BuildRequires:  systemd-devel
d6cd25
BuildRequires:  systemd-rpm-macros
d6cd25
BuildRequires:  texinfo
d6cd25
d6cd25
Requires: net-snmp
d6cd25
Requires: ncurses
d6cd25
Requires(post): systemd
d6cd25
Requires(post): /sbin/install-info
d6cd25
Requires(post): hostname
d6cd25
Requires(preun): systemd
d6cd25
Requires(preun): /sbin/install-info
d6cd25
Requires(postun): systemd
8eca10
8eca10
%if 0%{?with_selinux}
8eca10
Requires: (%{name}-selinux = %{version}-%{release} if selinux-policy-%{selinuxtype})
8eca10
%endif
8eca10
d6cd25
Conflicts: quagga
d6cd25
Provides: routingdaemon = %{version}-%{release}
d6cd25
d6cd25
Patch0000: 0000-remove-babeld-and-ldpd.patch
d6cd25
Patch0002: 0002-enable-openssl.patch
d6cd25
Patch0003: 0003-disable-eigrp-crypto.patch
d6cd25
Patch0004: 0004-fips-mode.patch
8eca10
Patch0005: 0005-ospf-api.patch
8eca10
Patch0006: 0006-graceful-restart.patch
8eca10
Patch0007: 0007-cve-2022-37032.patch
8eca10
Patch0008: 0008-frr-non-root-user.patch
d6cd25
d6cd25
%description
d6cd25
FRRouting is free software that manages TCP/IP based routing protocols. It takes
d6cd25
a multi-server and multi-threaded approach to resolve the current complexity
d6cd25
of the Internet.
d6cd25
d6cd25
FRRouting supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, NHRP, PBR, EIGRP and BFD.
d6cd25
d6cd25
FRRouting is a fork of Quagga.
d6cd25
8eca10
%if 0%{?with_selinux}
8eca10
%package selinux
8eca10
Summary:        Selinux policy for FRR
8eca10
BuildArch:      noarch
8eca10
Requires:       selinux-policy-%{selinuxtype}
8eca10
Requires(post): selinux-policy-%{selinuxtype}
8eca10
BuildRequires:  selinux-policy-devel
8eca10
%{?selinux_requires}
8eca10
8eca10
%description selinux
8eca10
SELinux policy modules for FRR package
8eca10
8eca10
%endif
8eca10
d6cd25
%prep
d6cd25
%autosetup -S git
8eca10
mkdir selinux
8eca10
cp -p %{SOURCE3} %{SOURCE4} %{SOURCE5} selinux
d6cd25
d6cd25
%build
d6cd25
autoreconf -ivf
d6cd25
d6cd25
%configure \
d6cd25
    --sbindir=%{frr_libdir} \
d6cd25
    --sysconfdir=%{_sysconfdir}/frr \
d6cd25
    --libdir=%{_libdir}/frr \
d6cd25
    --libexecdir=%{_libexecdir}/frr \
d6cd25
    --localstatedir=%{_localstatedir}/run/frr \
d6cd25
    --enable-multipath=64 \
d6cd25
    --enable-vtysh=yes \
d6cd25
    --disable-ospfclient \
d6cd25
    --disable-ospfapi \
d6cd25
    --enable-snmp=agentx \
d6cd25
    --enable-user=frr \
d6cd25
    --enable-group=frr \
d6cd25
    --enable-vty-group=frrvty \
d6cd25
    --enable-rtadv \
d6cd25
    --disable-exampledir \
d6cd25
    --enable-systemd=yes \
d6cd25
    --enable-static=no \
d6cd25
    --disable-ldpd \
d6cd25
    --disable-babeld \
d6cd25
    --with-moduledir=%{_libdir}/frr/modules \
d6cd25
    --with-crypto=openssl \
d6cd25
    --enable-fpm
d6cd25
d6cd25
%make_build MAKEINFO="makeinfo --no-split" PYTHON=%{__python3}
d6cd25
d6cd25
pushd doc
d6cd25
make info
d6cd25
popd
d6cd25
8eca10
%if 0%{?with_selinux}
8eca10
make -C selinux -f %{_datadir}/selinux/devel/Makefile %{name}.pp
8eca10
bzip2 -9 selinux/%{name}.pp
8eca10
%endif
8eca10
d6cd25
%install
d6cd25
mkdir -p %{buildroot}/etc/{frr,rc.d/init.d,sysconfig,logrotate.d,pam.d,default} \
d6cd25
         %{buildroot}/var/log/frr %{buildroot}%{_infodir} \
d6cd25
         %{buildroot}%{_unitdir}
d6cd25
d6cd25
mkdir -p -m 0755 %{buildroot}%{_libdir}/frr
d6cd25
mkdir -p %{buildroot}%{_tmpfilesdir}
d6cd25
d6cd25
%make_install
d6cd25
d6cd25
# Remove this file, as it is uninstalled and causes errors when building on RH9
d6cd25
rm -rf %{buildroot}/usr/share/info/dir
d6cd25
d6cd25
install -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
d6cd25
install -p -m 644 tools/etc/frr/daemons %{buildroot}/etc/frr/daemons
d6cd25
install -p -m 644 tools/frr.service %{buildroot}%{_unitdir}/frr.service
d6cd25
install -p -m 755 tools/frrinit.sh %{buildroot}%{frr_libdir}/frr
d6cd25
install -p -m 755 tools/frrcommon.sh %{buildroot}%{frr_libdir}/frrcommon.sh
d6cd25
install -p -m 755 tools/watchfrr.sh %{buildroot}%{frr_libdir}/watchfrr.sh
d6cd25
d6cd25
install -p -m 644 redhat/frr.logrotate %{buildroot}/etc/logrotate.d/frr
d6cd25
install -p -m 644 redhat/frr.pam %{buildroot}/etc/pam.d/frr
d6cd25
install -d -m 775 %{buildroot}/run/frr
d6cd25
f1b9df
install -p -D -m 0644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysusersdir}/frr.conf
f1b9df
8eca10
%if 0%{?with_selinux}
8eca10
install -D -m 644 selinux/%{name}.pp.bz2 \
8eca10
        %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
8eca10
install -D -m 644 selinux/%{name}.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/%{name}.if
8eca10
%endif
8eca10
d6cd25
# Delete libtool archives
d6cd25
find %{buildroot} -type f -name "*.la" -delete -print
d6cd25
d6cd25
#Upstream does not maintain a stable API, these headers from -devel subpackage are no longer needed
d6cd25
rm %{buildroot}%{_libdir}/frr/*.so
d6cd25
rm -r %{buildroot}%{_includedir}/frr/
d6cd25
d6cd25
%pre
f1b9df
%sysusers_create_compat %{SOURCE2}
f1b9df
exit 0
d6cd25
d6cd25
%post
d6cd25
%systemd_post frr.service
d6cd25
d6cd25
if [ -f %{_infodir}/%{name}.inf* ]; then
d6cd25
    install-info %{_infodir}/frr.info %{_infodir}/dir || :
d6cd25
fi
d6cd25
d6cd25
# Create dummy files if they don't exist so basic functions can be used.
d6cd25
# Only create frr.conf when first installing, otherwise it can change
d6cd25
# the behavior of the package
d6cd25
if [ $1 -eq 1 ]; then
d6cd25
    if [ ! -e %{_sysconfdir}/frr/frr.conf ]; then
d6cd25
        echo "hostname `hostname`" > %{_sysconfdir}/frr/frr.conf
d6cd25
        chown frr:frr %{_sysconfdir}/frr/frr.conf
d6cd25
        chmod 640 %{_sysconfdir}/frr/frr.conf
d6cd25
    fi
d6cd25
fi
d6cd25
d6cd25
#still used by vtysh, this way no error is produced when using vtysh
d6cd25
if [ ! -e %{_sysconfdir}/frr/vtysh.conf ]; then
d6cd25
    touch %{_sysconfdir}/frr/vtysh.conf
d6cd25
    chmod 640 %{_sysconfdir}/frr/vtysh.conf
d6cd25
    chown frr:frrvty %{_sysconfdir}/frr/vtysh.conf
d6cd25
fi
d6cd25
d6cd25
d6cd25
%postun
d6cd25
%systemd_postun_with_restart frr.service
d6cd25
d6cd25
%preun
d6cd25
%systemd_preun frr.service
d6cd25
d6cd25
#only when removing frr
d6cd25
if [ $1 -eq 0 ]; then
d6cd25
	if [ -f %{_infodir}/%{name}.inf* ]; then
d6cd25
    	install-info --delete %{_infodir}/frr.info %{_infodir}/dir || :
d6cd25
	fi
d6cd25
fi
d6cd25
8eca10
%if 0%{?with_selinux}
8eca10
%pre selinux
8eca10
%selinux_relabel_pre -s %{selinuxtype}
8eca10
8eca10
%post selinux
8eca10
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
8eca10
%selinux_relabel_post -s %{selinuxtype}
8eca10
#/var/tmp and /var/run need to be relabeled as well if FRR is running before upgrade
8eca10
if [ $1 == 2 ]; then
8eca10
    %{_sbindir}/restorecon -R /var/tmp/frr &> /dev/null
8eca10
    %{_sbindir}/restorecon -R /var/run/frr &> /dev/null
8eca10
fi
8eca10
8eca10
%postun selinux
8eca10
if [ $1 -eq 0 ]; then
8eca10
    %selinux_modules_uninstall -s %{selinuxtype} %{name}
8eca10
    %selinux_relabel_post -s %{selinuxtype}
8eca10
fi
8eca10
%endif
8eca10
d6cd25
%check
d6cd25
make check PYTHON=%{__python3}
d6cd25
d6cd25
%files
d6cd25
%defattr(-,root,root)
d6cd25
%license COPYING
d6cd25
%doc doc/mpls
d6cd25
%dir %attr(750,frr,frr) %{_sysconfdir}/frr
d6cd25
%dir %attr(755,frr,frr) /var/log/frr
d6cd25
%dir %attr(755,frr,frr) /run/frr
d6cd25
%{_infodir}/*info*
d6cd25
%{_mandir}/man*/*
d6cd25
%dir %{frr_libdir}/
d6cd25
%{frr_libdir}/*
d6cd25
%{_bindir}/*
d6cd25
%dir %{_libdir}/frr
d6cd25
%{_libdir}/frr/*.so.*
d6cd25
%dir %{_libdir}/frr/modules
d6cd25
%{_libdir}/frr/modules/*
d6cd25
%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr
d6cd25
%config(noreplace) %attr(644,frr,frr) /etc/frr/daemons
d6cd25
%config(noreplace) /etc/pam.d/frr
d6cd25
%{_unitdir}/*.service
d6cd25
%dir /usr/share/yang
d6cd25
/usr/share/yang/*.yang
d6cd25
%{_tmpfilesdir}/%{name}.conf
f1b9df
%{_sysusersdir}/frr.conf
d6cd25
8eca10
%if 0%{?with_selinux}
8eca10
%files selinux
8eca10
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.*
8eca10
%{_datadir}/selinux/devel/include/distributed/%{name}.if
8eca10
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
8eca10
%endif
8eca10
d6cd25
%changelog
8eca10
* Mon Nov 28 2022 Michal Ruprich <mruprich@redhat.com> - 8.3.1-5
8eca10
- Resolves: #2147522 - It is not possible to run FRR as a non-root user
8eca10
8eca10
* Thu Nov 24 2022 Michal Ruprich <mruprich@redhat.com> - 8.3.1-4
8eca10
- Resolves: #2144500 - AVC error when reloading FRR with provided reload script
8eca10
8eca10
* Wed Oct 19 2022 Michal Ruprich <mruprich@redhat.com> - 8.3.1-3
8eca10
- Related: #2129743 - Adding missing rules for vtysh and other daemons
8eca10
8eca10
* Mon Oct 17 2022 Michal Ruprich <mruprich@redhat.com> - 8.3.1-2
8eca10
- Resolves: #2128738 - out-of-bounds read in the BGP daemon may lead to information disclosure or denial of service
8eca10
8eca10
* Thu Oct 13 2022 Michal Ruprich <mruprich@redhat.com> - 8.3.1-1
8eca10
- Resolves: #2129731 - Rebase FRR to the latest version
8eca10
- Resolves: #2129743 - Add targeted SELinux policy for FRR
8eca10
- Resolves: #2127494 - BGP incorrectly withdraws routes on graceful restart capable routers 
8eca10
f1b9df
* Tue Jun 14 2022 Michal Ruprich - 8.2.2-4
f1b9df
- Resolves: #2095404 - frr use systemd-sysusers
f1b9df
f1b9df
* Tue May 24 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-3
f1b9df
- Resolves: #2081304 - Enhanced TMT testing for centos-stream
f1b9df
f1b9df
* Mon May 02 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-2
f1b9df
- Resolves: #2069571 - the dynamic routing setup does not work any more
f1b9df
f1b9df
* Mon May 02 2022 Michal Ruprich <mruprich@redhat.com> - 8.2.2-1
f1b9df
- Resolves: #2069563 - Rebase frr to version 8.2.2
f1b9df
d6cd25
* Tue Nov 16 2021 Michal Ruprich <mruprich@redhat.com> - 8.0-5
d6cd25
- Resolves: #2023318 - Rebuilding for the new json-c library
d6cd25
d6cd25
* Wed Sep 01 2021 Michal Ruprich <mruprich@redhat.com> - 8.0-4
d6cd25
- Resolves: #1997603 - ospfd not running with ospf opaque-lsa option used
d6cd25
d6cd25
* Mon Aug 16 2021 Michal Ruprich <mruprich@redhat.com> - 8.0-3
d6cd25
- Related: #1990858 - Fixing prefix-list duplication check
d6cd25
d6cd25
* Thu Aug 12 2021 Michal Ruprich <mruprich@redhat.com> - 8.0-2
d6cd25
- Related: #1990858 - Frr needs higher version of libyang
d6cd25
d6cd25
* Tue Aug 10 2021 Michal Ruprich <mruprich@redhat.com> - 8.0-1
d6cd25
- Resolves: #1990858 - Possible rebase of frr to version 8.0
d6cd25
d6cd25
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 7.5.1-7
d6cd25
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
d6cd25
  Related: rhbz#1991688
d6cd25
d6cd25
* Wed Jul 21 2021 Michal Ruprich <mruprich@redhat.com> - 7.5.1-6
d6cd25
- Resolves: #1983967 - ospfd crashes in route_node_delete with assertion fail
d6cd25
d6cd25
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 7.5.1-5
d6cd25
- Rebuilt for RHEL 9 BETA for openssl 3.0
d6cd25
  Related: rhbz#1971065
d6cd25
d6cd25
* Fri Jun 04 2021 Michal Ruprich <mruprich@redhat.com> - 7.5.1-4
d6cd25
- Resolves: #1958155 - Upgrading frr unconditionally creates /etc/frr/frr.conf, breaking existing configuration
d6cd25
d6cd25
* Fri Apr 23 2021 Michal Ruprich <mruprich@redhat.com> - 7.5.1-3
d6cd25
- Resolves: #1939456 - /etc/frr permissions are bogus
d6cd25
- Resolves: #1951303 - FTBFS in CentOS Stream
d6cd25
d6cd25
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 7.5.1-2
d6cd25
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
d6cd25
d6cd25
* Tue Mar 16 2021 Michal Ruprich <mruprich@redhat.com> - 7.5.1-1
d6cd25
- New version 7.5.1
d6cd25
- Enabling grpc, adding hostname for post scriptlet
d6cd25
- Moving files to libexec due to selinux issues
d6cd25
d6cd25
* Tue Feb 16 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-3
d6cd25
- Fixing FTBS - icc options are confusing the new gcc
d6cd25
d6cd25
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 7.5-2
d6cd25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d6cd25
d6cd25
* Fri Jan 01 2021 Michal Ruprich <mruprich@redhat.com> - 7.5-1
d6cd25
- New version 7.5
d6cd25
d6cd25
* Mon Sep 21 2020 Michal Ruprich <mruprich@redhat.com> - 7.4-1
d6cd25
- New version 7.4
d6cd25
d6cd25
* Thu Aug 27 2020 Josef Řídký <jridky@redhat.com> - 7.3.1-4
d6cd25
- Rebuilt for new net-snmp release
d6cd25
d6cd25
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.3.1-3
d6cd25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d6cd25
d6cd25
* Thu Jun 18 2020 Michal Ruprich <mruprich@redhat.com> - 7.3.1-1
d6cd25
- New version 7.3.1
d6cd25
- Fixes a couple of bugs(#1832259, #1835039, #1830815, #1830808, #1830806, #1830800, #1830798, #1814773)
d6cd25
d6cd25
* Tue May 19 2020 Michal Ruprich <mruprich@redhat.com> - 7.3-6
d6cd25
- Removing texi2html, it is not available in Rawhide anymore
d6cd25
d6cd25
* Mon May 18 2020 Michal Ruprich <mruprich@redhat.com> - 7.3-5
d6cd25
- Rebuild for new version of libyang
d6cd25
d6cd25
* Tue Apr 21 2020 Björn Esser <besser82@fedoraproject.org> - 7.3-4
d6cd25
- Rebuild (json-c)
d6cd25
d6cd25
* Mon Apr 13 2020 Björn Esser <besser82@fedoraproject.org> - 7.3-3
d6cd25
- Update json-c-0.14 patch with a solution from upstream
d6cd25
d6cd25
* Mon Apr 13 2020 Björn Esser <besser82@fedoraproject.org> - 7.3-2
d6cd25
- Add support for upcoming json-c 0.14.0
d6cd25
d6cd25
* Wed Feb 19 2020 Michal Ruprich <mruprich@redhat.com> - 7.3-1
d6cd25
- New version 7.3
d6cd25
d6cd25
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.2-2
d6cd25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d6cd25
d6cd25
* Mon Dec 16 2019 Michal Ruprich <mruprich@redhat.com> - 7.2-1
d6cd25
- New version 7.2
d6cd25
d6cd25
* Tue Nov 12 2019 Michal Ruprich <mruprich@redhat.com> - 7.1-5
d6cd25
- Rebuilding for new version of libyang
d6cd25
d6cd25
* Mon Oct 07 2019 Michal Ruprich <mruprich@redhat.com> - 7.1-4
d6cd25
- Adding noreplace to the /etc/frr/daemons file
d6cd25
d6cd25
* Fri Sep 13 2019 Michal Ruprich <mruprich@redhat.com> - 7.1-3
d6cd25
- New way of finding python version during build
d6cd25
- Replacing crypto of all routing daemons with openssl
d6cd25
- Disabling EIGRP crypto because it is broken
d6cd25
- Disabling crypto in FIPS mode
d6cd25
d6cd25
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.1-2
d6cd25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d6cd25
d6cd25
* Tue Jun 25 2019 Michal Ruprich <mruprich@redhat.com> - 7.1-1
d6cd25
- New version 7.1
d6cd25
d6cd25
* Wed Jun 19 2019 Michal Ruprich <mruprich@redhat.com> - 7.0-2
d6cd25
- Initial build
d6cd25