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