]> git.pld-linux.org Git - packages/python-urllib3.git/blame - python-urllib3.spec
- new, version 1.6
[packages/python-urllib3.git] / python-urllib3.spec
CommitLineData
f980972e
ŁK
1# Conditional build:
2%bcond_without python2 # build python 2 module
3%bcond_without python3 # build python 3 module
4#
5%define module urllib3
6Summary: HTTP library with thread-safe connection pooling, file post, and more
7Name: python-%{module}
8Version: 1.6
9Release: 1
10License: MIT
11Group: Development/Languages/Python
12Source0: https://pypi.python.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
13# Source0-md5: 8ee95b963e151aba80de90ad1cc55487
14URL: http://urllib3.readthedocs.org/
15%if %{with python2}
16BuildRequires: python-modules >= 1:2.7
17%endif
18%if %{with python3}
19BuildRequires: python3-modules >= 3.2
20%endif
21BuildRequires: rpm-pythonprov
22BuildRequires: rpmbuild(macros) >= 1.219
23Requires: python-modules >= 1:2.7
24BuildArch: noarch
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%description
28Python HTTP module with connection pooling and file POST abilities.
29Features are:
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.
36
37%package -n python3-urllib3
38Summary: HTTP library with thread-safe connection pooling, file post, and more
39Group: Development/Languages/Python
40Requires: python3-modules >= 3.2
41
42%description -n python3-urllib3
43Python HTTP module with connection pooling and file POST abilities.
44Features are:
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.
51
52%prep
53%setup -q -n %{module}-%{version}
54
55%build
56%if %{with python2}
57%{__python} setup.py build -b py2
58%endif
59
60%if %{with python3}
61%{__python3} setup.py build -b py3
62%endif
63
64%install
65rm -rf $RPM_BUILD_ROOT
66
67%if %{with python2}
68%{__python} setup.py \
69 build -b py2 \
70 install \
71 --skip-build \
72 --optimize=2 \
73 --root=$RPM_BUILD_ROOT
74%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
75%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
76%py_postclean
77%endif
78
79%if %{with python3}
80%{__python3} setup.py \
81 build -b py3 \
82 install \
83 --skip-build \
84 --optimize=2 \
85 --root=$RPM_BUILD_ROOT
86%endif
87
88# dummyserver is a part of unitstests
89%{__rm} -rf $RPM_BUILD_ROOT%{py_sitescriptdir}/dummyserver \
90 $RPM_BUILD_ROOT%{py3_sitescriptdir}/dummyserver
91
92%clean
93rm -rf $RPM_BUILD_ROOT
94
95%if %{with python2}
96%files
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
102%endif
103%endif
104
105%if %{with python3}
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
111%endif
This page took 0.076944 seconds and 4 git commands to generate.