]>
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: | |
5 | %bcond_with tests # build with tests (requires mysql server) | |
6 | %bcond_without python3 # build without python3 | |
7 | ||
8 | %define pname mysql-connector | |
9 | Summary: The MySQL Client/Protocol implemented in Python | |
782f4144 | 10 | Name: python-%{pname} |
43242fad | 11 | # check documentation to see which version is GA (we don't want devel releases) |
41a350af | 12 | # https://dev.mysql.com/downloads/connector/python/ |
f4bf4bf8 | 13 | Version: 2.1.7 |
61698d66 | 14 | Release: 2 |
782f4144 AM |
15 | License: GPL v2 |
16 | Group: Libraries/Python | |
33174d16 | 17 | Source0: http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}.zip |
f4bf4bf8 | 18 | # Source0-md5: 6e3f27535ab4390717f29583ed3249cd |
81c16330 | 19 | Patch0: 32bit.patch |
33174d16 | 20 | URL: http://dev.mysql.com/doc/connector-python/en/ |
5b60af2b | 21 | BuildRequires: rpmbuild(macros) >= 1.710 |
befdbee2 AM |
22 | BuildRequires: mysql-devel |
23 | BuildRequires: python-devel | |
782f4144 | 24 | BuildRequires: python-modules |
d75aefec | 25 | %{?with_python3:BuildRequires: python3-modules} |
782f4144 | 26 | BuildRequires: rpm-pythonprov |
43242fad | 27 | Requires: python-modules |
782f4144 AM |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | MySQL Connector/Python is implementing the MySQL Client/Server | |
32 | protocol completely in Python. No MySQL libraries are needed, and no | |
33 | compilation is necessary to run this Python DB API v2.0 compliant | |
34 | driver. An interface to the popular MySQL database server for Python. | |
35 | ||
36 | %package -n python3-%{pname} | |
d75aefec | 37 | Summary: The MySQL Client/Protocol implemented in Python |
782f4144 | 38 | Group: Development/Languages/Python |
43242fad | 39 | Requires: python3-modules |
782f4144 AM |
40 | |
41 | %description -n python3-%{pname} | |
42 | MySQL Connector/Python is implementing the MySQL Client/Server | |
43 | protocol completely in Python. No MySQL libraries are needed, and no | |
44 | compilation is necessary to run this Python DB API v2.0 compliant | |
45 | driver. An interface to the popular MySQL database server for Python. | |
46 | ||
47 | %prep | |
33174d16 | 48 | %setup -q -n mysql-connector-python-%{version} |
81c16330 | 49 | %patch0 -p1 |
782f4144 AM |
50 | |
51 | %build | |
0d49b37d | 52 | %py_build |
d75aefec ER |
53 | %{?with_tests:%{__python} setup.py test} |
54 | ||
55 | %if %{with python3} | |
0d49b37d | 56 | %py3_build |
d75aefec ER |
57 | %{?with_tests:%{__python3} setup.py test} |
58 | %endif | |
782f4144 AM |
59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
2ed20bfc AM |
63 | %py_install \ |
64 | --with-mysql-capi=%{_prefix} | |
782f4144 AM |
65 | %py_postclean |
66 | ||
d75aefec | 67 | %if %{with python3} |
2ed20bfc AM |
68 | %py3_install \ |
69 | --with-mysql-capi=%{_prefix} | |
d75aefec | 70 | %endif |
782f4144 AM |
71 | |
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
5a951d91 | 77 | %doc CHANGES.txt README.txt |
befdbee2 AM |
78 | %attr(755,root,root) %{py_sitedir}/_mysql_connector.so |
79 | %dir %{py_sitedir}/mysql | |
80 | %{py_sitedir}/mysql/*.py[co] | |
81 | %dir %{py_sitedir}/mysql/connector | |
82 | %{py_sitedir}/mysql/connector/*.py[co] | |
83 | %dir %{py_sitedir}/mysql/connector/django | |
84 | %{py_sitedir}/mysql/connector/django/*.py[co] | |
85 | %dir %{py_sitedir}/mysql/connector/fabric | |
86 | %{py_sitedir}/mysql/connector/fabric/*.py[co] | |
87 | %dir %{py_sitedir}/mysql/connector/locales | |
88 | %{py_sitedir}/mysql/connector/locales/*.py[co] | |
89 | %dir %{py_sitedir}/mysql/connector/locales/eng | |
90 | %{py_sitedir}/mysql/connector/locales/eng/*.py[co] | |
d75aefec | 91 | %if "%{py_ver}" > "2.4" |
befdbee2 | 92 | %{py_sitedir}/mysql_connector_python-*.egg-info |
d75aefec | 93 | %endif |
782f4144 | 94 | |
d75aefec | 95 | %if %{with python3} |
782f4144 AM |
96 | %files -n python3-%{pname} |
97 | %defattr(644,root,root,755) | |
5a951d91 | 98 | %doc CHANGES.txt README.txt |
befdbee2 AM |
99 | %attr(755,root,root) %{py3_sitedir}/_mysql_connector.cpython-*.so |
100 | %{py3_sitedir}/mysql*.egg-info | |
101 | %dir %{py3_sitedir}/mysql | |
102 | %{py3_sitedir}/mysql/*.py | |
103 | %dir %{py3_sitedir}/mysql/__pycache__ | |
104 | %{py3_sitedir}/mysql/__pycache__/*.py[co] | |
105 | %dir %{py3_sitedir}/mysql/connector | |
106 | %{py3_sitedir}/mysql/connector/*.py | |
107 | %dir %{py3_sitedir}/mysql/connector/__pycache__ | |
108 | %{py3_sitedir}/mysql/connector/__pycache__/*.py[co] | |
109 | %dir %{py3_sitedir}/mysql/connector/django | |
110 | %{py3_sitedir}/mysql/connector/django/*.py | |
111 | %dir %{py3_sitedir}/mysql/connector/django/__pycache__ | |
112 | %{py3_sitedir}/mysql/connector/django/__pycache__/*.py[co] | |
113 | %dir %{py3_sitedir}/mysql/connector/fabric | |
114 | %{py3_sitedir}/mysql/connector/fabric/*.py | |
115 | %dir %{py3_sitedir}/mysql/connector/fabric/__pycache__ | |
116 | %{py3_sitedir}/mysql/connector/fabric/__pycache__/*.py[co] | |
117 | %dir %{py3_sitedir}/mysql/connector/locales | |
118 | %{py3_sitedir}/mysql/connector/locales/*.py | |
119 | %dir %{py3_sitedir}/mysql/connector/locales/__pycache__ | |
120 | %{py3_sitedir}/mysql/connector/locales/__pycache__/*.py[co] | |
121 | %dir %{py3_sitedir}/mysql/connector/locales/eng | |
122 | %{py3_sitedir}/mysql/connector/locales/eng/*.py | |
123 | %dir %{py3_sitedir}/mysql/connector/locales/eng/__pycache__ | |
124 | %{py3_sitedir}/mysql/connector/locales/eng/__pycache__/*.py[co] | |
d75aefec | 125 | %endif |