%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 13 %global python_major python%{py_major} %global pkgname httplib2 %global meta_package python3-%{pkgname} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") Name: %{python_major}-%{pkgname} Version: 0.15.0 Release: 2 Summary: A comprehensive HTTP client library. License: MIT URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/h/%{pkgname}/%{pkgname}-%{version}.tar.gz BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description A comprehensive HTTP client library, ``httplib2`` supports many features left out of other HTTP libraries. **HTTP and HTTPS** HTTPS support is only available if the socket module was compiled with SSL support. **Keep-Alive** Supports HTTP 1.1 Keep-Alive, keeping the socket open and performing multiple requests over the same connection if possible. **Authentication** The following three types of HTTP Authentication are supported. These can be used over both HTTP and HTTPS. * Digest * Basic * WSSE **Caching** The module can optionally operate with a private cache that understands the Cache-Control: header and uses both the ETag and Last-Modified cache validators. Both file system and memcached based caches are supported. **All Methods** The module can handle any HTTP request method, not just GET and POST. **Redirects** Automatically follows 3XX redirects on GETs. **Compression** Handles both 'deflate' and 'gzip' types of compression. **Lost update support** Automatically adds back ETags into PUT requests to resources we have already cached. This implements Section 3.2 of Detecting the Lost Update Problem Using Unreserved Checkout **Unit Tested** A large and growing set of unit tests. %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major} Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{pkgname}-%{version} %build export PATH=/opt/freeware/bin:$PATH %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} %check %if %{with dotests} #python3 -m venv python_venv #. ./python_venv/bin/activate #pip3 install pytest #pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited #ulimit -m unlimited # ulimit -f unlimited #( python runtests.py -m 'full' -v || true ) #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc PKG-INFO README.md LICENSE %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) %changelog * Thu Dec 29 2022 Aditya Kamath - 0.15.0-2 - httplib2 for python3.9