From 2fc7700800f83664dc70734420451a61da30e936f6b47e2bb8e354d812a3f872 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 16 Oct 2024 11:25:46 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/mysql-connector-java?expand=0&rev=117 --- ...r-java-generated-for-protobuf-3.9.2.tar.xz | 3 +++ mysql-connector-java.spec | 21 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 mysql-connector-java-generated-for-protobuf-3.9.2.tar.xz diff --git a/mysql-connector-java-generated-for-protobuf-3.9.2.tar.xz b/mysql-connector-java-generated-for-protobuf-3.9.2.tar.xz new file mode 100644 index 0000000..19be258 --- /dev/null +++ b/mysql-connector-java-generated-for-protobuf-3.9.2.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78985b13a5a3783d07059493de8a8b324a0501914ca62c6e0ddb19a8f570c075 +size 113808 diff --git a/mysql-connector-java.spec b/mysql-connector-java.spec index 0517ecc..d851238 100644 --- a/mysql-connector-java.spec +++ b/mysql-connector-java.spec @@ -25,6 +25,13 @@ License: GPL-2.0-or-later Group: Development/Languages/Java URL: https://dev.mysql.com/downloads/connector/j/ Source0: https://github.com/mysql/mysql-connector-j/archive/refs/tags/%{version}.tar.gz#:/%{name}-%{version}.tar.gz +# NOTE: +# the following file contains the generated protobuf files with +# previous versions of protoc (protobuf) that are needed to build +# in previous SUSE distros. +# Source from: +# https://github.com/mysql/mysql-connector-j/commit/6976d9d779b498c254fc5cab5e69cfc74fc3e4f0 +Source1: mysql-connector-java-generated-for-protobuf-3.9.2.tar.xz Patch0: javac-check.patch # NOTE: Oracle OCI is not packaged yet # The patch doesn't remove the file AuthenticationOciClient.java @@ -41,7 +48,6 @@ BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 BuildRequires: javassist >= 3.28.0 BuildRequires: junit -BuildRequires: protobuf-devel BuildRequires: protobuf-java >= 3.9.2 BuildRequires: slf4j BuildRequires: xz @@ -79,6 +85,15 @@ set that supports the capabilities of MySQL. %patch -P 2 -p1 %patch -P 3 -p1 +%if 0%{?suse_version} <= 1500 +# ship protobuf generated files compatible with protobuf 3.9.2 +# which is the version we have in SLE15 SP2, the files were taken +# from commit 6976d9d779b498c254fc5cab5e69cfc74fc3e4f0, which is +# the last version compatible with that version of protobuf and +# are equivalent in functionality +tar -xvf %{SOURCE1} -C . +%endif + # remove OCI support rm -rf src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java @@ -106,7 +121,7 @@ export CLASSPATH=$(build-classpath \ junit \ reload4j \ protobuf) -ant \ +%{ant} \ -Dsnapshot.version= \ -Dcom.mysql.jdbc.extra.libs=lib \ -Dant.java.version=1.8 \ @@ -129,7 +144,7 @@ install -d -m 755 %{buildroot}%{_mavenpomdir} # Install the Maven build information as new name %{mvn_install_pom} build/%{new_name}-%{version}-SNAPSHOT/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{new_name}.pom sed -i 's/-SNAPSHOT//' %{buildroot}%{_mavenpomdir}/JPP-%{new_name}.pom -%add_maven_depmap JPP-%{new_name}.pom %{new_name}.jar -a "com.mysql:%{name}","mysql:%{name}" +%add_maven_depmap JPP-%{new_name}.pom %{new_name}.jar -a com.mysql:%{name} %files -f .mfiles %{_javadir}/%{name}.jar