Blame python-exabgp.spec

e24e1f
%if 0%{?fedora}
e24e1f
%global with_python3 1
e24e1f
%endif
318b18
%global srcname exabgp
174563
174563
Name:           python-exabgp
e24e1f
Version:        4.0.1
174563
Release:        1%{?dist}
174563
Summary:        The BGP swiss army knife of networking (Library)
174563
174563
License:        BSD
174563
URL:            https://github.com/Exa-Networks/
e24e1f
Source0:        https://github.com/Exa-Networks/%{srcname}/archive/%{version}.tar.gz
e24e1f
174563
BuildArch:      noarch
174563
e24e1f
%description
e24e1f
ExaBGP python module
174563
e24e1f
%package -n python2-%{srcname}
e24e1f
Summary:        The BGP swiss army knife of networking
e24e1f
Group:          Applications/Internet
e24e1f
BuildRequires:  systemd-units
e24e1f
BuildRequires:  python2
e24e1f
BuildRequires:  python2-devel
318b18
BuildRequires:  python2-setuptools
174563
Requires:       python-ipaddr
318b18
Requires:       python2-six
318b18
Requires:       python-exabgp
e24e1f
Requires:       systemd
e24e1f
Requires: %{name} = %{version}-%{release}
174563
e24e1f
%description -n python2-%{srcname}
318b18
The BGP swiss army knife of networking
174563
e24e1f
%if 0%{?with_python3}
e24e1f
%package -n python3-%{srcname}
174563
Summary:        The BGP swiss army knife of networking
174563
Group:          Applications/Internet
174563
BuildRequires:  systemd-units
e24e1f
BuildRequires:  python3-devel
e24e1f
BuildRequires:  python3-setuptools
318b18
Requires:       python-ipaddr
e24e1f
Requires:       python3-six
318b18
Requires:       python-exabgp
174563
Requires:       systemd
174563
Requires: %{name} = %{version}-%{release}
e24e1f
%endif
174563
e24e1f
%description -n python3-%{srcname}
e24e1f
The BGP swiss army knife of networking
174563
174563
%prep
e24e1f
%autosetup -n %{srcname}-%{version}
174563
174563
%build
e24e1f
%py2_build
e24e1f
%if 0%{?with_python3}
e24e1f
%py3_build
318b18
%endif
174563
174563
%install
e24e1f
%py2_install
e24e1f
%if 0%{?with_python3}
e24e1f
%py3_install
318b18
%endif
174563
e24e1f
%check
e24e1f
%{__python2} setup.py test
e24e1f
%if 0%{?with_python3}
e24e1f
%{__python3} setup.py test
318b18
%endif
174563
e24e1f
install bin/healthcheck %{buildroot}%{_bindir}
e24e1f
mv %{buildroot}%{_bindir} %{buildroot}%{_sbindir}
e24e1f
mv %{buildroot}%{_sbindir}/healthcheck %{buildroot}/%{_sbindir}/exabgp-healthcheck
174563
e24e1f
mkdir -p %{buildroot}/%{_sysconfdir}/exabgp
e24e1f
mkdir -p %{buildroot}/%{_libdir}/exabgp
174563
e24e1f
mkdir -p %{buildroot}/%{_unitdir}
e24e1f
install -p -D -m 0644 etc/systemd/exabgp.service %{buildroot}/%{_unitdir}/exabgp.service
174563
e24e1f
mkdir -p %{buildroot}/%{_mandir}/man1
174563
install doc/man/exabgp.1 %{buildroot}/%{_mandir}/man1
174563
e24e1f
mkdir -p %{buildroot}/%{_mandir}/man5
174563
install doc/man/exabgp.conf.5 %{buildroot}/%{_mandir}/man5
174563
e24e1f
%post -n %{name}
174563
%systemd_post exabgp.service
174563
e24e1f
%preun -n %{name}
174563
%systemd_preun exabgp.service
174563
e24e1f
%postun -n %{name}
174563
%systemd_postun_with_restart exabgp.service
174563
e24e1f
%files -n python2-%{srcname}
174563
%{python2_sitelib}/*
e24e1f
%defattr(-,root,root,-)
174563
%doc CHANGELOG README.md
174563
%license COPYRIGHT
e24e1f
%{_unitdir}/exabgp.service
e24e1f
%{_sbindir}/exabgp
174563
%dir %{_libdir}/exabgp
174563
%dir %{_datadir}/exabgp
174563
%dir %{_datadir}/exabgp/processes
174563
%dir %{_sysconfdir}/exabgp
174563
%attr(744, root, root) %{_datadir}/exabgp/processes/*
e24e1f
%{_mandir}/man1/*
e24e1f
%{_mandir}/man5/*
174563
e24e1f
%if 0%{?with_python3}
e24e1f
%files -n python3-%{srcname}
e24e1f
%{python3_sitelib}/*
e24e1f
%defattr(-,root,root,-)
174563
%doc CHANGELOG README.md
174563
%license COPYRIGHT
e24e1f
%attr(755, root, root) %{_sbindir}/exabgp-healthcheck
e24e1f
%{_unitdir}/exabgp.service
e24e1f
%{_sbindir}/exabgp
e24e1f
%dir %{_libdir}/exabgp
e24e1f
%dir %{_datadir}/exabgp
e24e1f
%dir %{_datadir}/exabgp/processes
e24e1f
%dir %{_sysconfdir}/exabgp
e24e1f
%attr(744, root, root) %{_datadir}/exabgp/processes/*
174563
%{_mandir}/man1/*
174563
%{_mandir}/man5/*
318b18
%endif
174563
174563
%changelog
e24e1f
* Fri Jul 07 2017 Luke Hinds <lhinds@redhat.com> - 4.0.1
e24e1f
- 4.0.1 release, and python 3 support
174563
* Fri May 19 2017 Luke Hinds <lhinds@redhat.com> - 4.0.0
174563
- Initial release