]>
Commit | Line | Data |
---|---|---|
fb337b23 | 1 | # TODO: use system six, [backports.]ssl_match_hostname |
d1b278cf | 2 | # |
f980972e | 3 | # Conditional build: |
d1b278cf JB |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
1cbae8fc | 6 | %bcond_without doc # Sphinx documentation |
fb337b23 | 7 | %bcond_with tests # test target (uses network etc.) |
5381b073 ER |
8 | |
9 | %define module urllib3 | |
f980972e | 10 | Summary: HTTP library with thread-safe connection pooling, file post, and more |
d1b278cf | 11 | Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd. |
f980972e | 12 | Name: python-%{module} |
2ea5dcd4 JB |
13 | Version: 1.25.7 |
14 | Release: 1 | |
f980972e ŁK |
15 | License: MIT |
16 | Group: Development/Languages/Python | |
70df9369 | 17 | #Source0Download: https://pypi.org/simple/urllib3/ |
1cbae8fc | 18 | Source0: https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz |
2ea5dcd4 | 19 | # Source0-md5: 85e1e3925f8c1095172bff343f3312ed |
70df9369 | 20 | Patch0: %{name}-mock.patch |
f980972e ŁK |
21 | URL: http://urllib3.readthedocs.org/ |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.7 | |
fb337b23 JB |
24 | %if %{with tests} |
25 | BuildRequires: python-PySocks >= 1.5.6 | |
26 | BuildRequires: python-PySocks < 2.0 | |
27 | BuildRequires: python-mock | |
28 | BuildRequires: python-nose | |
29 | BuildRequires: python-tornado | |
30 | # SO_REUSEPORT option | |
31 | BuildRequires: uname(release) >= 3.9 | |
32 | %endif | |
f980972e ŁK |
33 | %endif |
34 | %if %{with python3} | |
1cbae8fc | 35 | BuildRequires: python3-modules >= 1:3.4 |
fb337b23 JB |
36 | %if %{with tests} |
37 | BuildRequires: python3-PySocks >= 1.5.6 | |
38 | BuildRequires: python3-PySocks < 2.0 | |
39 | BuildRequires: python3-nose | |
40 | BuildRequires: python3-tornado | |
41 | # SO_REUSEPORT option | |
42 | BuildRequires: uname(release) >= 3.9 | |
43 | %endif | |
f980972e ŁK |
44 | %endif |
45 | BuildRequires: rpm-pythonprov | |
fb337b23 | 46 | BuildRequires: rpmbuild(macros) >= 1.714 |
1cbae8fc | 47 | %if %{with doc} |
2ea5dcd4 | 48 | BuildRequires: python3-alabaster |
70df9369 | 49 | BuildRequires: sphinx-pdg-3 |
1cbae8fc | 50 | %endif |
f980972e ŁK |
51 | Requires: python-modules >= 1:2.7 |
52 | BuildArch: noarch | |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
d1b278cf | 56 | Python 2 HTTP module with connection pooling and file POST abilities. |
f980972e ŁK |
57 | Features are: |
58 | - Re-use the same socket connection for multiple requests (with | |
59 | optional client-side certificate verification). | |
60 | - File posting (encode_multipart_formdata). | |
61 | - Built-in redirection and retries (optional). | |
62 | - Supports gzip and deflate decoding. | |
63 | - Thread-safe and sanity-safe. | |
64 | ||
d1b278cf JB |
65 | %description -l pl.UTF-8 |
66 | Moduł HTTP dla Pythona 2 z pulą połączeń i możliwością wysyłania | |
67 | plików metodą POST. Możliwości: | |
68 | - używanie tego samego połączenia dla wielu żądań (z opcjonalną | |
69 | weryfikacją certyfikatu po stronie klienta) | |
70 | - wysyłanie plików (encode_multipart_formdata) | |
71 | - wbudowane przekierowania i ponawianie prób (opcjonalne) | |
72 | - obsługa kodowań gzip i deflate | |
73 | - bezpieczeństwo względem wątków. | |
74 | ||
f980972e ŁK |
75 | %package -n python3-urllib3 |
76 | Summary: HTTP library with thread-safe connection pooling, file post, and more | |
d1b278cf | 77 | Summary(pl.UTF-8): Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd. |
f980972e | 78 | Group: Development/Languages/Python |
1cbae8fc | 79 | Requires: python3-modules >= 1:3.4 |
f980972e ŁK |
80 | |
81 | %description -n python3-urllib3 | |
d1b278cf | 82 | Python 3 HTTP module with connection pooling and file POST abilities. |
f980972e ŁK |
83 | Features are: |
84 | - Re-use the same socket connection for multiple requests (with | |
85 | optional client-side certificate verification). | |
86 | - File posting (encode_multipart_formdata). | |
87 | - Built-in redirection and retries (optional). | |
88 | - Supports gzip and deflate decoding. | |
89 | - Thread-safe and sanity-safe. | |
90 | ||
d1b278cf JB |
91 | %description -n python3-urllib3 -l pl.UTF-8 |
92 | Moduł HTTP dla Pythona 3 z pulą połączeń i możliwością wysyłania | |
93 | plików metodą POST. Możliwości: | |
94 | - używanie tego samego połączenia dla wielu żądań (z opcjonalną | |
95 | weryfikacją certyfikatu po stronie klienta) | |
96 | - wysyłanie plików (encode_multipart_formdata) | |
97 | - wbudowane przekierowania i ponawianie prób (opcjonalne) | |
98 | - obsługa kodowań gzip i deflate | |
99 | - bezpieczeństwo względem wątków. | |
100 | ||
1cbae8fc JB |
101 | %package apidocs |
102 | Summary: API documentation for Python urllib3 module | |
103 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona urllib3 | |
104 | Group: Documentation | |
105 | ||
106 | %description apidocs | |
107 | API documentation for Python urllib3 module. | |
108 | ||
109 | %description apidocs -l pl.UTF-8 | |
110 | Dokumentacja API modułu Pythona urllib3. | |
111 | ||
f980972e ŁK |
112 | %prep |
113 | %setup -q -n %{module}-%{version} | |
70df9369 | 114 | %patch0 -p1 |
f980972e ŁK |
115 | |
116 | %build | |
117 | %if %{with python2} | |
fb337b23 | 118 | %py_build %{?with_tests:test} |
f980972e ŁK |
119 | %endif |
120 | ||
121 | %if %{with python3} | |
fb337b23 | 122 | %py3_build %{?with_tests:test} |
f980972e ŁK |
123 | %endif |
124 | ||
1cbae8fc | 125 | %if %{with doc} |
ad572b13 | 126 | %{__make} -C docs html \ |
70df9369 | 127 | SPHINXBUILD=sphinx-build-3 \ |
ad572b13 | 128 | SPHINXOPTS= |
1cbae8fc JB |
129 | %endif |
130 | ||
f980972e ŁK |
131 | %install |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
134 | %if %{with python2} | |
fb337b23 | 135 | %py_install |
f980972e ŁK |
136 | %py_postclean |
137 | %endif | |
138 | ||
139 | %if %{with python3} | |
fb337b23 | 140 | %py3_install |
fb337b23 | 141 | %endif |
f980972e ŁK |
142 | |
143 | %clean | |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | ||
146 | %if %{with python2} | |
147 | %files | |
148 | %defattr(644,root,root,755) | |
fb337b23 | 149 | %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst |
f980972e | 150 | %{py_sitescriptdir}/%{module} |
f980972e ŁK |
151 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
152 | %endif | |
f980972e ŁK |
153 | |
154 | %if %{with python3} | |
155 | %files -n python3-urllib3 | |
156 | %defattr(644,root,root,755) | |
fb337b23 | 157 | %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst |
f980972e ŁK |
158 | %{py3_sitescriptdir}/%{module} |
159 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
160 | %endif | |
1cbae8fc JB |
161 | |
162 | %if %{with doc} | |
163 | %files apidocs | |
164 | %defattr(644,root,root,755) | |
165 | %doc docs/_build/html/{_static,reference,*.html,*.js} | |
166 | %endif |