]>
Commit | Line | Data |
---|---|---|
07e55034 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
4 | %bcond_without tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_with python3 # CPython 3.x module | |
7 | ||
8 | %define module geventhttpclient | |
9 | Summary: A high performance, concurrent HTTP client library | |
10 | Name: python-%{module} | |
11 | Version: 1.2.0 | |
12 | Release: 1 | |
13 | License: MIT | |
14 | Group: Libraries/Python | |
15 | Source0: https://pypi.python.org/packages/source/g/geventhttpclient/geventhttpclient-%{version}.tar.gz | |
16 | # Source0-md5: 1b3070e09b6e50fce929771f3f4fc9a6 | |
17 | URL: https://pypi.python.org/pypi/geventhttpclient | |
7dc0e0a6 | 18 | BuildRequires: python-gevent |
07e55034 AM |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.612 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-setuptools | |
24 | %if %{with tests} | |
25 | BuildRequires: python-certifi | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-devel | |
30 | BuildRequires: python3-modules | |
31 | BuildRequires: python3-setuptools | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-certifi | |
34 | %endif | |
35 | %endif | |
36 | Requires: python-modules | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
871575a9 | 40 | A high performance, concurrent HTTP client library for Python using |
07e55034 AM |
41 | gevent. |
42 | ||
871575a9 | 43 | geventhttpclient use a fast HTTP parser, written in C, originating |
07e55034 AM |
44 | from nginx, extracted and modified by Joyent. |
45 | ||
46 | geventhttpclient has been specifically designed for high concurrency, | |
47 | streaming and support HTTP 1.1 persistent connections. More generally | |
48 | it is designed for efficiently pulling from REST APIs and streaming | |
871575a9 | 49 | API's like Twitter's. |
07e55034 AM |
50 | |
51 | Safe SSL support is provided by default. | |
52 | ||
53 | %package -n python3-%{module} | |
54 | Summary: A high performance, concurrent HTTP client library | |
55 | Group: Libraries/Python | |
56 | Requires: python3-modules | |
57 | ||
58 | %description -n python3-%{module} | |
871575a9 | 59 | A high performance, concurrent HTTP client library for Python using |
07e55034 AM |
60 | gevent. |
61 | ||
871575a9 | 62 | geventhttpclient use a fast HTTP parser, written in C, originating |
07e55034 AM |
63 | from nginx, extracted and modified by Joyent. |
64 | ||
65 | geventhttpclient has been specifically designed for high concurrency, | |
66 | streaming and support HTTP 1.1 persistent connections. More generally | |
67 | it is designed for efficiently pulling from REST APIs and streaming | |
871575a9 | 68 | API's like Twitter's. |
07e55034 AM |
69 | |
70 | Safe SSL support is provided by default. | |
71 | ||
72 | %prep | |
73 | %setup -q -n %{module}-%{version} | |
74 | ||
07e55034 AM |
75 | %build |
76 | %if %{with python2} | |
77 | CC="%{__cc}" \ | |
78 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
79 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
83 | CC="%{__cc}" \ | |
84 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
85 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %if %{with python2} | |
92 | %{__python} setup.py \ | |
93 | build --build-base build-2 \ | |
94 | install --skip-build \ | |
95 | --optimize=2 \ | |
96 | --root=$RPM_BUILD_ROOT | |
97 | ||
98 | %py_postclean | |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | %{__python3} setup.py \ | |
103 | build --build-base build-3 \ | |
104 | install --skip-build \ | |
105 | --optimize=2 \ | |
106 | --root=$RPM_BUILD_ROOT | |
107 | %endif | |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
112 | %if %{with python2} | |
113 | %files | |
114 | %defattr(644,root,root,755) | |
115 | %dir %{py_sitedir}/geventhttpclient | |
116 | %{py_sitedir}/geventhttpclient/*.py[co] | |
117 | %attr(755,root,root) %{py_sitedir}/geventhttpclient/*.so | |
07e55034 AM |
118 | %{py_sitedir}/%{module}-%{version}-py*.egg-info |
119 | %endif | |
07e55034 AM |
120 | |
121 | %if %{with python3} | |
122 | %files -n python3-%{module} | |
123 | %defattr(644,root,root,755) | |
124 | %doc AUTHORS CHANGES LICENSE | |
125 | %{py3_sitedir}/%{module} | |
126 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
127 | %endif |