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