Blame SPECS/frr.spec

80b0bb
%global frrversion	7.5
800a7b
%global frr_libdir /usr/lib/frr
800a7b
800a7b
%global _hardened_build 1
800a7b
800a7b
Name: frr
80b0bb
Version: 7.5
80b0bb
Release: 2%{?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
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
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
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
800a7b
%prep
800a7b
%autosetup -S git
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
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
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
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.
80b0bb
if [ ! -e %{_sysconfdir}/frr/frr.conf ]; then
80b0bb
    echo "hostname `hostname`" > %{_sysconfdir}/frr/frr.conf
80b0bb
    chown frr:frr %{_sysconfdir}/frr/frr.conf
80b0bb
    chmod 640 %{_sysconfdir}/frr/frr.conf
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
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
80b0bb
%dir %attr(640,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
800a7b
%changelog
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