[packages/python3-mysql-connector] Up to 8.0.29; python3 only version. Requires modern mysql/mariadb headers.

arekm arekm at pld-linux.org
Thu Apr 28 16:01:23 CEST 2022


commit 81436a0a596aadb4b7b4c735eaa49b7425eb9760
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Apr 28 16:00:21 2022 +0200

    Up to 8.0.29; python3 only version. Requires modern mysql/mariadb headers.

 build.patch                                        | 66 ---------------
 force-capi.patch                                   |  4 +-
 ...-connector.spec => python3-mysql-connector.spec | 95 ++--------------------
 3 files changed, 9 insertions(+), 156 deletions(-)
---
diff --git a/python-mysql-connector.spec b/python3-mysql-connector.spec
similarity index 59%
rename from python-mysql-connector.spec
rename to python3-mysql-connector.spec
index cef54d8..caa6b9e 100644
--- a/python-mysql-connector.spec
+++ b/python3-mysql-connector.spec
@@ -3,38 +3,28 @@
 #
 # Conditional build:
 %bcond_with	tests		# build with tests (requires mysql server)
-%bcond_without	python2		# build without python2
-%bcond_without	python3		# build without python3
 
 %define		pname	mysql-connector
 Summary:	The MySQL Client/Protocol implemented in Python
 Summary(pl.UTF-8):	Protokół kliencki MySQL zaimplementowany w Pythonie
-Name:		python-%{pname}
+Name:		python3-%{pname}
 # check documentation to see which version is GA (we don't want devel releases)
 # https://dev.mysql.com/downloads/connector/python/
-Version:	8.0.23
+Version:	8.0.29
 Release:	1
 License:	GPL v2
 Group:		Libraries/Python
-# Source0:	http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}-src.tar.gz
-Source0:	https://pypi.debian.net/mysql-connector-python/mysql-connector-python-%{version}.tar.gz
-# Source0-md5:	798f57c5e577a34787342821a0cb3a87
+Source0:	http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}-src.tar.gz
+# Source0-md5:	445eb59d7a9fdff424023a381b5567ee
+#Source0:	https://pypi.debian.net/mysql-connector-python/mysql-connector-python-%{version}.tar.gz
 Patch0:		force-capi.patch
 Patch1:		tests.patch
-Patch2:		build.patch
 URL:		http://dev.mysql.com/doc/connector-python/en/
-BuildRequires:	mysql-devel
+BuildRequires:	mysql-devel >= 8.0
 BuildRequires:	protobuf-devel >= 3.0.0
-%if %{with python2}
-BuildRequires:	python-devel
-BuildRequires:	python-modules
-BuildRequires:	python-setuptools
-%endif
-%if %{with python3}
 BuildRequires:	python3-devel
 BuildRequires:	python3-modules
 BuildRequires:	python3-setuptools
-%endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with tests}
@@ -55,49 +45,16 @@ zaimplementowany całkowicie w Pythonie. Do uruchomienia tego
 sterownika, zgodnego z DB API v2.0 Pythona, nie są potrzebne
 biblioteki MySQL-a, ani żadna kompilacja.
 
-%package -n python3-%{pname}
-Summary:	The MySQL Client/Protocol implemented in Python
-Summary(pl.UTF-8):	Protokół kliencki MySQL zaimplementowany w Pythonie
-Group:		Development/Languages/Python
-Requires:	python3-modules
-
-%description -n python3-%{pname}
-MySQL Connector/Python is implementing the MySQL Client/Server
-protocol completely in Python. No MySQL libraries are needed, and no
-compilation is necessary to run this Python DB API v2.0 compliant
-driver.
-
-%description -n python3-%{pname} -l pl.UTF-8
-MySQL Connector/Python to protokół klient-serwer MySQL-a
-zaimplementowany całkowicie w Pythonie. Do uruchomienia tego
-sterownika, zgodnego z DB API v2.0 Pythona, nie są potrzebne
-biblioteki MySQL-a, ani żadna kompilacja.
-
 %prep
-%setup -q -n mysql-connector-python-%{version}
+%setup -q -n mysql-connector-python-%{version}-src
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
 
 %build
 export MYSQLXPB_PROTOC=%{_bindir}/protoc
 export MYSQLXPB_PROTOBUF_INCLUDE_DIR=%{_includedir}
 export MYSQLXPB_PROTOBUF_LIB_DIR=%{_libdir}
 
