|
|
e24e1f1 |
%if 0%{?fedora}
|
|
|
e24e1f1 |
%global with_python3 1
|
|
|
e24e1f1 |
%endif
|
|
|
318b18a |
%global srcname exabgp
|
|
|
174563a |
|
|
|
174563a |
Name: python-exabgp
|
|
|
8b1b561 |
Version: 4.0.5
|
|
|
1f71d15 |
Release: 5%{?dist}
|
|
|
174563a |
Summary: The BGP swiss army knife of networking (Library)
|
|
|
174563a |
|
|
|
174563a |
License: BSD
|
|
|
174563a |
URL: https://github.com/Exa-Networks/
|
|
|
e24e1f1 |
Source0: https://github.com/Exa-Networks/%{srcname}/archive/%{version}.tar.gz
|
|
|
e24e1f1 |
|
|
|
174563a |
BuildArch: noarch
|
|
|
174563a |
|
|
|
e24e1f1 |
%description
|
|
|
e24e1f1 |
ExaBGP python module
|
|
|
174563a |
|
|
|
e24e1f1 |
%package -n python2-%{srcname}
|
|
|
e24e1f1 |
Summary: The BGP swiss army knife of networking
|
|
|
e24e1f1 |
Group: Applications/Internet
|
|
|
e24e1f1 |
BuildRequires: python2-devel
|
|
|
318b18a |
BuildRequires: python2-setuptools
|
|
|
318b18a |
Requires: python2-six
|
|
|
1b8c2c9 |
# XXX: only required for healthcheck.py on python2
|
|
|
1b8c2c9 |
# healthcheck.py is in service package, but it simplifies packaging to put it here
|
|
|
1b8c2c9 |
# According code, it tries to load ipaddress then ipaddr, since ipaddr is unmaintained
|
|
|
1b8c2c9 |
# Let's stick to ipaddress which is backport from python3 stdlib
|
|
|
43fec71 |
Requires: python2-ipaddress
|
|
|
1b8c2c9 |
%{?python_provide:%python_provide python2-%{srcname}}
|
|
|
174563a |
|
|
|
e24e1f1 |
%description -n python2-%{srcname}
|
|
|
318b18a |
The BGP swiss army knife of networking
|
|
|
174563a |
|
|
|
e24e1f1 |
%if 0%{?with_python3}
|
|
|
e24e1f1 |
%package -n python3-%{srcname}
|
|
|
174563a |
Summary: The BGP swiss army knife of networking
|
|
|
174563a |
Group: Applications/Internet
|
|
|
e24e1f1 |
BuildRequires: python3-devel
|
|
|
e24e1f1 |
BuildRequires: python3-setuptools
|
|
|
e24e1f1 |
Requires: python3-six
|
|
|
1b8c2c9 |
%{?python_provide:%python_provide python3-%{srcname}}
|
|
|
174563a |
|
|
|
e24e1f1 |
%description -n python3-%{srcname}
|
|
|
e24e1f1 |
The BGP swiss army knife of networking
|
|
|
254abec |
%endif
|
|
|
174563a |
|
|
|
1b8c2c9 |
%package -n exabgp
|
|
|
1b8c2c9 |
Summary: The BGP swiss army knife of networking
|
|
|
1b8c2c9 |
Group: Applications/Internet
|
|
|
1b8c2c9 |
BuildRequires: systemd-units
|
|
|
1b8c2c9 |
Requires: systemd
|
|
|
1b8c2c9 |
# XXX: when python3 variant becomes default, change to python3 subpackage
|
|
|
1b8c2c9 |
Requires: python2-%{srcname} = %{version}-%{release}
|
|
|
1b8c2c9 |
|
|
|
1b8c2c9 |
%description -n exabgp
|
|
|
1b8c2c9 |
The BGP swiss army knife of networking (exabgp systemd unit)
|
|
|
1b8c2c9 |
|
|
|
174563a |
%prep
|
|
|
e24e1f1 |
%autosetup -n %{srcname}-%{version}
|
|
|
174563a |
|
|
|
174563a |
%build
|
|
|
e24e1f1 |
%py2_build
|
|
|
e24e1f1 |
%if 0%{?with_python3}
|
|
|
e24e1f1 |
%py3_build
|
|
|
318b18a |
%endif
|
|
|
174563a |
|
|
|
174563a |
%install
|
|
|
1b8c2c9 |
# Now, we'll ensure that our python2 binaries does not get overwritten
|
|
|
1b8c2c9 |
# XXX: setup.py installs binaries in /usr/bin but systemd unit expects it to be in /usr/sbin
|
|
|
1b8c2c9 |
mkdir -p %{buildroot}%{_sbindir}
|
|
|
e24e1f1 |
%if 0%{?with_python3}
|
|
|
e24e1f1 |
%py3_install
|
|
|
1b8c2c9 |
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_sbindir}/%{srcname}-%{python3_version}
|
|
|
1b8c2c9 |
ln -s ./%{srcname}-%{python3_version} %{buildroot}%{_sbindir}/%{srcname}-3
|
|
|
318b18a |
%endif
|
|
|
174563a |
|
|
|
1b8c2c9 |
%py2_install
|
|
|
1b8c2c9 |
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_sbindir}/%{srcname}-%{python2_version}
|
|
|
1b8c2c9 |
ln -s ./%{srcname}-%{python2_version} %{buildroot}%{_sbindir}/%{srcname}-2
|
|
|
1b8c2c9 |
# Symbolic link to default exabgp binary variant (python2)
|
|
|
1b8c2c9 |
ln -s ./%{srcname}-2 %{buildroot}%{_sbindir}/%{srcname}
|
|
|
1b8c2c9 |
|
|
|
e24e1f1 |
%check
|
|
|
e24e1f1 |
%{__python2} setup.py test
|
|
|
e24e1f1 |
%if 0%{?with_python3}
|
|
|
e24e1f1 |
%{__python3} setup.py test
|
|
|
318b18a |
%endif
|
|
|
174563a |
|
|
|
1b8c2c9 |
# Install health check
|
|
|
1b8c2c9 |
install -p -D -m 0755 bin/healthcheck %{buildroot}%{_sbindir}
|
|
|
1b8c2c9 |
mv %{buildroot}%{_sbindir}/healthcheck %{buildroot}/%{_sbindir}/%{srcname}-healthcheck
|
|
|
174563a |
|
|
|
83a6181 |
# Install exabgpcli
|
|
|
83a6181 |
install -p -D -m 0755 bin/exabgpcli %{buildroot}%{_bindir}
|
|
|
83a6181 |
|
|
|
1b8c2c9 |
# Configure required directories for the exabgp service
|
|
|
e24e1f1 |
mkdir -p %{buildroot}/%{_sysconfdir}/exabgp
|
|
|
e24e1f1 |
mkdir -p %{buildroot}/%{_libdir}/exabgp
|
|
|
1b8c2c9 |
# Install exabgp systemd unit
|
|
|
e24e1f1 |
mkdir -p %{buildroot}/%{_unitdir}
|
|
|
1b8c2c9 |
install -p -D -m 0644 etc/systemd/%{srcname}.service %{buildroot}/%{_unitdir}/%{srcname}.service
|
|
|
174563a |
|
|
|
1b8c2c9 |
# Install man pages
|
|
|
e24e1f1 |
mkdir -p %{buildroot}/%{_mandir}/man1
|
|
|
174563a |
install doc/man/exabgp.1 %{buildroot}/%{_mandir}/man1
|
|
|
e24e1f1 |
mkdir -p %{buildroot}/%{_mandir}/man5
|
|
|
174563a |
install doc/man/exabgp.conf.5 %{buildroot}/%{_mandir}/man5
|
|
|
174563a |
|
|
|
1b8c2c9 |
%post -n exabgp
|
|
|
1b8c2c9 |
%systemd_post %{srcname}.service
|
|
|
174563a |
|
|
|
1b8c2c9 |
%preun -n exabgp
|
|
|
1b8c2c9 |
%systemd_preun %{srcname}.service
|
|
|
174563a |
|
|
|
1b8c2c9 |
%postun -n exabgp
|
|
|
1b8c2c9 |
%systemd_postun_with_restart %{srcname}.service
|
|
|
174563a |
|
|
|
e24e1f1 |
%files -n python2-%{srcname}
|
|
|
174563a |
%doc CHANGELOG README.md
|
|
|
1b8c2c9 |
%{python2_sitelib}/*
|
|
|
1b8c2c9 |
# XXX: when python3 variant becomes default, move next line to python3 subpackage
|
|
|
1b8c2c9 |
%{_sbindir}/%{srcname}
|
|
|
1b8c2c9 |
%{_sbindir}/%{srcname}-2*
|
|
|
174563a |
%license COPYRIGHT
|
|
|
174563a |
|
|
|
e24e1f1 |
%if 0%{?with_python3}
|
|
|
e24e1f1 |
%files -n python3-%{srcname}
|
|
|
e24e1f1 |
%{python3_sitelib}/*
|
|
|
1b8c2c9 |
%{_sbindir}/%{srcname}-3*
|
|
|
174563a |
%doc CHANGELOG README.md
|
|
|
174563a |
%license COPYRIGHT
|
|
|
1b8c2c9 |
%endif
|
|
|
1b8c2c9 |
|
|
|
1b8c2c9 |
# Let's split out exabgp service here
|
|
|
1b8c2c9 |
%files -n exabgp
|
|
|
1b8c2c9 |
%attr(755, root, root) %{_sbindir}/%{srcname}-healthcheck
|
|
|
83a6181 |
%attr(755, root, root) %{_bindir}/exabgpcli
|
|
|
1b8c2c9 |
%{_unitdir}/%{srcname}.service
|
|
|
1b8c2c9 |
%dir %{_libdir}/%{srcname}
|
|
|
1b8c2c9 |
%dir %{_datadir}/%{srcname}
|
|
|
1b8c2c9 |
%dir %{_datadir}/%{srcname}/processes
|
|
|
1b8c2c9 |
%dir %{_sysconfdir}/%{srcname}
|
|
|
1b8c2c9 |
%attr(744, root, root) %{_datadir}/%{srcname}/processes/*
|
|
|
174563a |
%{_mandir}/man1/*
|
|
|
174563a |
%{_mandir}/man5/*
|
|
|
174563a |
|
|
|
174563a |
%changelog
|
|
|
1f71d15 |
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.5-5
|
|
|
1f71d15 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
|
|
1f71d15 |
|
|
|
83a6181 |
* Wed Jan 31 2018 Luke Hinds <lhinds@redhat.com> - 4.0.5
|
|
|
83a6181 |
- 4.0.5 release
|
|
|
83a6181 |
|
|
|
43fec71 |
* Tue Jan 16 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.0.1-4
|
|
|
43fec71 |
- Update Python 2 dependency declarations to new packaging standards
|
|
|
43fec71 |
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
|
|
|
43fec71 |
|
|
|
42b1875 |
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
|
|
|
42b1875 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
|
|
42b1875 |
|
|
|
16a767e |
* Fri Jul 10 2017 Luke Hinds <lhinds@redhat.com> - 4.0.1-2
|
|
|
16a767e |
- Fixed dependency issues
|
|
|
e24e1f1 |
* Fri Jul 07 2017 Luke Hinds <lhinds@redhat.com> - 4.0.1
|
|
|
e24e1f1 |
- 4.0.1 release, and python 3 support
|
|
|
174563a |
* Fri May 19 2017 Luke Hinds <lhinds@redhat.com> - 4.0.0
|
|
|
174563a |
- Initial release
|