]>
Commit | Line | Data |
---|---|---|
dd8b4942 JR |
1 | # |
2 | # Conditional build: | |
ebcdddb2 | 3 | %bcond_without python2 # Python 2.x module |
dd8b4942 | 4 | %bcond_without python3 # Python 3.x module |
ebcdddb2 JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_without tests # unit tests | |
dd8b4942 | 7 | |
2f9adc1a | 8 | Summary: A comprehensive HTTP client library |
190dfc00 | 9 | Summary(pl.UTF-8): Obszerna biblioteka klienta HTTP |
2f9adc1a | 10 | Name: python-httplib2 |
8625bb39 AM |
11 | Version: 0.17.0 |
12 | Release: 1 | |
2f9adc1a ER |
13 | License: MIT |
14 | Group: Development/Languages/Python | |
ebcdddb2 JB |
15 | #Source0Download: https://github.com/httplib2/httplib2/releases |
16 | # TODO: https://github.com/httplib2/httplib2/archive/v%{version}/httplib2-%{version}.tar.gz | |
5007a437 | 17 | Source0: https://github.com/httplib2/httplib2/archive/v%{version}.tar.gz |
8625bb39 | 18 | # Source0-md5: fbd0b80a32a4cbb1c3c459294e3a1065 |
5007a437 | 19 | Patch0: %{name}.certfile.patch |
b9a87db1 | 20 | Patch1: %{name}-0.9-proxy-http.patch |
ebcdddb2 | 21 | Patch2: %{name}-mock.patch |
5007a437 | 22 | URL: https://github.com/httplib2/httplib2 |
ebcdddb2 JB |
23 | %if %{with python2} |
24 | BuildRequires: python-modules >= 1:2.7 | |
25 | BuildRequires: python-setuptools | |
26 | %if %{with tests} | |
27 | BuildRequires: python-future >= 0.16.0 | |
28 | BuildRequires: python-mock >= 2.0.0 | |
29 | BuildRequires: python-pytest >= 3.2.1 | |
30 | BuildRequires: python-pytest-cov >= 2.5.1 | |
31 | BuildRequires: python-pytest-timeout >= 1.2.0 | |
32 | BuildRequires: python-six >= 1.10.0 | |
33 | %endif | |
34 | %endif | |
dd8b4942 | 35 | %if %{with python3} |
ebcdddb2 JB |
36 | BuildRequires: python3-modules >= 1:3.4 |
37 | BuildRequires: python3-setuptools | |
38 | %if %{with tests} | |
39 | BuildRequires: python3-pytest >= 3.2.1 | |
40 | BuildRequires: python3-pytest-cov >= 2.5.1 | |
41 | BuildRequires: python3-pytest-timeout >= 1.2.0 | |
42 | BuildRequires: python3-six >= 1.10.0 | |
43 | %endif | |
dd8b4942 | 44 | %endif |
a725a8a2 | 45 | BuildRequires: rpm-pythonprov |
ebcdddb2 JB |
46 | BuildRequires: rpmbuild(macros) >= 1.710 |
47 | %if %{with doc} | |
48 | BuildRequires: sphinx-pdg | |
49 | %endif | |
5007a437 | 50 | Requires: ca-certificates |
2f9adc1a ER |
51 | BuildArch: noarch |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
53 | ||
54 | %description | |
55 | A comprehensive HTTP client library, httplib2.py supports many | |
190dfc00 | 56 | features left out of other HTTP libraries. Supports: |
2f9adc1a ER |
57 | - HTTP and HTTPS |
58 | - Keep-Alive | |
59 | - Authentication | |
60 | - Caching | |
61 | - All Methods | |
62 | - Redirects | |
63 | - Compression | |
64 | - Lost update support | |
65 | - Unit Tested | |
66 | ||
190dfc00 JB |
67 | %description -l pl.UTF-8 |
68 | httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele | |
69 | cech pomijanych przez inne biblioteki. Obsługuje: | |
70 | - HTTP i HTTPS | |
71 | - Keep-Alive | |
72 | - uwierzytelnianie | |
73 | - buforowanie | |
74 | - wszystkie metody | |
75 | - przekierowania | |
76 | - kompresję | |
77 | - Lost update | |
78 | - podlega testom jednostkowym. | |
79 | ||
dd8b4942 JR |
80 | %package -n python3-httplib2 |
81 | Summary: A comprehensive HTTP client library | |
82 | Summary(pl.UTF-8): Obszerna biblioteka klienta HTTP | |
83 | Group: Development/Languages/Python | |
ebcdddb2 | 84 | Requires: ca-certificates |
dd8b4942 JR |
85 | |
86 | %description -n python3-httplib2 | |
87 | A comprehensive HTTP client library, httplib2.py supports many | |
88 | features left out of other HTTP libraries. Supports: | |
89 | - HTTP and HTTPS | |
90 | - Keep-Alive | |
91 | - Authentication | |
92 | - Caching | |
93 | - All Methods | |
94 | - Redirects | |
95 | - Compression | |
96 | - Lost update support | |
97 | - Unit Tested | |
98 | ||
99 | %description -n python3-httplib2 -l pl.UTF-8 | |
100 | httplib2.py to obszerna biblioteka klienta HTTP, obsługująca wiele | |
101 | cech pomijanych przez inne biblioteki. Obsługuje: | |
102 | - HTTP i HTTPS | |
103 | - Keep-Alive | |
104 | - uwierzytelnianie | |
105 | - buforowanie | |
106 | - wszystkie metody | |
107 | - przekierowania | |
108 | - kompresję | |
109 | - Lost update | |
110 | - podlega testom jednostkowym. | |
111 | ||
2f9adc1a ER |
112 | %prep |
113 | %setup -q -n httplib2-%{version} | |
5007a437 AM |
114 | %patch0 -p1 |
115 | %patch1 -p1 | |
ebcdddb2 | 116 | %patch2 -p1 |
2f9adc1a | 117 | |
af4b3757 | 118 | %build |
ebcdddb2 | 119 | %if %{with python2} |
af4b3757 JK |
120 | %py_build |
121 | ||
ebcdddb2 JB |
122 | %if %{with tests} |
123 | PYTHONPATH=$(pwd)/build-2/lib \ | |
124 | %{__python} -m pytest tests -k 'not test_certs_file_from_builtin and not test_certs_file_from_environment and not test_with_certifi_removed_from_modules and not test_noproxy_star' | |
125 | %endif | |
126 | %endif | |
127 | ||
dd8b4942 | 128 | %if %{with python3} |
af4b3757 | 129 | %py3_build |
ebcdddb2 JB |
130 | |
131 | %if %{with tests} | |
132 | # in python3 implementation system socks module is preferred over httplib2.socks, and the first is incompatible with test_socks5_auth | |
133 | PYTHONPATH=$(pwd)/build-3/lib \ | |
134 | %{__python3} -m pytest tests -k 'not test_certs_file_from_builtin and not test_certs_file_from_environment and not test_with_certifi_removed_from_modules and not test_noproxy_star and not test_server_not_found_error_is_raised_for_invalid_hostname and not test_socks5_auth' | |
135 | %endif | |
136 | %endif | |
137 | ||
138 | %if %{with doc} | |
139 | %{__make} -C doc html | |
dd8b4942 JR |
140 | %endif |
141 | ||
2f9adc1a ER |
142 | %install |
143 | rm -rf $RPM_BUILD_ROOT | |
ebcdddb2 JB |
144 | |
145 | %if %{with python2} | |
af4b3757 | 146 | %py_install |
ebcdddb2 JB |
147 | |
148 | %py_postclean | |
149 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/httplib2/cacerts.txt | |
150 | %endif | |
dd8b4942 JR |
151 | |
152 | %if %{with python3} | |
af4b3757 | 153 | %py3_install |
2f9adc1a | 154 | |
ebcdddb2 JB |
155 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/httplib2/cacerts.txt |
156 | %endif | |
2f9adc1a ER |
157 | |
158 | %clean | |
159 | rm -rf $RPM_BUILD_ROOT | |
160 | ||
ebcdddb2 | 161 | %if %{with python2} |
2f9adc1a ER |
162 | %files |
163 | %defattr(644,root,root,755) | |
ebcdddb2 | 164 | %doc CHANGELOG LICENSE README.md |
dd8b4942 JR |
165 | %{py_sitescriptdir}/httplib2 |
166 | %{py_sitescriptdir}/httplib2-%{version}-py*.egg-info | |
ebcdddb2 | 167 | %endif |
dd8b4942 | 168 | |
5007a437 | 169 | %if %{with python3} |
dd8b4942 JR |
170 | %files -n python3-httplib2 |
171 | %defattr(644,root,root,755) | |
ebcdddb2 | 172 | %doc CHANGELOG LICENSE README.md python3/README |
dd8b4942 JR |
173 | %{py3_sitescriptdir}/httplib2 |
174 | %{py3_sitescriptdir}/httplib2-%{version}-py*.egg-info | |
5007a437 | 175 | %endif |