From 4c398f2b2e6781872fda5709df4a5c649ec16b89 Mon Sep 17 00:00:00 2001 From: Luis Bazan Date: Nov 29 2018 14:52:33 +0000 Subject: use template of neuro-sig --- diff --git a/python-xnat.spec b/python-xnat.spec index 243974e..15a6cd8 100644 --- a/python-xnat.spec +++ b/python-xnat.spec @@ -1,52 +1,100 @@ +%if 0%{?fedora} >= 30 +# disabled by default +%bcond_with py2 +%else +%bcond_without py2 +%endif + +%bcond_without tests + %global pypi_name xnat +%global desc %{expand: \ +A new XNAT client that exposes XNAT objects/functions as python objects/functions. +The aim is to abstract as much of the REST API away as possible and make xnatpy feel +like native Python code. This reduces the need for the user to know the details +of the REST API. Low level functionality can still be accessed via the connection object +which has get, head, put, post, delete methods for more directly calling the REST API.} Name: python-%{pypi_name} Version: 0.3.11 -Release: 2%{?dist} +Release: 1%{?dist} Summary: A new XNAT client that exposes XNAT objects/functions as python objects/functions. License: ASL 2.0 URL: http://pypi.python.org/pypi/%{pypi_name}/%{version} Source0: https://pypi.python.org/packages/source/x/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch -BuildRequires: python3-devel -BuildRequires: python3-setuptools -Requires: python3-isodate -Requires: python3-requests -Requires: python3-progressbar2 -Requires: python3-sphinx_rtd_theme -Requires: python3-six - %description -A new XNAT client that exposes XNAT objects/functions as python objects/functions. -The aim is to abstract as much of the REST API away as possible and make xnatpy feel -like native Python code. This reduces the need for the user to know the details -of the REST API. Low level functionality can still be accessed via the connection object -which has get, head, put, post, delete methods for more directly calling the REST API. +%{desc} + +%if %{with py2} +%package -n python2-%{pypi_name} +Summary: %{summary} + +BuildRequires: python2-devel +BuildRequires: python2-setuptools +BuildRequires: python2-isodate +BuildRequires: python2-requests +#BuildRequires: python2-progressbar2 +BuildRequires: python2-sphinx_rtd_theme +BuildRequires: python2-six + +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} +%{desc} +%endif %package -n python3-%{pypi_name} +Summary: %{summary} + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-isodate +BuildRequires: python3-requests +BuildRequires: python3-utils +#BuildRequires: python3-progressbar2 +BuildRequires: python3-sphinx_rtd_theme +BuildRequires: python3-six -Summary: %{summary} - Python 3 version %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{pypi_name} -A new XNAT client that exposes XNAT objects/functions as python objects/functions. -The aim is to abstract as much of the REST API away as possible and make xnatpy feel -like native Python code. This reduces the need for the user to know the details -of the REST API. Low level functionality can still be accessed via the connection object -which has get, head, put, post, delete methods for more directly calling the REST API. +%{desc} %prep %autosetup -n %{pypi_name}-%{version} -# Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py3_build +%if %{with py2} +%py2_build +%endif %install +%if %{with py2} +%py2_install +%endif %py3_install + +%check +%if %{with tests} +%if %{with py2} +%{__python2} setup.py test +%endif +%{__python3} setup.py test +%endif +%if %{with py2} +%files -n python2-%{pypi_name} +%license LICENSE +%doc README +%{_bindir}/xnat_cp_project +%{python2_sitelib}/%{pypi_name}-%{version}-py2.?.egg-info +%{python2_sitelib}/%{pypi_name} +%endif + %files -n python3-%{pypi_name} %license LICENSE %doc README @@ -55,8 +103,9 @@ rm -rf %{pypi_name}.egg-info %{python3_sitelib}/xnat*.egg-info %changelog -* Tue Nov 20 2018 Luis Bazan - 0.3.11-2 -- Add remove bundled egg info +%changelog +* Thu Nov 29 2018 Luis Bazan - 0.3.11-2 +- Use template of neuro-sig * Mon Nov 19 2018 Luis Bazan - 0.3.11-1 - New upstream