%global srcname exabgp Name: python-exabgp Version: 4.2.21 Release: 1%{?dist} Summary: The BGP swiss army knife of networking (Library) License: BSD URL: https://github.com/Exa-Networks/exabgp Source0: https://github.com/Exa-Networks/%{srcname}/archive/%{version}/%{name}-%{version}.tar.gz Source1: python-exabgp.tmpfiles.conf Source2: python-exabgp.exabgp.service Source3: python-exabgp.exabgp@.service Source4: python-exabgp.sysusers.conf BuildArch: noarch %description ExaBGP python module %package -n python3-%{srcname} Summary: The BGP swiss army knife of networking BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-rpm-macros Obsoletes: python2-%{srcname} <= %{version} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} The BGP swiss army knife of networking %package -n exabgp Summary: The BGP swiss army knife of networking %if (0%{?rhel} == 7) BuildRequires: systemd Requires(pre): shadow-utils %else BuildRequires: systemd-rpm-macros %endif %{?systemd_requires} %{?sysusers_requires_compat} Requires: python3-%{srcname} = %{version}-%{release} %description -n exabgp The BGP swiss army knife of networking (exabgp systemd unit) %prep %autosetup -n %{srcname}-%{version} -p1 %build %py3_build %install %py3_install # XXX: setup.py installs binaries in /usr/bin but systemd unit expects it to be in /usr/sbin mkdir -p %{buildroot}%{_sbindir} mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_sbindir} # Install health check with package name (healthcheck is too generic) install -p -D -m 0755 bin/healthcheck %{buildroot}%{_sbindir}/%{srcname}-healthcheck # Configure required directories for the exabgp service mkdir -p %{buildroot}%{_sysconfdir}/exabgp # Install systemd files install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{srcname}.service install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{srcname}@.service # Install man pages install -p -D -m 0644 doc/man/exabgp.1 %{buildroot}/%{_mandir}/man1/exabgp.1 install -p -D -m 0644 doc/man/exabgp.conf.5 %{buildroot}/%{_mandir}/man5/exabgp.conf.5 # Install tmpfiles and sysusers files install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{srcname}.conf %if ((0%{?fedora}) || (0%{?rhel} > 7)) install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/%{srcname}.conf %endif # Remove examples rm -rf %{buildroot}/usr/etc %check %{__python3} setup.py test %pre %if (0%{?rhel} == 7) getent group exabgp >/dev/null || groupadd -r exabgp getent passwd exabgp >/dev/null || \ useradd -r -g exabgp -d /run/exabgp -s /sbin/nologin \ -c "ExaBGP user" exabgp exit 0 %else %sysusers_create_compat %{SOURCE4} %endif %post -n exabgp %systemd_post %{srcname}.service # Default env [ -f %{_sysconfdir}/exabgp/exabgp.env ] || %{_sbindir}/exabgp --fi > %{_sysconfdir}/exabgp/exabgp.env %preun -n exabgp %systemd_preun %{srcname}.service %postun -n exabgp %systemd_postun_with_restart %{srcname}.service %files -n python3-%{srcname} %doc CHANGELOG.rst README.md %license LICENCE.txt %{python3_sitelib}/* # Let's split out exabgp service here %files -n exabgp %{_bindir}/* %{_sbindir}/* %{_unitdir}/* %{_mandir}/man1/* %{_mandir}/man5/* %{_tmpfilesdir}/* %if ((0%{?fedora}) || (0%{?rhel} > 7)) %{_sysusersdir}/exabgp.conf %endif %dir %{_sysconfdir}/%{srcname} %changelog * Mon Jul 18 2022 Gary Buhrmaster - 4.2.21-1 - Update to 4.2.21 * Sat Jun 25 2022 Gary Buhrmaster - 4.2.20-1 - Update to 4.2.20 * Sat Jun 11 2022 Gary Buhrmaster - 4.2.19-1 - Update to 4.2.19 * Sun Apr 24 2022 Gary Buhrmaster - 4.2.18-1 - Update to 4.2.18 * Sun Jan 09 2022 Gary Buhrmaster - 4.2.17-1 - Update to 4.2.17 * Fri Mar 19 2021 Gary Buhrmaster - 4.2.13-1 - Update to 4.2.13 * Sun Mar 14 2021 Gary Buhrmaster - 4.2.12-1 - Update to 4.2.12 * Sun Aug 23 2020 Gary Buhrmaster - 4.2.11-1 - Update to 4.2.11 * Mon Mar 16 2020 Gary Buhrmaster - 4.2.6-2 - pull in recent patches * Sat Mar 07 2020 Gary Buhrmaster - 4.2.6-1 - 4.2.6 release * Thu Jan 30 2020 Fedora Release Engineering - 4.0.10-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Mon Aug 19 2019 Miro Hrončok - 4.0.10-4 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 4.0.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 4.0.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Dec 28 2018 Miro Hrončok - 4.0.10-1 - Update to 4.0.10, Python 3 only * Sat Jul 14 2018 Fedora Release Engineering - 4.0.5-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Tue Jun 19 2018 Miro Hrončok - 4.0.5-6 - Rebuilt for Python 3.7 * Fri Feb 09 2018 Fedora Release Engineering - 4.0.5-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Wed Jan 31 2018 Luke Hinds - 4.0.5 - 4.0.5 release * Tue Jan 16 2018 Iryna Shcherbina - 4.0.1-4 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Thu Jul 27 2017 Fedora Release Engineering - 4.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Jul 10 2017 Luke Hinds - 4.0.1-2 - Fixed dependency issues * Fri Jul 07 2017 Luke Hinds - 4.0.1 - 4.0.1 release, and python 3 support * Fri May 19 2017 Luke Hinds - 4.0.0 - Initial release