]>
Commit | Line | Data |
---|---|---|
832166ef JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # perform tests (seem to require redis running) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
d941188b ER |
7 | %define module redis |
8 | Summary: A Python client for redis | |
9 | Name: python-%{module} | |
832166ef | 10 | Version: 2.10.5 |
3823a197 | 11 | Release: 9 |
d941188b ER |
12 | License: MIT |
13 | Group: Development/Languages | |
14 | URL: http://github.com/andymccurdy/redis-py | |
832166ef JK |
15 | Source0: https://pypi.python.org/packages/source/r/redis/redis-2.10.5.tar.gz |
16 | # Source0-md5: 3b26c2b9703b4b56b30a1ad508e31083 | |
d941188b | 17 | BuildRequires: rpm-pythonprov |
a5217f09 | 18 | BuildRequires: rpmbuild(macros) >= 1.710 |
832166ef JK |
19 | %if %{with python2} |
20 | BuildRequires: python-setuptools | |
21 | %{?with_tests:BuildRequires: python-pytest} | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-setuptools | |
25 | %{?with_tests:BuildRequires: python3-pytest} | |
26 | %endif | |
d941188b ER |
27 | BuildArch: noarch |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | This is a Python interface to the Redis key-value store. | |
32 | ||
832166ef JK |
33 | %package -n python3-%{module} |
34 | Summary: A Python client for redis | |
35 | Group: Libraries/Python | |
36 | Requires: python3-modules | |
37 | ||
38 | %description -n python3-%{module} | |
39 | This is a Python interface to the Redis key-value store. | |
40 | ||
d941188b ER |
41 | %prep |
42 | %setup -q -n %{module}-%{version} | |
43 | ||
44 | %build | |
832166ef | 45 | %if %{with python2} |
6b9135b0 | 46 | %py_build %{?with_tests:test} |
832166ef JK |
47 | %endif |
48 | ||
49 | %if %{with python3} | |
6b9135b0 | 50 | %py3_build %{?with_tests:test} |
832166ef | 51 | %endif |
d941188b ER |
52 | |
53 | %install | |
54 | rm -rf $RPM_BUILD_ROOT | |
832166ef JK |
55 | |
56 | %if %{with python2} | |
6b9135b0 | 57 | %py_install |
d941188b ER |
58 | |
59 | %py_postclean | |
832166ef JK |
60 | %endif |
61 | ||
62 | %if %{with python3} | |
6b9135b0 | 63 | %py3_install |
832166ef | 64 | %endif |
d941188b ER |
65 | |
66 | %clean | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %files | |
70 | %defattr(644,root,root,755) | |
832166ef | 71 | %doc CHANGES README.rst |
d941188b ER |
72 | %{py_sitescriptdir}/%{module} |
73 | %{py_sitescriptdir}/%{module}-%{version}-*.egg-info | |
832166ef JK |
74 | |
75 | %files -n python3-%{module} | |
76 | %defattr(644,root,root,755) | |
77 | %doc CHANGES README.rst | |
78 | %{py3_sitescriptdir}/%{module} | |
79 | %{py3_sitescriptdir}/%{module}-%{version}-*.egg-info |