348ffa
%if 0%{?rhel} && 0%{?rhel} <= 7
348ffa
%bcond_with python3
348ffa
# Minimum nose version is 1.3.3, while EL7 has 1.3.0
348ffa
%bcond_with tests
348ffa
%else
348ffa
%bcond_without python3
348ffa
%bcond_without tests
348ffa
%endif
348ffa
348ffa
%global pypi_name s3transfer
348ffa
348ffa
%global bundled_lib_dir    bundled
348ffa
# python-futures
348ffa
%global futures_version    3.0.3
348ffa
%global futures_dir        %{bundled_lib_dir}/futures
348ffa
# python-botocore
348ffa
%global botocore_version   1.8.35
348ffa
%global botocore_dir       %{bundled_lib_dir}/botocore
348ffa
# python-jmespath
348ffa
%global jmespath_version   0.9.0
348ffa
%global jmespath_dir       %{bundled_lib_dir}/jmespath
348ffa
348ffa
Name:           python-%{pypi_name}
348ffa
Version:        0.1.10
348ffa
Release:        8%{?dist}
348ffa
Summary:        An Amazon S3 Transfer Manager
348ffa
348ffa
License:        ASL 2.0
348ffa
URL:            https://github.com/boto/s3transfer
348ffa
Source0:        %{pypi_name}-%{version}.tar.gz
348ffa
Source1:        https://pypi.python.org/packages/source/f/futures/futures-%{futures_version}.tar.gz
348ffa
Source2:        https://pypi.io/packages/source/b/botocore/botocore-%{botocore_version}.tar.gz
348ffa
Source3:        https://pypi.python.org/packages/source/j/jmespath/jmespath-%{jmespath_version}.tar.gz
348ffa
Patch0:         bundled-futures-botocore-jmespath.patch
348ffa
Patch1:         botocore-1.8.35-fix_dateutil_version.patch
348ffa
348ffa
BuildArch:      noarch
348ffa
348ffa
BuildRequires:  python-devel
348ffa
BuildRequires:  python-setuptools
348ffa
%if %{with tests}
348ffa
BuildRequires:  python-nose
348ffa
BuildRequires:  python-mock
348ffa
BuildRequires:  python-wheel
348ffa
BuildRequires:  python-botocore
348ffa
BuildRequires:  python-coverage
348ffa
BuildRequires:  python-unittest2
348ffa
%endif # tests
348ffa
# python-futures bundle
348ffa
#Requires:       python-futures
348ffa
# python-botocore bundle
348ffa
#Requires:       python-botocore
348ffa
348ffa
# python-futures bundle
348ffa
Provides:       bundled(python-futures) = %{futures_version}
348ffa
# python-botocore bundle
348ffa
Provides:       bundled(python-botocore) = %{botocore_version}
348ffa
# python-jmespath bundle
348ffa
#Requires:       python-jmespath >= 0.7.1
348ffa
Provides:       bundled(python-jmespath) = %{jmespath_version}
348ffa
Requires:       python-dateutil >= 1.4
348ffa
Requires:       python-docutils >= 0.10
348ffa
348ffa
%description
348ffa
S3transfer is a Python library for managing Amazon S3 transfers.
348ffa
348ffa
%if %{with python3}
348ffa
%package -n     python3-%{pypi_name}
348ffa
Summary:        An Amazon S3 Transfer Manager
348ffa
BuildRequires:  python3-devel
348ffa
BuildRequires:  python3-setuptools
348ffa
%if %{with tests}
348ffa
BuildRequires:  python3-nose
348ffa
BuildRequires:  python3-mock
348ffa
BuildRequires:  python3-wheel
348ffa
BuildRequires:  python3-botocore
348ffa
BuildRequires:  python3-coverage
348ffa
BuildRequires:  python3-unittest2
348ffa
%endif # tests
348ffa
Requires:       python3-botocore
348ffa
%{?python_provide:%python_provide python3-%{pypi_name}}
348ffa
348ffa
%description -n python3-%{pypi_name}
348ffa
S3transfer is a Python library for managing Amazon S3 transfers.
348ffa
%endif # python3
348ffa
348ffa
%prep
348ffa
%setup -q -n %{pypi_name}-%{version}
348ffa
# Remove online tests (see https://github.com/boto/s3transfer/issues/8)
348ffa
rm -rf tests/integration
348ffa
348ffa
# bundles
348ffa
mkdir -p %{bundled_lib_dir}
348ffa
348ffa
# python-futures bundle
348ffa
tar -xzf %SOURCE1 -C %{bundled_lib_dir}
348ffa
mv %{bundled_lib_dir}/futures-%{futures_version} %{futures_dir}
348ffa
cp %{futures_dir}/LICENSE futures_LICENSE
348ffa
348ffa
# python-botocore bundle
348ffa
tar -xzf %SOURCE2 -C %{bundled_lib_dir}
348ffa
mv %{bundled_lib_dir}/botocore-%{botocore_version} %{botocore_dir}
348ffa
cp %{botocore_dir}/LICENSE.txt botocore_LICENSE.txt
348ffa
cp %{botocore_dir}/README.rst botocore_README.rst
348ffa
348ffa
# python-jmespath bundle
348ffa
tar -xzf %SOURCE3 -C %{bundled_lib_dir}
348ffa
mv %{bundled_lib_dir}/jmespath-%{jmespath_version} %{jmespath_dir}
348ffa
cp %{botocore_dir}/LICENSE.txt jmespath_LICENSE.txt
348ffa
cp %{botocore_dir}/README.rst jmespath_README.rst
348ffa
348ffa
# append bundled-directory to search path
348ffa
%patch0 -p1
348ffa
348ffa
pushd %{botocore_dir}
348ffa
%patch1 -p1
348ffa
sed -i -e '1 d' botocore/vendored/requests/packages/chardet/chardetect.py
348ffa
sed -i -e '1 d' botocore/vendored/requests/certs.py
348ffa
rm -rf botocore.egg-info
348ffa
# Remove online tests
348ffa
rm -rf tests/integration
348ffa
popd
348ffa
348ffa
pushd %{jmespath_dir}
348ffa
rm -rf jmespath.egg-info
348ffa
popd
348ffa
348ffa
%build
348ffa
%py2_build
348ffa
%if %{with python3}
348ffa
%py3_build
348ffa
%endif # python3
348ffa
348ffa
# python-futures bundle
348ffa
pushd %{futures_dir}
348ffa
%{__python2} setup.py build
348ffa
popd
348ffa
348ffa
# python-botocore bundle
348ffa
pushd %{botocore_dir}
348ffa
%{__python2} setup.py build
348ffa
popd
348ffa
348ffa
# python-jmespath bundle
348ffa
pushd %{jmespath_dir}
348ffa
CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} build --executable="%{__python2} -s"
348ffa
popd
348ffa
348ffa
%install
348ffa
%py2_install
348ffa
%if %{with python3}
348ffa
%py3_install
348ffa
%endif # python3
348ffa
348ffa
# python-futures bundle
348ffa
pushd %{futures_dir}
348ffa
%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_libdir}/fence-agents/bundled
348ffa
popd
348ffa
348ffa
# python-botocore bundle
348ffa
pushd %{botocore_dir}
348ffa
%{__python2} setup.py install -O1 --skip-build --root %{buildroot} --install-lib %{_libdir}/fence-agents/bundled
348ffa
popd
348ffa
348ffa
# python-jmespath bundle
348ffa
pushd %{jmespath_dir}
348ffa
CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} --install-lib %{_libdir}/fence-agents/bundled
348ffa
mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python2_version}
348ffa
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2
348ffa
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py
348ffa
popd
348ffa
348ffa
%if %{with tests}
348ffa
%check
348ffa
nosetests-%{python2_version} --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/
348ffa
%if %{with python3}
348ffa
nosetests-%{python3_version} --with-coverage --cover-erase --cover-package s3transfer --with-xunit --cover-xml -v tests/unit/ tests/functional/
348ffa
%endif # python3
348ffa
%endif # tests
348ffa
348ffa
%files -n python-%{pypi_name} 
348ffa
%{!?_licensedir:%global license %doc}
348ffa
%doc README.rst botocore_README.rst jmespath_README.rst
348ffa
%license LICENSE.txt futures_LICENSE botocore_LICENSE.txt jmespath_LICENSE.txt
348ffa
%{python_sitelib}/%{pypi_name}
348ffa
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
348ffa
# python-futures and python-botocore bundles
348ffa
%{_libdir}/fence-agents/bundled
348ffa
%exclude %{_bindir}/jp.py*
348ffa
348ffa
%if %{with python3}
348ffa
%files -n python3-%{pypi_name} 
348ffa
%doc README.rst
348ffa
%license LICENSE.txt
348ffa
%{python3_sitelib}/%{pypi_name}
348ffa
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
348ffa
%endif # python3
348ffa
348ffa
%changelog
348ffa
* Mon Feb 12 2018 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.1.10-8
348ffa
- Bundle python-futures, python-botocore and python-jmespath
348ffa
348ffa
  Resolves: rhbz#1509441
