Blame SPECS/frr.spec

ce3795
%global frrversion	7.5
e092ad
%global frr_libdir /usr/lib/frr
e092ad
e092ad
%global _hardened_build 1
e092ad
e092ad
Name: frr
ce3795
Version: 7.5
caebb1
Release: 11%{?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
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
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
caebb1
Patch0008: 0008-ospf-multi-instance.patch
caebb1
Patch0009: 0009-bgp-ttl-security.patch
caebb1
Patch0010: 0010-bfd-reload.patch
caebb1
Patch0011: 0011-designated-router.patch
caebb1
Patch0012: 0012-bfd-peers-crash.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
e092ad
%prep
e092ad
%autosetup -S git
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
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
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
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
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
e092ad
%changelog
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