# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define name python3-httplib2 %define srcname httplib2 %define version 0.15.0 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: A comprehensive HTTP client library. Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: MIT Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: Joe Gregorio Url: http://code.google.com/p/httplib2/ %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. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then nosetest-3 || true fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc PKG-INFO README.md %{python_sitelib}/* %changelog * Mon Jan 06 2020 Harshita Jain -0.15.0-1 - Update the latest version - Build with python3 * Thu Jul 24 2013 Tristan Delhalle - 0.8.1-1 - first version for AIX V6.1 and higher