-%if %{with python2}
-%py_build
-%if %{with tests}
-export PYTHONPATH="$(pwd)/$(echo build-2/lib*)"
-%{__python} unittests.py \
-	--verbosity 1 \
-	--keep --stats \
-	--skip-install \
-	--with-mysql=%{_prefix} \
-	--with-mysql-share=%{_datadir}/mysql
-%endif
-%endif
-
-%if %{with python3}
 %py3_build
 %if %{with tests}
 export PYTHONPATH="$(pwd)/$(echo build-3/lib*)"
@@ -108,7 +65,6 @@ export PYTHONPATH="$(pwd)/$(echo build-3/lib*)"
 	--with-mysql=%{_prefix} \
 	--with-mysql-share=%{_datadir}/mysql
 %endif
-%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -118,49 +74,13 @@ export MYSQLXPB_PROTOC=%{_bindir}/protoc
 export MYSQLXPB_PROTOBUF_INCLUDE_DIR=%{_includedir}
 export MYSQLXPB_PROTOBUF_LIB_DIR=%{_libdir}
 
-%if %{with python2}
-%py_install \
-	--with-mysql-capi=%{_prefix}
-%py_postclean
-%endif
-
-%if %{with python3}
 %py3_install \
 	--with-mysql-capi=%{_prefix}
-%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
 %files
