[packages/python3-mysql-connector] Up to 9.1.0

arekm arekm at pld-linux.org
Thu Dec 19 15:03:49 CET 2024


commit 8567b5ee7969f65d3ecdb3144508331f5360688f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Dec 19 14:19:28 2024 +0100

    Up to 9.1.0

 build.patch                  | 11 -------
 force-capi.patch             | 48 ++++++++++++++++++++++-----
 python3-mysql-connector.spec | 77 ++++++++++++++++----------------------------
 tests.patch                  |  4 +--
 4 files changed, 70 insertions(+), 70 deletions(-)
---
diff --git a/python3-mysql-connector.spec b/python3-mysql-connector.spec
index c065828..9a227e7 100644
--- a/python3-mysql-connector.spec
+++ b/python3-mysql-connector.spec
@@ -4,24 +4,25 @@
 # Conditional build:
 %bcond_with	tests		# build with tests (requires mysql server)
 
+%define		mysql_ver	8.4
+
 %define		pname	mysql-connector
 Summary:	The MySQL Client/Protocol implemented in Python
 Summary(pl.UTF-8):	Protokół kliencki MySQL zaimplementowany w Pythonie
 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.33
+Version:	9.1.0
 Release:	1
 License:	GPL v2
 Group:		Libraries/Python
 Source0:	http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-%{version}-src.tar.gz
-# Source0-md5:	97b96f27a08aff863a7fb4a15c8bcdd7
+# Source0-md5:	eac77c9e7f705e501c1fbdbc5a66a835
 #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:	mysql8.0-devel
+BuildRequires:	mysql%{mysql_ver}-devel
 BuildRequires:	protobuf-devel >= 3.0.0
 BuildRequires:	python3-devel
 BuildRequires:	python3-modules
@@ -50,12 +51,13 @@ biblioteki MySQL-a, ani żadna kompilacja.
 %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}
+export MYSQL_CAPI=%{_bindir}/mysql_config%{mysql_ver}
+
+for t in mysql mysqlx; do
+echo "*** Doing ${t}-connector-python"
+cd ${t}-connector-python
 
 %py3_build
 %if %{with tests}
@@ -68,16 +70,29 @@ export PYTHONPATH="$(pwd)/$(echo build-3/lib*)"
 	--with-mysql-share=%{_datadir}/mysql
 %endif
 
+cd ..
+done
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
 # see NOTE on beginning of the spec
+export PROTOC=%{_bindir}/protoc
+export PROTOBUF_INCLUDE_DIR=%{_includedir}
+export PROTOBUF_LIB_DIR=%{_libdir}
+
 export MYSQLXPB_PROTOC=%{_bindir}/protoc
 export MYSQLXPB_PROTOBUF_INCLUDE_DIR=%{_includedir}
 export MYSQLXPB_PROTOBUF_LIB_DIR=%{_libdir}
 
-%py3_install \
-	--with-mysql-capi=%{_prefix}
+export MYSQL_CAPI=%{_bindir}/mysql_config%{mysql_ver}
+
+for t in mysql mysqlx; do
+echo "*** Doing ${t}-connector-python"
+cd ${t}-connector-python
+%py3_install
+cd ..
+done
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -86,43 +101,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc CHANGES.txt README.txt
 %attr(755,root,root) %{py3_sitedir}/_mysql_connector.cpython-*.so
+%attr(755,root,root) %{py3_sitedir}/_mysqlxpb.cpython-*.so
 %{py3_sitedir}/mysql*.egg-info
