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