348ffa
348ffa
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.10-3
348ffa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
348ffa
348ffa
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.10-2
348ffa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
348ffa
348ffa
* Wed Dec 28 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.10-1
348ffa
- Update to 0.1.10
348ffa
348ffa
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.1.9-2
348ffa
- Rebuild for Python 3.6
348ffa
348ffa
* Thu Oct 27 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.9-1
348ffa
- Update to 0.1.9
348ffa
348ffa
* Mon Oct 10 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.7-1
348ffa
- Uodate to 0.1.7
348ffa
348ffa
* Sun Oct 02 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.5-1
348ffa
- Update to 0.1.5
348ffa
348ffa
* Wed Sep 28 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.4-1
348ffa
- Update to 0.1.4
348ffa
348ffa
* Wed Sep 07 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.3-1
348ffa
- Update to 0.1.3
348ffa
348ffa
* Thu Aug 04 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.1-1
348ffa
- Update to 0.1.1
348ffa
348ffa
* Tue Aug 02 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.0-1
348ffa
- Update to 0.1.0
348ffa
348ffa
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.1-4
348ffa
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
348ffa
348ffa
* Wed Feb 24 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.0.1-3
348ffa
- Cleanup the spec a little bit
348ffa
- Remove patch
348ffa
348ffa
* Tue Feb 23 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.0.1-2
348ffa
- Add patch to remove tests needing web connection
348ffa
348ffa
* Tue Feb 23 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.0.1-1
348ffa
- Initial package.