Blame SPECS/frr.spec

e092ad
%global frr_uid  92
e092ad
%global frr_gid  92
e092ad
%global vty_group   frrvty
e092ad
%global vty_gid     85
e092ad
%global frrversion	7.0
e092ad
%global frr_libdir /usr/lib/frr
e092ad
e092ad
%global _hardened_build 1
e092ad
e092ad
Name: frr
e092ad
Version: 7.0
23b54f
Release: 8%{?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
e092ad
BuildRequires: perl-generators
e092ad
BuildRequires: systemd
e092ad
BuildRequires: gcc
e092ad
BuildRequires: net-snmp-devel
e092ad
BuildRequires: texinfo libcap-devel texi2html 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
e092ad
BuildRequires: libyang-devel
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}
e092ad
Obsoletes: frr-sysvinit quagga
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
23b54f
Patch0005: 0005-igmp-trusted-query.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
%package contrib
e092ad
Summary: Contrib tools for frr
e092ad
Requires: %{name}%{?_isa} = %{version}-%{release}
e092ad
e092ad
%description contrib
e092ad
Contributed/3rd party tools which may be of use with frr.
e092ad
e092ad
%package devel
e092ad
Summary: Header and object files for frr development
e092ad
Requires: %{name}%{?_isa} = %{version}-%{release}
e092ad
e092ad
%description devel
e092ad
The frr-devel package contains the header and object files necessary for
e092ad
developing OSPF-API and frr applications.
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 \
e092ad
    --enable-vty-group=%vty_group \
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
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
e092ad
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/daemons %{buildroot}/etc/frr/daemons
e092ad
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.service %{buildroot}%{_unitdir}/frr.service
e092ad
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/redhat/frr.init %{buildroot}%{frr_libdir}/frr
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
e092ad
%pre
e092ad
getent group %vty_group >/dev/null 2>&1 || groupadd -r %vty_group >/dev/null 2>&1 || :
e092ad
getent group frr >/dev/null 2>&1 || groupadd -g frr >/dev/null 2>&1 || :
e092ad
getent passwd frr >/dev/null 2>&1 || useradd -M -r -s /sbin/nologin \
e092ad
 -c "FRRouting suite" -d %{_localstatedir}/run/frr frr || :
e092ad
usermod -aG %vty_group 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
e092ad
    touch %{_sysconfdir}/frr/vtysh.conf
e092ad
    chmod 640 %{_sysconfdir}/frr/vtysh.conf
e092ad
    chown frr:%{vty_group} %{_sysconfdir}/frr/vtysh.conf
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
e092ad
%dir %attr(755,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*/*
e092ad
%{frr_libdir}/*
e092ad
%{_bindir}/*
e092ad
%dir %{_libdir}/frr
e092ad
%{_libdir}/frr/*.so.*
e092ad
%{_libdir}/frr/modules/*
e092ad
%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr
4d1074
%config(noreplace) /etc/frr/daemons
e092ad
%config(noreplace) /etc/pam.d/frr
e092ad
%{_unitdir}/*.service
e092ad
/usr/share/yang/*.yang
e092ad
#%%{_libdir}/frr/frr/libyang_plugins/*
e092ad
e092ad
%files contrib
e092ad
%defattr(-,root,root)
e092ad
%doc COPYING
e092ad
%doc %attr(0644,root,root) tools/frrinit.sh
e092ad
%doc %attr(0644,root,root) tools/watchfrr.sh
e092ad
%doc %attr(0644,root,root) tools/zebra.el
e092ad
%doc %attr(0644,root,root) tools/rrcheck.pl
e092ad
%doc %attr(0644,root,root) tools/rrlookup.pl
e092ad
e092ad
%files devel
e092ad
%defattr(-,root,root)
e092ad
%doc COPYING
e092ad
%dir %{_libdir}/frr/
e092ad
%{_libdir}/frr/*.so
e092ad
%dir %{_includedir}/frr
e092ad
%{_includedir}/frr/*.h
e092ad
%dir %{_includedir}/frr/ospfd
e092ad
%{_includedir}/frr/ospfd/*.h
e092ad
%dir %{_includedir}/frr/eigrpd
e092ad
%{_includedir}/frr/eigrpd/*.h
e092ad
e092ad
%changelog
23b54f
* Tue May 05 2020 Michal Ruprich <michalruprich@gmail.com> - 7.0-8
23b54f
- Resolves: #1819319 - frr fails to start start if the initscripts package is missing
23b54f
23b54f
* Mon May 04 2020 Michal Ruprich <michalruprich@gmail.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