%global srcname bareos %global bareos_version 17.2.5 %bcond_without python2 %bcond_without python3 Name: python-%{srcname} Version: 0.4.0 Release: 1%{?dist} Summary: Backup Archiving REcovery Open Sourced - Python module License: AGPL-3.0 URL: http://www.bareos.org/ Source0: https://github.com/%{srcname}/%{name}/archive/Release/%{bareos_version}.tar.gz#/%{name}-Release-%{bareos_version}.tar.gz Patch0: %{name}-version-fix.patch BuildArch: noarch %description Bareos - Backup Archiving Recovery Open Sourced - Python module This packages contains a python module to interact with a Bareos backup system. It also includes some tools based on this module. %if %{with python2} %package -n python2-%{srcname} Summary: %{summary} Requires: python-dateutil BuildRequires: python-dateutil BuildRequires: python-devel BuildRequires: python-setuptools %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Bareos - Backup Archiving Recovery Open Sourced - Python module This packages contains a python module to interact with a Bareos backup system. It also includes some tools based on this module. %endif %if %{with python3} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} Requires: python%{python3_pkgversion}-dateutil BuildRequires: python%{python3_pkgversion}-dateutil BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} Bareos - Backup Archiving Recovery Open Sourced - Python module This packages contains a python module to interact with a Bareos backup system. It also includes some tools based on this module. %endif %prep %setup -q -n %{name}-Release-%{bareos_version} %patch0 -p1 %build %{?with_python2:%py2_build} %{?with_python3:%py3_build} %install %{?with_python2:%py2_install} %{?with_python3:%py3_install} %check %{?with_python2:%{__python2} setup.py test} %{?with_python3:%{__python3} setup.py test} %files %{_bindir}/bareos-fd-connect.py %{_bindir}/bconsole-json.py %{_bindir}/bconsole.py %if %{with python2} %files -n python2-%{srcname} %{python2_sitelib}/%{srcname} %{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info %endif %if %{with python3} %files -n python%{python3_pkgversion}-%{srcname} %{python3_sitelib}/%{srcname} %{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info %endif %changelog * Fri Aug 10 2018 Daniel Uvehag - 0.4.0-1 - Initial package based on Bareos 17.2.5