Improve spec

i9ce
Fabio Alessandro Locati 8 years ago
parent c54bad665a
commit 5728555460

@ -1,7 +1,10 @@
%if 0%{?rhel}
%global with_python3 0
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
# Minimum nose version is 1.3.3, while EL7 has 1.3.0
%bcond_with tests
%else
%global with_python3 1
%bcond_without python3
%bcond_without tests
%endif
%global pypi_name s3transfer
@ -18,7 +21,7 @@ BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
# The following are for tests
%if %{with tests}
BuildRequires: python-nose
BuildRequires: python-mock
BuildRequires: python-wheel
@ -26,17 +29,7 @@ BuildRequires: python-futures
BuildRequires: python2-botocore
BuildRequires: python-coverage
BuildRequires: python-unittest2
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# The following are for tests
BuildRequires: python3-nose
BuildRequires: python3-mock
BuildRequires: python3-wheel
BuildRequires: python3-botocore
BuildRequires: python3-coverage
BuildRequires: python3-unittest2
%endif # with_python3
%endif # tests
%description
S3transfer is a Python library for managing Amazon S3 transfers.
@ -50,15 +43,25 @@ Requires: python2-botocore
%description -n python2-%{pypi_name}
S3transfer is a Python library for managing Amazon S3 transfers.
%if 0%{?with_python3}
%if %{with python3}
%package -n python3-%{pypi_name}
Summary: An Amazon S3 Transfer Manager
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if %{with tests}
BuildRequires: python3-nose
BuildRequires: python3-mock
BuildRequires: python3-wheel
BuildRequires: python3-botocore
BuildRequires: python3-coverage
BuildRequires: python3-unittest2
%endif # tests
Requires: python3-botocore
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
S3transfer is a Python library for managing Amazon S3 transfers.
%endif # with_python3
%endif # python3
%prep
%setup -q -n %{pypi_name}-%{version}
@ -67,24 +70,23 @@ rm -rf tests/integration
%build
%py2_build
%if 0%{?with_python3}
%if %{with python3}
%py3_build
%endif # with_python3
%endif # python3
%install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%py2_install
%if %{with python3}
%py3_install
%endif # python3
%if %{with tests}
%check
#%{__python2} setup.py test
nosetests-2.7 --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/
%if 0%{?with_python3}
#%{__python3} setup.py test
%{?fc23:nosetests-3.4 --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/}
%{!?fc23:nosetests-3.5 --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/}
%endif # with_python3
nosetests-%{python2_version} --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/
%if %{with python3}
nosetests-%{python3_version} --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/
%endif # python3
%endif # tests
%files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc}
@ -93,13 +95,13 @@ nosetests-2.7 --with-coverage --cover-erase --cover-package s3transfer --with-xu
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%if %{with python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE.txt
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3
%endif # python3
%changelog
* Wed Sep 28 2016 Fabio Alessandro Locati <fale@redhat.com> - 0.1.4-1

Loading…
Cancel
Save