Blame SPECS/frr.spec

800a7b
%global frr_uid  92
800a7b
%global frr_gid  92
800a7b
%global vty_group   frrvty
800a7b
%global vty_gid     85
800a7b
%global frrversion	7.0
800a7b
%global frr_libdir /usr/lib/frr
800a7b
800a7b
%global _hardened_build 1
800a7b
800a7b
Name: frr
800a7b
Version: 7.0
800a7b
Release: 6%{?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
800a7b
BuildRequires: perl-generators
800a7b
BuildRequires: systemd
800a7b
BuildRequires: gcc
800a7b
BuildRequires: net-snmp-devel
800a7b
BuildRequires: texinfo libcap-devel texi2html 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
800a7b
BuildRequires: libyang-devel
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
800a7b
Provides: routingdaemon = %{version}-%{release}
800a7b
Obsoletes: frr-sysvinit quagga
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
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
%package contrib
800a7b
Summary: Contrib tools for frr
800a7b
Requires: %{name}%{?_isa} = %{version}-%{release}
800a7b
800a7b
%description contrib
800a7b
Contributed/3rd party tools which may be of use with frr.
800a7b
800a7b
%package devel
800a7b
Summary: Header and object files for frr development
800a7b
Requires: %{name}%{?_isa} = %{version}-%{release}
800a7b
800a7b
%description devel
800a7b
The frr-devel package contains the header and object files necessary for
800a7b
developing OSPF-API and frr applications.
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 \
800a7b
    --enable-vty-group=%vty_group \
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
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
800a7b
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/daemons %{buildroot}/etc/frr/daemons
800a7b
install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.service %{buildroot}%{_unitdir}/frr.service
800a7b
install -p -m 755 %{_builddir}/%{name}-%{frrversion}/redhat/frr.init %{buildroot}%{frr_libdir}/frr
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
800a7b
%pre
800a7b
getent group %vty_group >/dev/null 2>&1 || groupadd -r %vty_group >/dev/null 2>&1 || :
800a7b
getent group frr >/dev/null 2>&1 || groupadd -g frr >/dev/null 2>&1 || :
800a7b
getent passwd frr >/dev/null 2>&1 || useradd -M -r -s /sbin/nologin \
800a7b
 -c "FRRouting suite" -d %{_localstatedir}/run/frr frr || :
800a7b
usermod -aG %vty_group 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.
800a7b
if [ ! -e %{_sysconfdir}/frr/zebra.conf ]; then
800a7b
    echo "hostname `hostname`" > %{_sysconfdir}/frr/zebra.conf
800a7b
    chown frr:frr %{_sysconfdir}/frr/zebra.conf
800a7b
    chmod 640 %{_sysconfdir}/frr/zebra.conf
800a7b
fi
800a7b
800a7b
if [ ! -e %{_sysconfdir}/frr/vtysh.conf ]; then
800a7b
    touch %{_sysconfdir}/frr/vtysh.conf
800a7b
    chmod 640 %{_sysconfdir}/frr/vtysh.conf
800a7b
    chown frr:%{vty_group} %{_sysconfdir}/frr/vtysh.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
800a7b
%dir %attr(755,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*/*
800a7b
%{frr_libdir}/*
800a7b
%{_bindir}/*
800a7b
%dir %{_libdir}/frr
800a7b
%{_libdir}/frr/*.so.*
800a7b
%{_libdir}/frr/modules/*
800a7b
%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr
800a7b
%config(noreplace) /etc/frr/daemons
800a7b
%config(noreplace) /etc/pam.d/frr
800a7b
%{_unitdir}/*.service
800a7b
/usr/share/yang/*.yang
800a7b
#%%{_libdir}/frr/frr/libyang_plugins/*
800a7b
800a7b
%files contrib
800a7b
%defattr(-,root,root)
800a7b
%doc COPYING
800a7b
%doc %attr(0644,root,root) tools/frrinit.sh
800a7b
%doc %attr(0644,root,root) tools/watchfrr.sh
800a7b
%doc %attr(0644,root,root) tools/zebra.el
800a7b
%doc %attr(0644,root,root) tools/rrcheck.pl
800a7b
%doc %attr(0644,root,root) tools/rrlookup.pl
800a7b
800a7b
%files devel
800a7b
%defattr(-,root,root)
800a7b
%doc COPYING
800a7b
%dir %{_libdir}/frr/
800a7b
%{_libdir}/frr/*.so
800a7b
%dir %{_includedir}/frr
800a7b
%{_includedir}/frr/*.h
800a7b
%dir %{_includedir}/frr/ospfd
800a7b
%{_includedir}/frr/ospfd/*.h
800a7b
%dir %{_includedir}/frr/eigrpd
800a7b
%{_includedir}/frr/eigrpd/*.h
800a7b
800a7b
%changelog
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