-%defattr(644,root,root,755)
-%doc CHANGES.txt README.txt
-%attr(755,root,root) %{py_sitedir}/_mysql_connector.so
-%dir %{py_sitedir}/mysql
-%{py_sitedir}/mysql/*.py[co]
-%dir %{py_sitedir}/mysql/connector
-%{py_sitedir}/mysql/connector/*.py[co]
-%dir %{py_sitedir}/mysql/connector/django
-%{py_sitedir}/mysql/connector/django/*.py[co]
-%dir %{py_sitedir}/mysql/connector/locales
-%{py_sitedir}/mysql/connector/locales/*.py[co]
-%dir %{py_sitedir}/mysql/connector/locales/eng
-%{py_sitedir}/mysql/connector/locales/eng/*.py[co]
-%dir %{py_sitedir}/mysqlx
-%{py_sitedir}/mysqlx/*.py[co]
-%dir %{py_sitedir}/mysqlx/protobuf
-%{py_sitedir}/mysqlx/protobuf/*.py[co]
-%dir %{py_sitedir}/mysqlx/locales
-%{py_sitedir}/mysqlx/locales/*.py[co]
-%dir %{py_sitedir}/mysqlx/locales/eng
-%{py_sitedir}/mysqlx/locales/eng/*.py[co]
-%if "%{py_ver}" > "2.4"
-%{py_sitedir}/mysql_connector_python-*.egg-info
-%endif
-%endif
-
-%if %{with python3}
 %files -n python3-%{pname}
 %defattr(644,root,root,755)
 %doc CHANGES.txt README.txt
@@ -202,4 +122,3 @@ rm -rf $RPM_BUILD_ROOT
 %{py3_sitedir}/mysqlx/protobuf/*.py
 %dir %{py3_sitedir}/mysqlx/protobuf/__pycache__
 %{py3_sitedir}/mysqlx/protobuf/__pycache__/*.py[co]
-%endif
diff --git a/build.patch b/build.patch
deleted file mode 100644
index a02f34e..0000000
--- a/build.patch
+++ /dev/null
@@ -1,66 +0,0 @@
---- mysql-connector-python-8.0.19/src/mysql_capi.c.org	2020-01-16 09:45:08.669095486 +0100
-+++ mysql-connector-python-8.0.19/src/mysql_capi.c	2020-01-16 09:47:23.166612870 +0100
-@@ -1224,11 +1224,13 @@ MySQL_connect(MySQL *self, PyObject *arg
-             mysql_options(&self->session,
-                          MYSQL_OPT_SSL_CIPHER, ssl_cipher_suites);
-         }
-+#if MYSQL_VERSION_ID >= 80016
-         if (tls_cipher_suites != NULL)
-         {
-             mysql_options(&self->session,
-                           MYSQL_OPT_TLS_CIPHERSUITES, tls_cipher_suites);
-         }
-+#endif
-     } else {
-         // Make sure to not enforce SSL
- #if MYSQL_VERSION_ID > 50703 && MYSQL_VERSION_ID < 50711
---- mysql-connector-python-8.0.23/src/mysql_capi.c~	2022-04-28 15:35:47.000000000 +0200
-+++ mysql-connector-python-8.0.23/src/mysql_capi.c	2022-04-28 15:38:01.363105540 +0200
-@@ -1040,6 +1040,7 @@ MySQL_set_character_set(MySQL *self, PyO
-   @return   int
-     @retval 0   Zero for success.
- */
-+#if MYSQL_VERSION_ID >= 80021
- PyObject*
- MySQL_set_load_data_local_infile_option(MySQL *self, PyObject *args)
- {
-@@ -1067,6 +1068,7 @@ MySQL_set_load_data_local_infile_option(
- 
-     Py_RETURN_NONE;
- }
-+#endif
- 
- /**
-   Commit the current transaction.
---- mysql-connector-python-8.0.23/src/mysql_connector.c~	2020-12-16 07:04:09.000000000 +0100
-+++ mysql-connector-python-8.0.23/src/mysql_connector.c	2022-04-28 15:38:28.053105544 +0200
-@@ -217,9 +217,11 @@ static PyMethodDef MySQL_methods[]=
-     {"set_character_set", (PyCFunction)MySQL_set_character_set,
-      METH_VARARGS,
-      "Set the default character set for the current connection"},
-+#if MYSQL_VERSION_ID >= 80021
-     {"set_load_data_local_infile_option",
-      (PyCFunction)MySQL_set_load_data_local_infile_option, METH_VARARGS,
-      "Set the load_data_local_infile_option for the current connection"},
-+#endif
-     {"shutdown", (PyCFunction)MySQL_shutdown,
-      METH_VARARGS,
-      "Ask MySQL server to shut down"},
---- mysql-connector-python-8.0.23/src/mysql_capi.c~	2022-04-28 15:39:05.000000000 +0200
-+++ mysql-connector-python-8.0.23/src/mysql_capi.c	2022-04-28 15:39:52.313105545 +0200
-@@ -1204,13 +1204,13 @@ MySQL_connect(MySQL *self, PyObject *arg
- 	if (local_infile == 1) {
- 		unsigned int accept= 1;
- 		mysql_options(&self->session, MYSQL_OPT_LOCAL_INFILE, &accept);
--
-+#if MYSQL_VERSION_ID >= 80021
- 	} else if (local_infile == 0 && load_data_local_dir != NULL) {
- 		if (load_data_local_dir != NULL){
- 			mysql_options(&self->session, MYSQL_OPT_LOAD_DATA_LOCAL_DIR,
-                           load_data_local_dir);
- 		}
--
-+#endif
- 	} else {
- 		unsigned int denied= 0;
- 		mysql_options(&self->session, MYSQL_OPT_LOCAL_INFILE, &denied);
diff --git a/force-capi.patch b/force-capi.patch
index 4e5928f..fbecf43 100644
--- a/force-capi.patch
+++ b/force-capi.patch
@@ -1,8 +1,8 @@
 --- mysql-connector-python-8.0.23/cpydist/__init__.py~	2020-12-16 07:04:09.000000000 +0100
 +++ mysql-connector-python-8.0.23/cpydist/__init__.py	2022-04-28 14:15:47.843105028 +0200
-@@ -107,7 +107,7 @@ class BaseCommand(Command):
+@@ -112,7 +112,7 @@ class BaseCommand(Command):
      user_options = COMMON_USER_OPTIONS + CEXT_OPTIONS
-     boolean_options = ["debug", "byte_code_only", "keep-temp"]
+     boolean_options = ["debug", "byte_code_only", "keep_temp", "skip_vendor"]
  
 -    with_mysql_capi = None
 +    with_mysql_capi = "/usr"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-mysql-connector.git/commitdiff/81436a0a596aadb4b7b4c735eaa49b7425eb9760



More information about the pld-cvs-commit mailing list