2 %bcond_without python2 # build python 2 module
3 %bcond_without python3 # build python 3 module
6 Summary: HTTP library with thread-safe connection pooling, file post, and more
11 Group: Development/Languages/Python
12 Source0: https://pypi.python.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
13 # Source0-md5: 8ee95b963e151aba80de90ad1cc55487
14 URL: http://urllib3.readthedocs.org/
16 BuildRequires: python-modules >= 1:2.7
19 BuildRequires: python3-modules >= 3.2
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.219
23 Requires: python-modules >= 1:2.7
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 Python HTTP module with connection pooling and file POST abilities.
30 - Re-use the same socket connection for multiple requests (with
31 optional client-side certificate verification).
32 - File posting (encode_multipart_formdata).
33 - Built-in redirection and retries (optional).
34 - Supports gzip and deflate decoding.
35 - Thread-safe and sanity-safe.
37 %package -n python3-urllib3
38 Summary: HTTP library with thread-safe connection pooling, file post, and more
39 Group: Development/Languages/Python
40 Requires: python3-modules >= 3.2
42 %description -n python3-urllib3
43 Python HTTP module with connection pooling and file POST abilities.
45 - Re-use the same socket connection for multiple requests (with
46 optional client-side certificate verification).
47 - File posting (encode_multipart_formdata).
48 - Built-in redirection and retries (optional).
49 - Supports gzip and deflate decoding.
50 - Thread-safe and sanity-safe.
53 %setup -q -n %{module}-%{version}
57 %{__python} setup.py build -b py2
61 %{__python3} setup.py build -b py3
65 rm -rf $RPM_BUILD_ROOT
68 %{__python} setup.py \
73 --root=$RPM_BUILD_ROOT
74 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
75 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
80 %{__python3} setup.py \
85 --root=$RPM_BUILD_ROOT
88 # dummyserver is a part of unitstests
89 %{__rm} -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/dummyserver \
90 $RPM_BUILD_ROOT%{py3_sitescriptdir}/dummyserver
93 rm -rf $RPM_BUILD_ROOT
97 %defattr(644,root,root,755)
98 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
99 %{py_sitescriptdir}/%{module}
100 %if "%{py_ver}" > "2.4"
101 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
106 %files -n python3-urllib3
107 %defattr(644,root,root,755)
108 %doc CHANGES.rst CONTRIBUTORS.txt README.rst
109 %{py3_sitescriptdir}/%{module}
110 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info