]>
Commit | Line | Data |
---|---|---|
f6349ee6 MK |
1 | # TODO: |
2 | # - Fix tests (seems require mock <= 1.0.1) | |
3 | # - Cleanup cython leftovers | |
2737d47e MK |
4 | # |
5 | # Conditional build: | |
6 | %bcond_with doc # don't build doc | |
516febf1 | 7 | %bcond_with tests # do not perform "make test" |
7ec9e6e1 | 8 | %bcond_without python2 # CPython 2.x module |
2737d47e | 9 | %bcond_without python3 # CPython 3.x module |
f6349ee6 | 10 | # NOTE: 3.7.1 R: mock<=1.0.1 for tests :/ |
2737d47e MK |
11 | |
12 | %define module cassandra | |
13 | Summary: A Python client driver for Apache Cassandra | |
eff47a4d | 14 | Summary(pl.UTF-8): Moduł Pythona dla klientów Apache Cassandra |
2737d47e | 15 | Name: python-%{module} |
516febf1 | 16 | Version: 3.7.1 |
aabebf2e | 17 | Release: 3 |
2737d47e MK |
18 | License: Apache v2.0 |
19 | Group: Libraries/Python | |
516febf1 MK |
20 | Source0: https://github.com/datastax/python-driver/archive/%{version}.tar.gz |
21 | # Source0-md5: 6c451069c85490b0f78dcb1f0a0cda5f | |
aabebf2e | 22 | Patch0: %{name}-build.patch |
2737d47e | 23 | URL: http://github.com/datastax/python-driver |
7ec9e6e1 | 24 | BuildRequires: libev-devel |
2737d47e | 25 | BuildRequires: rpm-pythonprov |
95580df3 | 26 | BuildRequires: rpmbuild(macros) >= 1.710 |
2737d47e | 27 | %if %{with python2} |
7ec9e6e1 | 28 | ## BuildRequires: python-futures |
2737d47e MK |
29 | BuildRequires: python-PyYAML |
30 | BuildRequires: python-devel | |
31 | BuildRequires: python-distribute | |
2737d47e MK |
32 | BuildRequires: python-pytz |
33 | BuildRequires: python-six | |
7ec9e6e1 | 34 | BuildRequires: python-sure |
516febf1 | 35 | Requires: python-futures |
f6349ee6 | 36 | Requires: python-modules |
516febf1 MK |
37 | # mock<=1.0.1 |
38 | ||
2737d47e MK |
39 | %endif |
40 | %if %{with python3} | |
41 | # BuildRequires: python3-futures # Only 3.0 and 3.1 | |
969f6dec | 42 | BuildRequires: python3-PyYAML |
2737d47e MK |
43 | BuildRequires: python3-devel |
44 | BuildRequires: python3-distribute | |
969f6dec | 45 | BuildRequires: python3-mock |
2737d47e MK |
46 | BuildRequires: python3-modules |
47 | BuildRequires: python3-pytz | |
eff47a4d | 48 | BuildRequires: python3-six >= 1.6 |
7ec9e6e1 | 49 | BuildRequires: python3-sure |
2737d47e | 50 | %endif |
eff47a4d MK |
51 | Suggests: python-blist |
52 | ||
2737d47e MK |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
54 | ||
55 | %description | |
7ec9e6e1 MK |
56 | A Python client driver for Apache Cassandra. This driver works |
57 | exclusively with the Cassandra Query Language v3 (CQL3) and | |
58 | Cassandra's native protocol. Cassandra versions 1.2 through 2.1 are | |
59 | supported. The driver supports Python 2.6, 2.7, 3.3, and 3.4. | |
2737d47e | 60 | |
7ec9e6e1 MK |
61 | %description -l pl.UTF-8 |
62 | Interfejs klienta dla Apache Cassandra. Działa wyłacznie w oparciu | |
63 | Cassandra Query Languages v3 (CQL3) i z natywnym protkołem Cassandry. | |
64 | Wspiera Cassndry w wersjach od 1.2 w góre i działa z Pythonem 2.6, | |
65 | 2.7, 3.3, 3.4 . | |
2737d47e MK |
66 | |
67 | %package -n python3-%{module} | |
eff47a4d MK |
68 | Summary: A Python client driver for Apache Cassandra |
69 | Summary(pl.UTF-8): Moduł Pythona dla klientów Apache Cassandra | |
2737d47e | 70 | Group: Libraries/Python |
eff47a4d MK |
71 | Requires: python3-six >= 1.6 |
72 | Suggests: python3-blist | |
73 | ||
2737d47e MK |
74 | |
75 | %description -n python3-%{module} | |
7ec9e6e1 MK |
76 | A Python client driver for Apache Cassandra. This driver works |
77 | exclusively with the Cassandra Query Language v3 (CQL3) and | |
78 | Cassandra's native protocol. Cassandra versions 1.2 through 2.1 are | |
79 | supported. The driver supports Python 2.6, 2.7, 3.3, and 3.4. | |
80 | ||
81 | %description -n python3-%{module} -l pl.UTF-8 | |
82 | Interfejs klienta dla Apache Cassandra. Działa wyłacznie w oparciu | |
83 | Cassandra Query Languages v3 (CQL3) i z natywnym protkołem Cassandry. | |
84 | Wspiera Cassndry w wersjach od 1.2 w góre i działa z Pythonem 2.6, | |
85 | 2.7, 3.3, 3.4 . | |
2737d47e | 86 | |
2737d47e MK |
87 | |
88 | %package apidocs | |
89 | Summary: %{module} API documentation | |
90 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
91 | Group: Documentation | |
92 | ||
eff47a4d | 93 | |
2737d47e MK |
94 | %description apidocs |
95 | API documentation for %{module}. | |
96 | ||
97 | %description apidocs -l pl.UTF-8 | |
98 | Dokumentacja API %{module}. | |
99 | ||
100 | %prep | |
516febf1 | 101 | %setup -q -n python-driver-%{version} |
aabebf2e | 102 | %patch0 -p1 |
2737d47e | 103 | |
2737d47e MK |
104 | %build |
105 | %if %{with python2} | |
679a8f72 | 106 | %py_build %{?with_tests:test} |
2737d47e MK |
107 | %endif |
108 | ||
109 | %if %{with python3} | |
679a8f72 | 110 | %py3_build %{?with_tests:test} |
2737d47e MK |
111 | %endif |
112 | ||
113 | %if %{with doc} | |
114 | cd docs | |
115 | %{__make} -j1 html | |
116 | rm -rf _build/html/_sources | |
117 | %endif | |
118 | ||
119 | %install | |
120 | rm -rf $RPM_BUILD_ROOT | |
2737d47e | 121 | %if %{with python2} |
679a8f72 | 122 | %py_install |
2737d47e MK |
123 | %py_postclean |
124 | %endif | |
125 | ||
126 | %if %{with python3} | |
679a8f72 | 127 | %py3_install |
2737d47e MK |
128 | %endif |
129 | ||
2737d47e MK |
130 | %clean |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
133 | %if %{with python2} | |
134 | %files | |
135 | %defattr(644,root,root,755) | |
7ec9e6e1 MK |
136 | %doc README.rst |
137 | %dir %{py_sitedir}/%{module} | |
138 | %{py_sitedir}/%{module}/*.py[co] | |
aabebf2e AM |
139 | %{py_sitedir}/%{module}/*.pxd |
140 | %{py_sitedir}/%{module}/*.pyx | |
516febf1 | 141 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so |
7ec9e6e1 MK |
142 | %dir %{py_sitedir}/%{module}/cqlengine |
143 | %{py_sitedir}/%{module}/cqlengine/*.py[co] | |
144 | %dir %{py_sitedir}/%{module}/io | |
145 | %{py_sitedir}/%{module}/io/*.py[co] | |
146 | %attr(755,root,root) %{py_sitedir}/%{module}/io/libevwrapper.so | |
2737d47e | 147 | %if "%{py_ver}" > "2.4" |
7ec9e6e1 | 148 | %{py_sitedir}/cassandra_driver-%{version}-py*.egg-info |
2737d47e | 149 | %endif |
2737d47e MK |
150 | %endif |
151 | ||
152 | %if %{with python3} | |
153 | %files -n python3-%{module} | |
154 | %defattr(644,root,root,755) | |
7ec9e6e1 | 155 | %doc README.rst |
2737d47e MK |
156 | %dir %{py3_sitedir}/%{module} |
157 | %{py3_sitedir}/%{module}/*.py | |
aabebf2e AM |
158 | %{py3_sitedir}/%{module}/*.pxd |
159 | %{py3_sitedir}/%{module}/*.pyx | |
516febf1 | 160 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.cpython-*.so |
2737d47e MK |
161 | %{py3_sitedir}/%{module}/__pycache__/ |
162 | %dir %{py3_sitedir}/%{module}/io | |
163 | %{py3_sitedir}/%{module}/io/*.py | |
7ec9e6e1 | 164 | %attr(755,root,root) %{py3_sitedir}/%{module}/io/libevwrapper.cpython-*.so |
2737d47e | 165 | %{py3_sitedir}/%{module}/io/__pycache__ |
7ec9e6e1 MK |
166 | %dir %{py3_sitedir}/%{module}/cqlengine |
167 | %{py3_sitedir}/%{module}/cqlengine/*.py | |
168 | %{py3_sitedir}/%{module}/cqlengine/__pycache__ | |
2737d47e | 169 | %{py3_sitedir}/cassandra_driver-%{version}-py*.egg-info |
2737d47e MK |
170 | %endif |
171 | ||
172 | %if %{with doc} | |
173 | %files apidocs | |
174 | %defattr(644,root,root,755) | |
175 | %doc docs/_build/html/* | |
176 | %endif |