]> git.pld-linux.org Git - packages/python-cassandra.git/blob - python-cassandra.spec
7d69d4d35cbb42dcf561a906a82264f30e5da30f
[packages/python-cassandra.git] / python-cassandra.spec
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"
6 %bcond_without  python2 # CPython 2.x module
7 %bcond_without  python3 # CPython 3.x module
8
9 %define         module  cassandra
10 Summary:        A Python client driver for Apache Cassandra
11 Summary(pl.UTF-8):      Moduł Pythona dla klientów Apache Cassandra
12 Name:           python-%{module}
13 Version:        2.5.1
14 Release:        3
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
18 # Source0-md5:  54f6ea0335e27f04fe13eb1036d01944
19 Patch0:         %{name}-futures_already_in_py32.patch
20 URL:            http://github.com/datastax/python-driver
21 BuildRequires:  libev-devel
22 BuildRequires:  rpm-pythonprov
23 BuildRequires:  rpmbuild(macros) >= 1.219
24 %if %{with python2}
25 ## BuildRequires:       python-futures
26 BuildRequires:  python-PyYAML
27 BuildRequires:  python-devel
28 BuildRequires:  python-distribute
29 BuildRequires:  python-pytz
30 BuildRequires:  python-six
31 BuildRequires:  python-sure
32 Requires:       python-modules
33 %endif
34 %if %{with python3}
35 # BuildRequires:        python3-futures  # Only 3.0 and 3.1
36 BuildRequires:  python3-PyYAML
37 BuildRequires:  python3-devel
38 BuildRequires:  python3-distribute
39 BuildRequires:  python3-mock
40 BuildRequires:  python3-modules
41 BuildRequires:  python3-pytz
42 BuildRequires:  python3-six >= 1.6
43 BuildRequires:  python3-sure
44 %endif
45 Suggests:       python-blist
46
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
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.
54
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 .
60
61 %package -n python3-%{module}
62 Summary:        A Python client driver for Apache Cassandra
63 Summary(pl.UTF-8):      Moduł Pythona dla klientów Apache Cassandra
64 Group:          Libraries/Python
65 Requires:       python3-six >= 1.6
66 Suggests:       python3-blist
67
68
69 %description -n python3-%{module}
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 .
80
81
82 %package apidocs
83 Summary:        %{module} API documentation
84 Summary(pl.UTF-8):      Dokumentacja API %{module}
85 Group:          Documentation
86
87
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
98 %build
99 %if %{with python2}
100 CC="%{__cc}" \
101 CFLAGS="%{rpmcflags}" \
102 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
103 %endif
104
105 %if %{with python3}
106 CC="%{__cc}" \
107 CFLAGS="%{rpmcflags}" \
108 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
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
119
120 %if %{with python2}
121 %{__python} setup.py \
122         build --build-base build-2 \
123         install --skip-build \
124         --optimize=2 \
125         --root=$RPM_BUILD_ROOT
126
127 %py_postclean
128 %endif
129
130 %if %{with python3}
131 %{__python3} setup.py \
132         build --build-base build-3 \
133         install --skip-build \
134         --optimize=2 \
135         --root=$RPM_BUILD_ROOT
136 %endif
137
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %if %{with python2}
143 %files
144 %defattr(644,root,root,755)
145 %doc README.rst
146 %dir %{py_sitedir}/%{module}
147 %{py_sitedir}/%{module}/*.py[co]
148 %attr(755,root,root) %{py_sitedir}/%{module}/murmur3.so
149 %dir %{py_sitedir}/%{module}/cqlengine
150 %{py_sitedir}/%{module}/cqlengine/*.py[co]
151 %dir %{py_sitedir}/%{module}/io
152 %{py_sitedir}/%{module}/io/*.py[co]
153 %attr(755,root,root) %{py_sitedir}/%{module}/io/libevwrapper.so
154 %if "%{py_ver}" > "2.4"
155 %{py_sitedir}/cassandra_driver-%{version}-py*.egg-info
156 %endif
157 %endif
158
159 %if %{with python3}
160 %files -n python3-%{module}
161 %defattr(644,root,root,755)
162 %doc README.rst
163 %dir %{py3_sitedir}/%{module}
164 %{py3_sitedir}/%{module}/*.py
165 %attr(755,root,root) %{py3_sitedir}/%{module}/murmur3.cpython-*.so
166 %{py3_sitedir}/%{module}/__pycache__/
167 %dir %{py3_sitedir}/%{module}/io
168 %{py3_sitedir}/%{module}/io/*.py
169 %attr(755,root,root) %{py3_sitedir}/%{module}/io/libevwrapper.cpython-*.so
170 %{py3_sitedir}/%{module}/io/__pycache__
171 %dir %{py3_sitedir}/%{module}/cqlengine
172 %{py3_sitedir}/%{module}/cqlengine/*.py
173 %{py3_sitedir}/%{module}/cqlengine/__pycache__
174 %{py3_sitedir}/cassandra_driver-%{version}-py*.egg-info
175 %endif
176
177 %if %{with doc}
178 %files apidocs
179 %defattr(644,root,root,755)
180 %doc docs/_build/html/*
181 %endif
This page took 0.12424 seconds and 2 git commands to generate.