f0ee712
%if 0%{?fedora} >= 30
f0ee712
# disabled by default
f0ee712
%bcond_with py2
f0ee712
%else
f0ee712
%bcond_without py2
f0ee712
%endif
f0ee712
f0ee712
# disabled to begin with
f0ee712
%bcond_with tests
f0ee712
f0ee712
%global pypi_name xnat
f0ee712
%global desc %{expand: \
f0ee712
A new XNAT client that exposes XNAT objects/functions as python objects/functions.
f0ee712
The aim is to abstract as much of the REST API away as possible and make xnatpy feel
f0ee712
like native Python code. This reduces the need for the user to know the details
f0ee712
of the REST API. Low level functionality can still be accessed via the connection object
f0ee712
which has get, head, put, post, delete methods for more directly calling the REST API.}
f0ee712
f0ee712
Name:           python-%{pypi_name}
f0ee712
Version:        0.3.11
f0ee712
Release:        1%{?dist}
f0ee712
Summary:        A new XNAT client that exposes XNAT objects/functions as python objects/functions.
f0ee712
License:        ASL 2.0
f0ee712
URL:            http://pypi.python.org/pypi/%{pypi_name}/%{version}
f0ee712
Source0:        https://pypi.python.org/packages/source/x/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
f0ee712
BuildArch:      noarch
f0ee712
f0ee712
%description
f0ee712
%{desc}
f0ee712
f0ee712
%if %{with py2}
f0ee712
%package -n python2-%{pypi_name}
f0ee712
Summary:        %{summary}
f0ee712
f0ee712
BuildRequires:  python2-devel
f0ee712
BuildRequires:  python2-setuptools
f0ee712
Requires:       python2-isodate
f0ee712
Requires:       python2-requests
f0ee712
Requires:       python2-progressbar2
f0ee712
Requires:       python2-sphinx_rtd_theme
f0ee712
Requires:       python2-six
f0ee712
f0ee712
%{?python_provide:%python_provide python2-%{pypi_name}}
f0ee712
f0ee712
%description -n python2-%{pypi_name}
f0ee712
%{desc}
f0ee712
%endif
f0ee712
f0ee712
%package -n python3-%{pypi_name}
f0ee712
Summary:        %{summary}
f0ee712
f0ee712
BuildRequires:  python3-devel
f0ee712
BuildRequires:  python3-setuptools
f0ee712
Requires:       python3-isodate
f0ee712
Requires:       python3-requests
f0ee712
Requires:       python3-progressbar2
f0ee712
Requires:       python3-sphinx_rtd_theme
f0ee712
Requires:       python3-six
f0ee712
f0ee712
%{?python_provide:%python_provide python3-%{pypi_name}}
f0ee712
f0ee712
%description -n python3-%{pypi_name}
f0ee712
%{desc}
f0ee712
f0ee712
%prep
f0ee712
%autosetup -n %{pypi_name}-%{version}
f0ee712
rm -rf %{pypi_name}.egg-info
f0ee712
f0ee712
%build
f0ee712
%py3_build
f0ee712
%if %{with py2}
f0ee712
%py2_build
f0ee712
%endif
f0ee712
f0ee712
%install
f0ee712
%if %{with py2}
f0ee712
%py2_install
f0ee712
%endif
f0ee712
%py3_install
f0ee712
f0ee712
%check
f0ee712
%if %{with tests}
f0ee712
%if %{with py2}
f0ee712
%{__python2} setup.py test
f0ee712
%endif
f0ee712
%{__python3} setup.py test
f0ee712
%endif
f0ee712
 
f0ee712
%if %{with py2}
f0ee712
%files -n python2-%{pypi_name}
f0ee712
%license LICENSE
f0ee712
%doc README
f0ee712
%{_bindir}/xnat_cp_project
f0ee712
%{python2_sitelib}/%{pypi_name}-%{version}-py2.?.egg-info
f0ee712
%{python2_sitelib}/%{pypi_name}
f0ee712
%endif
f0ee712
f0ee712
%files -n python3-%{pypi_name}
f0ee712
%license LICENSE
f0ee712
%doc README
f0ee712
%{_bindir}/xnat_cp_project
f0ee712
%{python3_sitelib}/xnat/
f0ee712
%{python3_sitelib}/xnat*.egg-info
f0ee712
f0ee712
%changelog
f0ee712
* Mon Nov 19 2018 Luis Bazan <lbazan@fedoraproject.org> - 0.3.11-1
f0ee712
- New upstream