Skip to content

Commit 63fef88

Browse files
committed
Update DEB and RPM files
Change-Id: I3361c2115e4154cba61aa7699b9e5e84ecebd263
1 parent 257bd3d commit 63fef88

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

mysql-connector-python/cpydist/data/deb/connector_python_pack_deb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
product_name = "mysql-connector-python"
5757

58-
debian_support_dir = "cpydist/data/deb"
58+
debian_support_dir = f"{product_name}/cpydist/data/deb"
5959

6060
no_debug_filter = (
6161
r"^(byte-compiling|copying|creating /|dpkg-source: warning: ignoring deletion)"
@@ -192,7 +192,7 @@ def get_changes():
192192

193193
# NOTE there is a similar "utils.py" in "cpydist" and "lib/mysql/connector"
194194

195-
sys.path.insert(0, os.path.join(cwd, "lib"))
195+
sys.path.insert(0, os.path.join(cwd, product_name, "lib"))
196196

197197
from mysql.connector.utils import linux_distribution # pylint: disable=C0413
198198
from mysql.connector.version import ( # pylint: disable=C0413

mysql-connector-python/cpydist/data/deb/rules

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ else
7272
endif
7373

7474
%:
75+
touch setup.py; \
7576
dh $@ --with python3 --buildsystem=pybuild
7677

7778
override_dh_auto_install:
7879

7980
set -xe; \
8081
DESTDIR=$(CURDIR)/debian/mysql-connector-python$(LIC_EXT)-py3; \
82+
cd mysql-connector-python; \
8183
for pyver in $(PYTHON3_SUPPORTED); \
8284
do \
8385
python$$pyver setup.py \
@@ -86,6 +88,7 @@ override_dh_auto_install:
8688
--extra-compile-args="$(EXTRA_COMPILE_ARGS)" \
8789
--extra-link-args="$(EXTRA_LINK_ARGS)" $(OPENSSL_OPT) \
8890
--root $$DESTDIR $(BYTE_CODE_ONLY_OPT) $(SKIP_VENDOR_OPT); \
91+
rm ../setup.py; \
8992
find $$DESTDIR -name 'mysql_connector_*.egg-info' -prune -exec rm -rf {} \;; \
9093
done
9194

@@ -104,8 +107,8 @@ override_dh_installdocs:
104107
dh_installdocs --all README.txt
105108
dh_installdocs --all README.rst
106109
dh_installdocs --all CONTRIBUTING.rst
107-
dh_installdocs --all docs/INFO_SRC
108-
dh_installdocs --all docs/INFO_BIN
110+
dh_installdocs --all mysql-connector-python/docs/INFO_SRC
111+
dh_installdocs --all mysql-connector-python/docs/INFO_BIN
109112

110113
# Post install scripts uses "sysconfig", seems for some Deb platforms
111114
# the Python 3 default install this is provided by "python3-distutils".

mysql-connector-python/cpydist/data/rpm/mysql-connector-python.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,15 @@ rm -rf %{buildroot}
229229
# Remove the plugin to force the build not to bundle.
230230
rm -f %{with_mysql_capi}/lib*/{,mysql/}plugin/authentication_ldap_sasl_client.*
231231
232+
cd mysql-connector-python
232233
%{__python3} setup.py ${COMMON_INSTALL_ARGS} \
233234
--extra-compile-args="${EXTRA_COMPILE_ARGS}" \
234235
--extra-link-args="${EXTRA_LINK_ARGS}" \
235236
--with-mysql-capi=%{with_mysql_capi} %{?byte_code_only}
236237
%{?scl:EOF}
237238
238239
%files -n mysql-connector-python3%{?product_suffix}
239-
%doc LICENSE.txt CHANGES.txt README.txt README.rst CONTRIBUTING.rst docs/INFO_SRC docs/INFO_BIN
240+
%doc LICENSE.txt CHANGES.txt README.txt README.rst CONTRIBUTING.rst mysql-connector-python/docs/INFO_SRC mysql-connector-python/docs/INFO_BIN
240241
%{python3_sitearch}/mysql
241242
%{python3_sitearch}/mysql_connector_python-*.egg-info
242243
%{python3_sitearch}/_mysql_connector.cpython*.so

mysqlx-connector-python/cpydist/data/deb/connector_python_pack_deb.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
##############################################################################
5555

5656
product_name = "mysqlx-connector-python"
57+
src_product_name = "mysql-connector-python"
5758

58-
debian_support_dir = "cpydist/data/deb"
59+
debian_support_dir = f"{product_name}/cpydist/data/deb"
5960

6061
no_debug_filter = (
6162
r"^(byte-compiling|copying|creating /|dpkg-source: warning: ignoring deletion)"
@@ -189,7 +190,7 @@ def get_changes():
189190

190191
# NOTE there is a similar "utils.py" in "cpydist" and "lib/mysql/connector"
191192

192-
sys.path.insert(0, os.path.join(cwd, "lib"))
193+
sys.path.insert(0, os.path.join(cwd, product_name, "lib"))
193194

194195
from mysqlx.utils import linux_distribution # pylint: disable=C0413
195196
from mysqlx.version import EDITION, VERSION, VERSION_EXTRA # pylint: disable=C0413
@@ -225,7 +226,7 @@ def get_changes():
225226
print("VERSION", version_text_short)
226227
print("VERSION_EXTRA", version_extra)
227228
basename_tar = "%(name)s%(label)s-%(version)s%(version_extra)s-src" % {
228-
"name": product_name,
229+
"name": src_product_name,
229230
"label": "-%s" % options.label if options.label else "",
230231
"version": version_text_short,
231232
"version_extra": version_extra,

mysqlx-connector-python/cpydist/data/deb/rules

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ else
7070
endif
7171

7272
%:
73+
touch setup.py; \
7374
dh $@ --with python3 --buildsystem=pybuild
7475

7576
override_dh_auto_install:
7677

7778
set -xe; \
7879
DESTDIR=$(CURDIR)/debian/mysqlx-connector-python$(LIC_EXT)-py3; \
80+
cd mysqlx-connector-python; \
7981
for pyver in $(PYTHON3_SUPPORTED); \
8082
do \
8183
python$$pyver setup.py \
@@ -86,6 +88,7 @@ override_dh_auto_install:
8688
--extra-compile-args="$(EXTRA_COMPILE_ARGS)" \
8789
--extra-link-args="$(EXTRA_LINK_ARGS)" $(OPENSSL_OPT) \
8890
--root $$DESTDIR $(BYTE_CODE_ONLY_OPT) $(SKIP_VENDOR_OPT); \
91+
rm ../setup.py; \
8992
find $$DESTDIR -name 'mysqlx_connector_*.egg-info' -prune -exec rm -rf {} \;; \
9093
done
9194

@@ -104,8 +107,8 @@ override_dh_installdocs:
104107
dh_installdocs --all README.txt
105108
dh_installdocs --all README.rst
106109
dh_installdocs --all CONTRIBUTING.rst
107-
dh_installdocs --all docs/INFO_SRC
108-
dh_installdocs --all docs/INFO_BIN
110+
dh_installdocs --all mysqlx-connector-python/docs/INFO_SRC
111+
dh_installdocs --all mysqlx-connector-python/docs/INFO_BIN
109112

110113
# Post install scripts uses "sysconfig", seems for some Deb platforms
111114
# the Python 3 default install this is provided by "python3-distutils".

mysqlx-connector-python/cpydist/data/rpm/mysql-connector-python.spec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Version: %{version}
8989
Release: 1%{?version_extra:.%{version_extra}}%{?byte_code_only:.1}%{?dist}
9090
License: Copyright (c) 2015, 2021, Oracle and/or its affiliates. Under %{?license_type} license as shown in the Description field.
9191
URL: https://dev.mysql.com/downloads/connector/python/
92-
Source0: https://cdn.mysql.com/Downloads/Connector-Python/mysqlx-connector-python%{?product_suffix}-%{version}-src.tar.gz
92+
Source0: https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python%{?product_suffix}-%{version}-src.tar.gz
9393

9494
%if 0%{?fedora}
9595
BuildRequires: python3-devel
@@ -191,7 +191,7 @@ and information about the MySQL software. Also please see the
191191
documentation and the manual for more information.
192192

193193
%prep
194-
%setup -q -n mysqlx-connector-python%{?product_suffix}-%{version}-src
194+
%setup -q -n mysql-connector-python%{?product_suffix}-%{version}-src
195195

196196
%install
197197
%{?scl:scl enable %{scl} - << \EOF}
@@ -219,6 +219,7 @@ EXTRA_LINK_ARGS=""
219219
220220
rm -rf %{buildroot}
221221
222+
cd mysqlx-connector-python
222223
%{__python3} setup.py ${COMMON_INSTALL_ARGS} \
223224
--extra-compile-args="${EXTRA_COMPILE_ARGS}" \
224225
--extra-link-args="${EXTRA_LINK_ARGS}"
@@ -227,7 +228,7 @@ rm -rf %{buildroot}
227228
sed -i -e '/protobuf/d' %{buildroot}%{python3_sitearch}/mysqlx_connector_python-*.egg-info/requires.txt
228229
229230
%files -n mysqlx-connector-python3%{?product_suffix}
230-
%doc LICENSE.txt CHANGES.txt README.txt README.rst CONTRIBUTING.rst docs/INFO_SRC docs/INFO_BIN
231+
%doc LICENSE.txt CHANGES.txt README.txt README.rst CONTRIBUTING.rst mysqlx-connector-python/docs/INFO_SRC mysqlx-connector-python/docs/INFO_BIN
231232
%{python3_sitearch}/mysqlx
232233
%{python3_sitearch}/mysqlx_connector_python-*.egg-info
233234
%{python3_sitearch}/_mysqlxpb.cpython*.so

0 commit comments

Comments
 (0)