]>
Commit | Line | Data |
---|---|---|
07e55034 AM |
1 | # |
2 | # Conditional build: | |
7b4d93cb | 3 | %bcond_with tests # py.test tests [use network] |
07e55034 | 4 | %bcond_without python2 # CPython 2.x module |
99278cda | 5 | %bcond_without python3 # CPython 3.x module |
07e55034 AM |
6 | |
7 | %define module geventhttpclient | |
8 | Summary: A high performance, concurrent HTTP client library | |
99278cda | 9 | Summary(pl.UTF-8): Biblioteka bardzo wydajnego, wielowątkowego klienta HTTP |
07e55034 | 10 | Name: python-%{module} |
22966547 JB |
11 | # keep 1.x here for python2 support |
12 | Version: 1.5.5 | |
13 | Release: 1 | |
07e55034 AM |
14 | License: MIT |
15 | Group: Libraries/Python | |
d1cc782e | 16 | #Source0Download: https://pypi.org/simple/geventhttpclient/ |
99278cda | 17 | Source0: https://files.pythonhosted.org/packages/source/g/geventhttpclient/geventhttpclient-%{version}.tar.gz |
22966547 | 18 | # Source0-md5: 921c99dae79636616b4826423a870c9a |
d1cc782e | 19 | URL: https://pypi.org/project/geventhttpclient/ |
07e55034 | 20 | BuildRequires: rpm-pythonprov |
99278cda | 21 | BuildRequires: rpmbuild(macros) >= 1.714 |
07e55034 | 22 | %if %{with python2} |
99278cda JB |
23 | # older versions generate pythonegg(backports.ssl_match_hostname) dependency |
24 | BuildRequires: python-devel >= 1:2.7.9 | |
25 | BuildRequires: python-modules >= 1:2.7.9 | |
07e55034 AM |
26 | BuildRequires: python-setuptools |
27 | %if %{with tests} | |
ca83ee43 | 28 | BuildRequires: python-brotli |
07e55034 | 29 | BuildRequires: python-certifi |
ca83ee43 | 30 | BuildRequires: python-dpkt |
99278cda JB |
31 | BuildRequires: python-gevent >= 0.13 |
32 | BuildRequires: python-pytest | |
33 | BuildRequires: python-six | |
07e55034 AM |
34 | %endif |
35 | %endif | |
36 | %if %{with python3} | |
99278cda JB |
37 | BuildRequires: python3-devel >= 1:3.4 |
38 | BuildRequires: python3-modules >= 1:3.4 | |
07e55034 AM |
39 | BuildRequires: python3-setuptools |
40 | %if %{with tests} | |
ca83ee43 | 41 | BuildRequires: python3-brotli |
07e55034 | 42 | BuildRequires: python3-certifi |
ca83ee43 | 43 | BuildRequires: python3-dpkt |
99278cda JB |
44 | BuildRequires: python3-gevent >= 0.13 |
45 | BuildRequires: python3-pytest | |
46 | BuildRequires: python3-six | |
07e55034 AM |
47 | %endif |
48 | %endif | |
99278cda | 49 | Requires: python-modules >= 1:2.7.9 |
07e55034 AM |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
52 | %description | |
99278cda | 53 | A high performance, concurrent HTTP client library for Python 2 using |
07e55034 AM |
54 | gevent. |
55 | ||
871575a9 | 56 | geventhttpclient use a fast HTTP parser, written in C, originating |
07e55034 AM |
57 | from nginx, extracted and modified by Joyent. |
58 | ||
59 | geventhttpclient has been specifically designed for high concurrency, | |
60 | streaming and support HTTP 1.1 persistent connections. More generally | |
61 | it is designed for efficiently pulling from REST APIs and streaming | |
871575a9 | 62 | API's like Twitter's. |
07e55034 AM |
63 | |
64 | Safe SSL support is provided by default. | |
65 | ||
99278cda JB |
66 | %description -l pl.UTF-8 |
67 | Biblioteka bardzo wydajnego, wielowątkowego klienta HTTP dla Pythona | |
68 | 2, wykorzystująca gevent. | |
69 | ||
70 | geventhttpclient wykorzystuje szybki parser HTTP, napisany w C, | |
71 | pochodzący z serwera nginx, wyciągniety i zmodyfikowany przez Joyenta. | |
72 | ||
73 | geventhttpclient został zaprojektowany w szczególności z myślą o | |
74 | dużym zrównolegleniu, przesyłaniu strumieni i obsłudze trwałych | |
75 | połączeń HTTP 1.1. Bardziej ogólnie, jest przeznaczony do wydajnego | |
76 | pobierania z API REST-owych oraz strumieniowych, takich jak Twitter. | |
77 | ||
78 | Domyślnie dostępna jest obsługa bezpiecznego SSL. | |
79 | ||
07e55034 AM |
80 | %package -n python3-%{module} |
81 | Summary: A high performance, concurrent HTTP client library | |
99278cda | 82 | Summary(pl.UTF-8): Biblioteka bardzo wydajnego, wielowątkowego klienta HTTP |
07e55034 | 83 | Group: Libraries/Python |
99278cda | 84 | Requires: python3-modules >= 1:3.4 |
07e55034 AM |
85 | |
86 | %description -n python3-%{module} | |
99278cda | 87 | A high performance, concurrent HTTP client library for Python 3 using |
07e55034 AM |
88 | gevent. |
89 | ||
871575a9 | 90 | geventhttpclient use a fast HTTP parser, written in C, originating |
07e55034 AM |
91 | from nginx, extracted and modified by Joyent. |
92 | ||
93 | geventhttpclient has been specifically designed for high concurrency, | |
94 | streaming and support HTTP 1.1 persistent connections. More generally | |
95 | it is designed for efficiently pulling from REST APIs and streaming | |
871575a9 | 96 | API's like Twitter's. |
07e55034 AM |
97 | |
98 | Safe SSL support is provided by default. | |
99 | ||
99278cda JB |
100 | %description -n python3-%{module} -l pl.UTF-8 |
101 | Biblioteka bardzo wydajnego, wielowątkowego klienta HTTP dla Pythona | |
102 | 3, wykorzystująca gevent. | |
103 | ||
104 | geventhttpclient wykorzystuje szybki parser HTTP, napisany w C, | |
105 | pochodzący z serwera nginx, wyciągniety i zmodyfikowany przez Joyenta. | |
106 | ||
107 | geventhttpclient został zaprojektowany w szczególności z myślą o | |
108 | dużym zrównolegleniu, przesyłaniu strumieni i obsłudze trwałych | |
109 | połączeń HTTP 1.1. Bardziej ogólnie, jest przeznaczony do wydajnego | |
110 | pobierania z API REST-owych oraz strumieniowych, takich jak Twitter. | |
111 | ||
112 | Domyślnie dostępna jest obsługa bezpiecznego SSL. | |
113 | ||
07e55034 AM |
114 | %prep |
115 | %setup -q -n %{module}-%{version} | |
116 | ||
ca83ee43 | 117 | %{__rm} -r src/geventhttpclient.egg-info |
99278cda | 118 | |
07e55034 AM |
119 | %build |
120 | %if %{with python2} | |
99278cda JB |
121 | %py_build |
122 | ||
ca83ee43 JB |
123 | %if %{with tests} |
124 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
125 | PYTHONPATH=$(pwd)/$(echo build-2/lib.*) \ | |
126 | %{__python} -m pytest src | |
127 | %endif | |
07e55034 AM |
128 | %endif |
129 | ||
130 | %if %{with python3} | |
99278cda JB |
131 | %py3_build |
132 | ||
ca83ee43 JB |
133 | %if %{with tests} |
134 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
135 | PYTHONPATH=$(pwd)/$(echo build-3/lib.*) \ | |
136 | %{__python3} -m pytest src | |
137 | %endif | |
07e55034 AM |
138 | %endif |
139 | ||
140 | %install | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
143 | %if %{with python2} | |
799dc142 | 144 | %py_install |
07e55034 AM |
145 | |
146 | %py_postclean | |
147 | %endif | |
148 | ||
149 | %if %{with python3} | |
799dc142 | 150 | %py3_install |
07e55034 AM |
151 | %endif |
152 | ||
153 | %clean | |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
156 | %if %{with python2} | |
157 | %files | |
158 | %defattr(644,root,root,755) | |
22966547 | 159 | %doc LICENSE.txt README.mdown |
07e55034 AM |
160 | %dir %{py_sitedir}/geventhttpclient |
161 | %{py_sitedir}/geventhttpclient/*.py[co] | |
99278cda JB |
162 | %attr(755,root,root) %{py_sitedir}/geventhttpclient/_parser.so |
163 | %{py_sitedir}/geventhttpclient-%{version}-py*.egg-info | |
07e55034 | 164 | %endif |
07e55034 AM |
165 | |
166 | %if %{with python3} | |
167 | %files -n python3-%{module} | |
168 | %defattr(644,root,root,755) | |
22966547 | 169 | %doc LICENSE.txt README.mdown |
99278cda JB |
170 | %dir %{py3_sitedir}/geventhttpclient |
171 | %{py3_sitedir}/geventhttpclient/*.py | |
172 | %{py3_sitedir}/geventhttpclient/__pycache__ | |
173 | %attr(755,root,root) %{py3_sitedir}/geventhttpclient/_parser.cpython-*.so | |
174 | %{py3_sitedir}/geventhttpclient-%{version}-py*.egg-info | |
07e55034 | 175 | %endif |