]>
Commit | Line | Data |
---|---|---|
cbf6c957 AM |
1 | # |
2 | # Conditional build: | |
b460e583 AM |
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_without python3 # CPython 3.x module | |
cbf6c957 | 7 | |
2c1b5d34 JK |
8 | %define module grequests |
9 | Summary: gevent support for python-requests | |
10 | Name: python-%{module} | |
11 | Version: 0.2.0 | |
4560a1cc | 12 | Release: 3 |
2c1b5d34 JK |
13 | License: BSD |
14 | Group: Libraries/Python | |
15 | Source0: https://pypi.python.org/packages/source/g/grequests/grequests-%{version}.tar.gz | |
16 | # Source0-md5: 23186795cf69d127f5e90df665d25387 | |
17 | URL: https://github.com/kennethreitz/grequests | |
cbf6c957 | 18 | %if %{with python2} |
2c1b5d34 | 19 | BuildRequires: python-distribute |
cbf6c957 | 20 | BuildRequires: python-gevent |
2c1b5d34 JK |
21 | Requires: python-libs |
22 | Requires: python-requests | |
cbf6c957 AM |
23 | %endif |
24 | %if %{with python3} | |
cbf6c957 AM |
25 | BuildRequires: python3-gevent |
26 | %endif | |
27 | BuildRequires: rpm-pythonprov | |
ccb849f3 | 28 | BuildRequires: rpmbuild(macros) >= 1.710 |
2c1b5d34 JK |
29 | BuildArch: noarch |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | GRequests allows you to use Requests with Gevent to make asyncronous | |
34 | HTTP Requests easily. | |
35 | ||
cbf6c957 AM |
36 | %package -n python3-%{module} |
37 | Summary: gevent support for python-requests | |
38 | Group: Libraries/Python | |
39 | Requires: python3-libs | |
40 | Requires: python3-requests | |
41 | ||
42 | %description -n python3-%{module} | |
43 | GRequests allows you to use Requests with Gevent to make asyncronous | |
44 | HTTP Requests easily. | |
45 | ||
2c1b5d34 JK |
46 | %prep |
47 | %setup -q -n %{module}-%{version} | |
48 | ||
49 | %build | |
cbf6c957 | 50 | %if %{with python2} |
68a8b4c0 | 51 | %py_build %{?with_tests:test} |
cbf6c957 AM |
52 | %endif |
53 | ||
54 | %if %{with python3} | |
68a8b4c0 | 55 | %py3_build %{?with_tests:test} |
cbf6c957 | 56 | %endif |
2c1b5d34 JK |
57 | |
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
cbf6c957 | 61 | %if %{with python2} |
68a8b4c0 | 62 | %py_install |
2c1b5d34 JK |
63 | |
64 | %py_postclean | |
cbf6c957 AM |
65 | %endif |
66 | ||
67 | %if %{with python3} | |
68a8b4c0 | 68 | %py3_install |
cbf6c957 | 69 | %endif |
2c1b5d34 JK |
70 | |
71 | %clean | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
cbf6c957 | 74 | %if %{with python2} |
2c1b5d34 JK |
75 | %files |
76 | %defattr(644,root,root,755) | |
77 | %doc README.rst | |
78 | %{py_sitescriptdir}/*.py[co] | |
79 | %if "%{py_ver}" > "2.4" | |
80 | %{py_sitescriptdir}/*.egg-info | |
81 | %endif | |
cbf6c957 AM |
82 | %endif |
83 | ||
84 | %if %{with python3} | |
85 | %files -n python3-%{module} | |
86 | %defattr(644,root,root,755) | |
87 | %doc README.rst | |
b460e583 AM |
88 | %{py3_sitescriptdir}/%{module}.py |
89 | %{py3_sitescriptdir}/__pycache__/%{module}*.py* | |
90 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
cbf6c957 | 91 | %endif |