diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6060970 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/frr-7.1.tar.gz diff --git a/0000-remove-babeld-and-ldpd.patch b/0000-remove-babeld-and-ldpd.patch new file mode 100644 index 0000000..676770f --- /dev/null +++ b/0000-remove-babeld-and-ldpd.patch @@ -0,0 +1,29 @@ +diff --git a/Makefile.am b/Makefile.am +index 5be3264..33abc1d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -130,8 +130,6 @@ include ospf6d/subdir.am + include ospfclient/subdir.am + include isisd/subdir.am + include nhrpd/subdir.am +-include ldpd/subdir.am +-include babeld/subdir.am + include eigrpd/subdir.am + include sharpd/subdir.am + include pimd/subdir.am +@@ -182,7 +180,6 @@ EXTRA_DIST += \ + snapcraft/helpers \ + snapcraft/snap \ + \ +- babeld/Makefile \ + bgpd/Makefile \ + bgpd/rfp-example/librfp/Makefile \ + bgpd/rfp-example/rfptest/Makefile \ +@@ -193,7 +190,6 @@ EXTRA_DIST += \ + fpm/Makefile \ + grpc/Makefile \ + isisd/Makefile \ +- ldpd/Makefile \ + lib/Makefile \ + nhrpd/Makefile \ + ospf6d/Makefile \ diff --git a/0001-use-python3.patch b/0001-use-python3.patch new file mode 100644 index 0000000..6ecafb3 --- /dev/null +++ b/0001-use-python3.patch @@ -0,0 +1,10 @@ +diff --git a/tools/frr-reload.py b/tools/frr-reload.py +index 208fb11..0692adc 100755 +--- a/tools/frr-reload.py ++++ b/tools/frr-reload.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + # Frr Reloader + # Copyright (C) 2014 Cumulus Networks, Inc. + # diff --git a/frr.spec b/frr.spec new file mode 100644 index 0000000..2b45701 --- /dev/null +++ b/frr.spec @@ -0,0 +1,179 @@ +%global frrversion 7.1 +%global frr_libdir /usr/lib/frr + +%global _hardened_build 1 + +Name: frr +Version: 7.1 +Release: 1%{?checkout}%{?dist} +Summary: Routing daemon +License: GPLv2+ +URL: http://www.frrouting.org +Source0: https://github.com/FRRouting/frr/releases/download/%{name}-%{frrversion}/%{name}-%{frrversion}.tar.gz +BuildRequires: perl-generators +BuildRequires: systemd +BuildRequires: gcc +BuildRequires: net-snmp-devel +BuildRequires: texinfo libcap-devel texi2html autoconf automake libtool patch groff +BuildRequires: readline readline-devel ncurses ncurses-devel +BuildRequires: git pam-devel c-ares-devel +BuildRequires: json-c-devel bison >= 2.7 flex perl-XML-LibXML +BuildRequires: python3-devel python3-sphinx python3-pytest +BuildRequires: systemd systemd-devel +BuildRequires: libyang-devel >= 0.16.74 +Requires: net-snmp ncurses +Requires(post): systemd /sbin/install-info +Requires(preun): systemd /sbin/install-info +Requires(postun): systemd +Provides: routingdaemon = %{version}-%{release} +Conflicts: quagga + +Patch0000: 0000-remove-babeld-and-ldpd.patch +Patch0001: 0001-use-python3.patch + +%description +FRRouting is free software that manages TCP/IP based routing protocols. It takes +a multi-server and multi-threaded approach to resolve the current complexity +of the Internet. + +FRRouting supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, NHRP, PBR, EIGRP and BFD. + +FRRouting is a fork of Quagga. + +%prep +%autosetup -S git + +%build +autoreconf -ivf + +%configure \ + --sbindir=%{frr_libdir} \ + --sysconfdir=%{_sysconfdir}/frr \ + --libdir=%{_libdir}/frr \ + --libexecdir=%{_libexecdir}/frr \ + --localstatedir=%{_localstatedir}/run/frr \ + --enable-multipath=64 \ + --enable-vtysh=yes \ + --disable-ospfclient \ + --disable-ospfapi \ + --enable-snmp=agentx \ + --enable-user=frr \ + --enable-group=frr \ + --enable-vty-group=frrvty \ + --enable-rtadv \ + --disable-exampledir \ + --enable-systemd=yes \ + --enable-static=no \ + --disable-ldpd \ + --disable-babeld \ + --with-moduledir=%{_libdir}/frr/modules \ + --enable-fpm + +%make_build MAKEINFO="makeinfo --no-split" PYTHON=%{__python3} + +pushd doc +make info +popd + +%install +mkdir -p %{buildroot}/etc/{frr,rc.d/init.d,sysconfig,logrotate.d,pam.d,default} \ + %{buildroot}/var/log/frr %{buildroot}%{_infodir} \ + %{buildroot}%{_unitdir} + +mkdir -p -m 0755 %{buildroot}%{_libdir}/frr + +%make_install + +# Remove this file, as it is uninstalled and causes errors when building on RH9 +rm -rf %{buildroot}/usr/share/info/dir + +install -p -m 644 %{_builddir}/%{name}-%{frrversion}/tools/etc/frr/daemons %{buildroot}/etc/frr/daemons +install -p -m 644 %{_builddir}/%{name}-%{frrversion}/tools/frr.service %{buildroot}%{_unitdir}/frr.service +install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/frrinit.sh %{buildroot}%{frr_libdir}/frr +install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/frrcommon.sh %{buildroot}%{frr_libdir}/frrcommon.sh +install -p -m 755 %{_builddir}/%{name}-%{frrversion}/tools/watchfrr.sh %{buildroot}%{frr_libdir}/watchfrr.sh + +install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.logrotate %{buildroot}/etc/logrotate.d/frr +install -p -m 644 %{_builddir}/%{name}-%{frrversion}/redhat/frr.pam %{buildroot}/etc/pam.d/frr +install -d -m 775 %{buildroot}/run/frr + +rm %{buildroot}%{_libdir}/frr/*.la +rm %{buildroot}%{_libdir}/frr/modules/*.la + +#Upstream does not maintain a stable API, these headers from -devel subpackage are no longer needed +rm %{buildroot}%{_libdir}/frr/*.so +rm -r %{buildroot}%{_includedir}/frr/ + +%pre +getent group frrvty >/dev/null 2>&1 || groupadd -r frrvty >/dev/null 2>&1 || : +getent group frr >/dev/null 2>&1 || groupadd -r frr >/dev/null 2>&1 || : +getent passwd frr >/dev/null 2>&1 || useradd -M -r -g frr -s /sbin/nologin \ + -c "FRRouting routing suite" -d %{_localstatedir}/run/frr frr || : +usermod -aG frrvty frr + +%post +%systemd_post frr.service + +if [ -f %{_infodir}/%{name}.inf* ]; then + install-info %{_infodir}/frr.info %{_infodir}/dir || : +fi + +# Create dummy files if they don't exist so basic functions can be used. +if [ ! -e %{_sysconfdir}/frr/frr.conf ]; then + echo "hostname `hostname`" > %{_sysconfdir}/frr/frr.conf + chown frr:frr %{_sysconfdir}/frr/frr.conf + chmod 640 %{_sysconfdir}/frr/frr.conf +fi + +%postun +%systemd_postun_with_restart frr.service + +%preun +%systemd_preun frr.service + +#only when removing frr +if [ $1 -eq 0 ]; then + if [ -f %{_infodir}/%{name}.inf* ]; then + install-info --delete %{_infodir}/frr.info %{_infodir}/dir || : + fi +fi + +%check +make check PYTHON=%{__python3} + +%files +%defattr(-,root,root) +%license COPYING +%doc zebra/zebra.conf.sample +%doc isisd/isisd.conf.sample +%doc ripd/ripd.conf.sample +%doc bgpd/bgpd.conf.sample* +%doc ospfd/ospfd.conf.sample +%doc ospf6d/ospf6d.conf.sample +%doc ripngd/ripngd.conf.sample +%doc pimd/pimd.conf.sample +%doc doc/mpls +%dir %attr(755,frr,frr) %{_sysconfdir}/frr +%dir %attr(755,frr,frr) /var/log/frr +%dir %attr(755,frr,frr) /run/frr +%{_infodir}/*info* +%{_mandir}/man*/* +%{frr_libdir}/* +%{_bindir}/* +%dir %{_libdir}/frr +%{_libdir}/frr/*.so.* +%{_libdir}/frr/modules/* +%config(noreplace) %attr(644,root,root) /etc/logrotate.d/frr +/etc/frr/daemons +%config(noreplace) /etc/pam.d/frr +%{_unitdir}/*.service +/usr/share/yang/*.yang +#%%{_libdir}/frr/frr/libyang_plugins/* + +%changelog +* Tue Jun 25 2019 Michal Ruprich - 7.1-1 +- New version 7.1 + +* Wed Jun 19 2019 Michal Ruprich - 7.0-2 +- Initial build + diff --git a/sources b/sources new file mode 100644 index 0000000..2d1b1f3 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (frr-7.1.tar.gz) = ee0be872a96737e45dd841b936f66c394db2bcd857c28437dfeeeabf70cf420e69212b4b744569cc1c9f6038e7ca66211c6294ec2e94855ed8131833985e32b0