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