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