-%dir %{py3_sitedir}/mysql
-%{py3_sitedir}/mysql/*.py
-%dir %{py3_sitedir}/mysql/__pycache__
-%{py3_sitedir}/mysql/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysql/connector
-%{py3_sitedir}/mysql/connector/py.typed
-%{py3_sitedir}/mysql/connector/*.py
-%dir %{py3_sitedir}/mysql/connector/__pycache__
-%{py3_sitedir}/mysql/connector/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysql/connector/django
-%{py3_sitedir}/mysql/connector/django/*.py
-%dir %{py3_sitedir}/mysql/connector/django/__pycache__
-%{py3_sitedir}/mysql/connector/django/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysql/connector/locales
-%{py3_sitedir}/mysql/connector/locales/*.py
-%dir %{py3_sitedir}/mysql/connector/locales/__pycache__
-%{py3_sitedir}/mysql/connector/locales/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysql/connector/locales/eng
-%{py3_sitedir}/mysql/connector/locales/eng/*.py
-%dir %{py3_sitedir}/mysql/connector/locales/eng/__pycache__
-%{py3_sitedir}/mysql/connector/locales/eng/__pycache__/*.py[co]
-%{py3_sitedir}/mysql/connector/plugins
-%dir %{py3_sitedir}/mysqlx
-%{py3_sitedir}/mysqlx/py.typed
-%{py3_sitedir}/mysqlx/*.py
-%dir %{py3_sitedir}/mysqlx/__pycache__
-%{py3_sitedir}/mysqlx/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysqlx/locales
-%{py3_sitedir}/mysqlx/locales/*.py
-%dir %{py3_sitedir}/mysqlx/locales/__pycache__
-%{py3_sitedir}/mysqlx/locales/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysqlx/locales/eng
-%{py3_sitedir}/mysqlx/locales/eng/*.py
-%dir %{py3_sitedir}/mysqlx/locales/eng/__pycache__
-%{py3_sitedir}/mysqlx/locales/eng/__pycache__/*.py[co]
-%dir %{py3_sitedir}/mysqlx/protobuf
-%{py3_sitedir}/mysqlx/protobuf/*.py
-%dir %{py3_sitedir}/mysqlx/protobuf/__pycache__
-%{py3_sitedir}/mysqlx/protobuf/__pycache__/*.py[co]
+%{py3_sitedir}/mysql
+%{py3_sitedir}/mysqlx
diff --git a/build.patch b/build.patch
deleted file mode 100644
index 1ad80cc..0000000
--- a/build.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- mysql-connector-python-8.0.33-src/cpydist/utils.py~	2023-03-30 12:58:04.000000000 +0200
-+++ mysql-connector-python-8.0.33-src/cpydist/utils.py	2024-03-21 13:22:42.266660572 +0100
-@@ -200,7 +200,7 @@ def mysql_c_api_info(mysql_config):
-         return _mysql_c_api_info_win(mysql_config)
- 
-     if os.path.isdir(mysql_config):
--        mysql_config = os.path.join(mysql_config, "bin", "mysql_config")
-+        mysql_config = os.path.join(mysql_config, "bin", "mysql_config8.0")
- 
-     LOGGER.info("Getting MySQL information from %s", mysql_config)
- 
diff --git a/force-capi.patch b/force-capi.patch
index fbecf43..66e5987 100644
--- a/force-capi.patch
+++ b/force-capi.patch
@@ -1,20 +1,52 @@
---- 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
-@@ -112,7 +112,7 @@ class BaseCommand(Command):
+--- a/mysql-connector-python/cpydist/__init__.py~	2024-09-27 14:37:07.000000000 +0200
++++ b/mysql-connector-python/cpydist/__init__.py	2024-12-19 13:34:38.733271701 +0100
+@@ -129,7 +129,7 @@ class BaseCommand(Command):
      user_options = COMMON_USER_OPTIONS + CEXT_OPTIONS
      boolean_options = ["debug", "byte_code_only", "keep_temp", "skip_vendor"]
  
 -    with_mysql_capi = None
-+    with_mysql_capi = "/usr"
-     with_mysqlxpb_cext = False
++    with_mysql_capi = os.environ.get("MYSQL_CAPI")
  
      with_openssl_include_dir = None
-@@ -135,7 +135,7 @@ class BaseCommand(Command):
+     with_openssl_lib_dir = None
+@@ -152,7 +152,7 @@ class BaseCommand(Command):
  
      def initialize_options(self):
          """Initialize the options."""
 -        self.with_mysql_capi = None
-+        self.with_mysql_capi = "/usr"
-         self.with_mysqlxpb_cext = False
++        self.with_mysql_capi = os.environ.get("MYSQL_CAPI")
          self.with_openssl_include_dir = None
          self.with_openssl_lib_dir = None
+         self.extra_compile_args = None
+@@ -188,8 +188,7 @@ class BaseCommand(Command):
+         if not self.skip_vendor:
+             self.skip_vendor = os.environ.get("SKIP_VENDOR", False)
+ 
+-        if not self.with_mysql_capi:
+-            self.skip_vendor = True
++        self.skip_vendor = True
+ 
+         cmd_build_ext = self.distribution.get_command_obj("build_ext")
+         cmd_build_ext.with_mysql_capi = self.with_mysql_capi
+--- a/mysqlx-connector-python/cpydist/__init__.py~	2024-09-27 14:37:07.000000000 +0200
++++ b/mysqlx-connector-python/cpydist/__init__.py	2024-12-19 14:00:10.039938355 +0100
+@@ -109,6 +109,8 @@ ABSL_LIBS = (
+     "absl_statusor",
+     "absl_bad_optional_access",
+ )
++# don't link with these
++ABSL_LIBS = ()
+ # Load version information
+ VERSION = [999, 0, 0, "a", 0]
+ VERSION_TEXT = "999.0.0"
+@@ -298,6 +298,9 @@ class BuildExt(build_ext, BaseCommand):
+         if not os.path.exists(self._build_protobuf_lib_dir):
+             os.makedirs(self._build_protobuf_lib_dir)
+ 
++        # copying is crazy
++        return
++
+         self.log.info("Copying Protobuf libraries")
+ 
+         # load protobuf-related static libraries
+
diff --git a/tests.patch b/tests.patch
index c5ee616..c1aba1c 100644
--- a/tests.patch
+++ b/tests.patch
@@ -1,5 +1,5 @@
---- mysql-connector-python-8.0.33-src/tests/mysqld.py~	2023-03-30 12:58:04.000000000 +0200
-+++ mysql-connector-python-8.0.33-src/tests/mysqld.py	2024-03-21 13:15:47.909993896 +0100
+--- mysql-connector-python-8.0.33-src/mysql-connector-python/tests/mysqld.py~	2023-03-30 12:58:04.000000000 +0200
++++ mysql-connector-python-8.0.33-src/mysql-connector-python/tests/mysqld.py	2024-03-21 13:15:47.909993896 +0100
 @@ -181,30 +181,7 @@ class MySQLServerBase:
          Raises MySQLBootstrapError when something fails.
          """
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list