]>
Commit | Line | Data |
---|---|---|
befdbee2 AM |
1 | # TODO: |
2 | # - c extension build is done in install phase (http://bugs.mysql.com/bug.php?id=78621) | |
d75aefec ER |
3 | # |
4 | # Conditional build: | |
8ac2eab1 AM |
5 | %bcond_with tests # build with tests (requires mysql server) |
6 | %bcond_without python2 # build without python2 | |
d75aefec ER |
7 | %bcond_without python3 # build without python3 |
8 | ||
9 | %define pname mysql-connector | |
10 | Summary: The MySQL Client/Protocol implemented in Python | |
93ddb4cc | 11 | Summary(pl.UTF-8): Protokół kliencki MySQL zaimplementowany w Pythonie |
782f4144 | 12 | Name: python-%{pname} |
43242fad | 13 | # check documentation to see which version is GA (we don't want devel releases) |
41a350af | 14 | # https://dev.mysql.com/downloads/connector/python/ |
b369dad5 | 15 | Version: 8.0.19 |
a80a3e8c | 16 | Release: 2 |
782f4144 AM |
17 | License: GPL v2 |
18 | Group: Libraries/Python | |
33174d16 | 19 | Source0: http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}.zip |
b369dad5 | 20 | # Source0-md5: 451d6604efa9dcab56d2658e7167898e |
81c16330 | 21 | Patch0: 32bit.patch |
96b9f6ff | 22 | Patch1: tests.patch |
b369dad5 | 23 | Patch2: build.patch |
a80a3e8c | 24 | Patch3: proto.patch |
33174d16 | 25 | URL: http://dev.mysql.com/doc/connector-python/en/ |
befdbee2 | 26 | BuildRequires: mysql-devel |
f1568111 | 27 | BuildRequires: protobuf-devel |
8ac2eab1 | 28 | %if %{with python2} |
befdbee2 | 29 | BuildRequires: python-devel |
782f4144 | 30 | BuildRequires: python-modules |
93ddb4cc | 31 | BuildRequires: python-setuptools |
8ac2eab1 AM |
32 | %endif |
33 | %if %{with python3} | |
34 | BuildRequires: python3-devel | |
35 | BuildRequires: python3-modules | |
93ddb4cc | 36 | BuildRequires: python3-setuptools |
8ac2eab1 | 37 | %endif |
782f4144 | 38 | BuildRequires: rpm-pythonprov |
93ddb4cc | 39 | BuildRequires: rpmbuild(macros) >= 1.714 |
8ac2eab1 AM |
40 | %if %{with tests} |
41 | BuildRequires: mysql | |
42 | %endif | |
43242fad | 43 | Requires: python-modules |
782f4144 AM |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
45 | ||
46 | %description | |
47 | MySQL Connector/Python is implementing the MySQL Client/Server | |
48 | protocol completely in Python. No MySQL libraries are needed, and no | |
49 | compilation is necessary to run this Python DB API v2.0 compliant | |
93ddb4cc JB |
50 | driver. |
51 | ||
52 | %description -l pl.UTF-8 | |
53 | MySQL Connector/Python to protokół klient-serwer MySQL-a | |
54 | zaimplementowany całkowicie w Pythonie. Do uruchomienia tego | |
55 | sterownika, zgodnego z DB API v2.0 Pythona, nie są potrzebne | |
56 | biblioteki MySQL-a, ani żadna kompilacja. | |
782f4144 AM |
57 | |
58 | %package -n python3-%{pname} | |
d75aefec | 59 | Summary: The MySQL Client/Protocol implemented in Python |
93ddb4cc | 60 | Summary(pl.UTF-8): Protokół kliencki MySQL zaimplementowany w Pythonie |
782f4144 | 61 | Group: Development/Languages/Python |
43242fad | 62 | Requires: python3-modules |
782f4144 AM |
63 | |
64 | %description -n python3-%{pname} | |
65 | MySQL Connector/Python is implementing the MySQL Client/Server | |
66 | protocol completely in Python. No MySQL libraries are needed, and no | |
67 | compilation is necessary to run this Python DB API v2.0 compliant | |
93ddb4cc JB |
68 | driver. |
69 | ||
70 | %description -n python3-%{pname} -l pl.UTF-8 | |
71 | MySQL Connector/Python to protokół klient-serwer MySQL-a | |
72 | zaimplementowany całkowicie w Pythonie. Do uruchomienia tego | |
73 | sterownika, zgodnego z DB API v2.0 Pythona, nie są potrzebne | |
74 | biblioteki MySQL-a, ani żadna kompilacja. | |
782f4144 AM |
75 | |
76 | %prep | |
33174d16 | 77 | %setup -q -n mysql-connector-python-%{version} |
81c16330 | 78 | %patch0 -p1 |
8ac2eab1 | 79 | %patch1 -p1 |
b369dad5 | 80 | %patch2 -p1 |
a80a3e8c | 81 | %patch3 -p1 |
782f4144 AM |
82 | |
83 | %build | |
f1568111 AM |
84 | export MYSQLXPB_PROTOC=%{_bindir}/protoc |
85 | export MYSQLXPB_PROTOBUF_INCLUDE_DIR=%{_includedir} | |
86 | export MYSQLXPB_PROTOBUF_LIB_DIR=%{_libdir} | |
87 | ||
8ac2eab1 | 88 | %if %{with python2} |
0d49b37d | 89 | %py_build |
8ac2eab1 | 90 | %if %{with tests} |
93ddb4cc | 91 | export PYTHONPATH="$(pwd)/$(echo build-2/lib*)" |
8ac2eab1 AM |
92 | %{__python} unittests.py \ |
93 | --verbosity 1 \ | |
94 | --keep --stats \ | |
95 | --skip-install \ | |
96 | --with-mysql=%{_prefix} \ | |
97 | --with-mysql-share=%{_datadir}/mysql | |
98 | %endif | |
99 | %endif | |
d75aefec ER |
100 | |
101 | %if %{with python3} | |
0d49b37d | 102 | %py3_build |
8ac2eab1 | 103 | %if %{with tests} |
93ddb4cc | 104 | export PYTHONPATH="$(pwd)/$(echo build-3/lib*)" |
8ac2eab1 AM |
105 | %{__python3} unittests.py \ |
106 | --verbosity 1 \ | |
107 | --keep --stats \ | |
108 | --skip-install \ | |
109 | --with-mysql=%{_prefix} \ | |
110 | --with-mysql-share=%{_datadir}/mysql | |
111 | %endif | |
d75aefec | 112 | %endif |
782f4144 AM |
113 | |
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
f1568111 AM |
117 | # see NOTE on beginning of the spec |
118 | export MYSQLXPB_PROTOC=%{_bindir}/protoc | |
119 | export MYSQLXPB_PROTOBUF_INCLUDE_DIR=%{_includedir} | |
120 | export MYSQLXPB_PROTOBUF_LIB_DIR=%{_libdir} | |
121 | ||
8ac2eab1 | 122 | %if %{with python2} |
2ed20bfc AM |
123 | %py_install \ |
124 | --with-mysql-capi=%{_prefix} | |
782f4144 | 125 | %py_postclean |
8ac2eab1 | 126 | %endif |
782f4144 | 127 | |
d75aefec | 128 | %if %{with python3} |
2ed20bfc AM |
129 | %py3_install \ |
130 | --with-mysql-capi=%{_prefix} | |
d75aefec | 131 | %endif |
782f4144 AM |
132 | |
133 | %clean | |
134 | rm -rf $RPM_BUILD_ROOT | |
135 | ||
8ac2eab1 | 136 | %if %{with python2} |
782f4144 AM |
137 | %files |
138 | %defattr(644,root,root,755) | |
5a951d91 | 139 | %doc CHANGES.txt README.txt |
befdbee2 AM |
140 | %attr(755,root,root) %{py_sitedir}/_mysql_connector.so |
141 | %dir %{py_sitedir}/mysql | |
142 | %{py_sitedir}/mysql/*.py[co] | |
143 | %dir %{py_sitedir}/mysql/connector | |
144 | %{py_sitedir}/mysql/connector/*.py[co] | |
145 | %dir %{py_sitedir}/mysql/connector/django | |
146 | %{py_sitedir}/mysql/connector/django/*.py[co] | |
befdbee2 AM |
147 | %dir %{py_sitedir}/mysql/connector/locales |
148 | %{py_sitedir}/mysql/connector/locales/*.py[co] | |
149 | %dir %{py_sitedir}/mysql/connector/locales/eng | |
150 | %{py_sitedir}/mysql/connector/locales/eng/*.py[co] | |
50013483 AM |
151 | %dir %{py_sitedir}/mysqlx |
152 | %{py_sitedir}/mysqlx/*.py[co] | |
153 | %dir %{py_sitedir}/mysqlx/protobuf | |
154 | %{py_sitedir}/mysqlx/protobuf/*.py[co] | |
155 | %dir %{py_sitedir}/mysqlx/locales | |
156 | %{py_sitedir}/mysqlx/locales/*.py[co] | |
157 | %dir %{py_sitedir}/mysqlx/locales/eng | |
158 | %{py_sitedir}/mysqlx/locales/eng/*.py[co] | |
d75aefec | 159 | %if "%{py_ver}" > "2.4" |
befdbee2 | 160 | %{py_sitedir}/mysql_connector_python-*.egg-info |
d75aefec | 161 | %endif |
8ac2eab1 | 162 | %endif |
782f4144 | 163 | |
d75aefec | 164 | %if %{with python3} |
782f4144 AM |
165 | %files -n python3-%{pname} |
166 | %defattr(644,root,root,755) | |
5a951d91 | 167 | %doc CHANGES.txt README.txt |
befdbee2 AM |
168 | %attr(755,root,root) %{py3_sitedir}/_mysql_connector.cpython-*.so |
169 | %{py3_sitedir}/mysql*.egg-info | |
170 | %dir %{py3_sitedir}/mysql | |
171 | %{py3_sitedir}/mysql/*.py | |
172 | %dir %{py3_sitedir}/mysql/__pycache__ | |
173 | %{py3_sitedir}/mysql/__pycache__/*.py[co] | |
174 | %dir %{py3_sitedir}/mysql/connector | |
175 | %{py3_sitedir}/mysql/connector/*.py | |
176 | %dir %{py3_sitedir}/mysql/connector/__pycache__ | |
177 | %{py3_sitedir}/mysql/connector/__pycache__/*.py[co] | |
178 | %dir %{py3_sitedir}/mysql/connector/django | |
179 | %{py3_sitedir}/mysql/connector/django/*.py | |
180 | %dir %{py3_sitedir}/mysql/connector/django/__pycache__ | |
181 | %{py3_sitedir}/mysql/connector/django/__pycache__/*.py[co] | |
befdbee2 AM |
182 | %dir %{py3_sitedir}/mysql/connector/locales |
183 | %{py3_sitedir}/mysql/connector/locales/*.py | |
184 | %dir %{py3_sitedir}/mysql/connector/locales/__pycache__ | |
185 | %{py3_sitedir}/mysql/connector/locales/__pycache__/*.py[co] | |
186 | %dir %{py3_sitedir}/mysql/connector/locales/eng | |
187 | %{py3_sitedir}/mysql/connector/locales/eng/*.py | |
188 | %dir %{py3_sitedir}/mysql/connector/locales/eng/__pycache__ | |
189 | %{py3_sitedir}/mysql/connector/locales/eng/__pycache__/*.py[co] | |
50013483 AM |
190 | %dir %{py3_sitedir}/mysqlx |
191 | %{py3_sitedir}/mysqlx/*.py | |
192 | %dir %{py3_sitedir}/mysqlx/__pycache__ | |
193 | %{py3_sitedir}/mysqlx/__pycache__/*.py[co] | |
194 | %dir %{py3_sitedir}/mysqlx/locales | |
195 | %{py3_sitedir}/mysqlx/locales/*.py | |
196 | %dir %{py3_sitedir}/mysqlx/locales/__pycache__ | |
197 | %{py3_sitedir}/mysqlx/locales/__pycache__/*.py[co] | |
198 | %dir %{py3_sitedir}/mysqlx/locales/eng | |
199 | %{py3_sitedir}/mysqlx/locales/eng/*.py | |
200 | %dir %{py3_sitedir}/mysqlx/locales/eng/__pycache__ | |
201 | %{py3_sitedir}/mysqlx/locales/eng/__pycache__/*.py[co] | |
202 | %dir %{py3_sitedir}/mysqlx/protobuf | |
203 | %{py3_sitedir}/mysqlx/protobuf/*.py | |
204 | %dir %{py3_sitedir}/mysqlx/protobuf/__pycache__ | |
205 | %{py3_sitedir}/mysqlx/protobuf/__pycache__/*.py[co] | |
d75aefec | 206 | %endif |