Skip to content

Commit 33c6d8e

Browse files
committed
Additional RPM spec changes partly related to WL#13985
- Let the single RPM also provide "mysql-connector-python-cext" - Use %{version}-%{release} in the provides version handling - Only require "python3-protobuf" on systems that provides a recent enough version - Depend on the "client-plugins" Server sub RPM instead of bundling "authentication_ldap_sasl_client.so"
1 parent 95a8a97 commit 33c6d8e

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

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

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,20 @@ Requires: python
133133
Requires: python2-dns >= %{wants_py_dnspython_version}
134134
%endif
135135

136-
Obsoletes: mysql-connector-python%{?product_suffix}-cext < 8.0.22
136+
%if 0%{?byte_code_only:1}
137+
Requires: mysql%{?product_suffix}-client-plugins = %{version}
138+
%else
139+
Requires: mysql-community-client-plugins = %{version}
140+
%endif
141+
142+
Obsoletes: mysql-connector-python%{?product_suffix}-cext < %{version}-%{release}
143+
Provides: mysql-connector-python%{?product_suffix}-cext = %{version}-%{release}
137144

138145
%if 0%{?byte_code_only:1}
139146
Obsoletes: mysql-connector-python < %{version}-%{release}
140147
Provides: mysql-connector-python = %{version}-%{release}
148+
Obsoletes: mysql-connector-python-cext < %{version}-%{release}
149+
Provides: mysql-connector-python-cext = %{version}-%{release}
141150
%endif
142151
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
143152

@@ -166,15 +175,22 @@ Group: Development/Libraries/Python
166175
Group: Development/Libraries
167176
%endif
168177

169-
Obsoletes: mysql-connector-python3%{?product_suffix}-cext < 8.0.22
178+
Obsoletes: mysql-connector-python3%{?product_suffix}-cext < %{version}-%{release}
179+
Provides: mysql-connector-python3%{?product_suffix}-cext = %{version}-%{release}
170180

171181
%if 0%{?byte_code_only:1}
172182
Obsoletes: mysql-connector-python3 < %{version}-%{release}
173183
Provides: mysql-connector-python3 = %{version}-%{release}
184+
Obsoletes: mysql-connector-python3-cext < %{version}-%{release}
185+
Provides: mysql-connector-python3-cext = %{version}-%{release}
174186
%endif
175187

176188
Requires: python3
189+
190+
# There is no new enough python3-protobuf on some older Linux distros
191+
%if ! ( 0%{?rhel} == 7 || 0%{?rhel} == 8 || 0%{?suse_version} == 1315 )
177192
Requires: python3-protobuf >= %{requires_py_protobuf_version}
193+
%endif
178194

179195
# Some operations requires DNSPYTHON but this is not a strict
180196
# requirement for the RPM install as currently few RPM platforms has
@@ -232,6 +248,12 @@ EXTRA_LINK_ARGS=""
232248

233249
rm -rf %{buildroot}
234250

251+
# The LDAP client plugin from the Server is bundled if it exists under
252+
# 'with_mysql_capi'. For RPM builds we don't want to bundle, instead
253+
# we want to depend on the MySQL Server "client-plugins" RPM package.
254+
# Remove the plugin to force the build not to bundle.
255+
rm -f %{with_mysql_capi}/lib*/{,mysql/}plugin/authentication_ldap_sasl_client.*
256+
235257
%{__python2} setup.py ${COMMON_INSTALL_ARGS} \
236258
--extra-compile-args="${EXTRA_COMPILE_ARGS}" \
237259
--extra-link-args="${EXTRA_LINK_ARGS}" \
@@ -268,8 +290,12 @@ rm -rf %{buildroot}
268290
%{python3_sitearch}/_mysqlxpb.cpython*.so
269291

270292
%changelog
271-
* Fri Jul 17 2020 Nuno Mariz <nuno.mariz@oracle.com> - 8.0.22-1
293+
* Mon Sep 07 2020 Kent Boortz <kent.boortz@oracle.com> - 8.0.22-1
272294
- Updated for 8.0.22
295+
- Still provide "mysql-connector-python-cext"
296+
- Removed dependency on "mysql-connector-python3-cext"
297+
- Disabled the bundling of "authentication_ldap_sasl_client.so"
298+
and added dependency on the Server "client-plugin" RPM
273299

274300
* Thu May 28 2020 Prashant Tekriwal <[email protected]> - 8.0.21-1
275301
- Combined cext package and pure python package to single pkg.

0 commit comments

Comments
 (0)