From 92cdef75864e3decd0c4b4ff75635b2d13b65d79 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 27 2022 00:12:11 +0000 Subject: import mariadb-java-client-2.7.1-2.el8 --- diff --git a/.gitignore b/.gitignore index 239b333..6d48e63 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/2.2.5.tar.gz +SOURCES/mariadb-connector-j-2.7.1.tar.gz diff --git a/.mariadb-java-client.metadata b/.mariadb-java-client.metadata index 5e2716c..b81e0b3 100644 --- a/.mariadb-java-client.metadata +++ b/.mariadb-java-client.metadata @@ -1 +1 @@ -ecd339fcfe3e6e57852d6d7e631967a5898a9cf0 SOURCES/2.2.5.tar.gz +a838d52134182704d3665488278f98104cef4b42 SOURCES/mariadb-connector-j-2.7.1.tar.gz diff --git a/SOURCES/compliance-for-jna-4.patch b/SOURCES/compliance-for-jna-4.patch new file mode 100644 index 0000000..086212a --- /dev/null +++ b/SOURCES/compliance-for-jna-4.patch @@ -0,0 +1,52 @@ +From 6851cb325a3508bbdaf58324dcf5968b31eebde8 Mon Sep 17 00:00:00 2001 +From: Zuzana Miklankova +Date: Mon, 11 Apr 2022 12:44:39 +0200 +Subject: [PATCH] compliance for jna 4 + +More information: +https://github.com/java-native-access/jna/blob/5.0.0/src/com/sun/jna/Native.java#L599 +https://github.com/java-native-access/jna/blob/5.0.0/CHANGES.md#features-12 + +--- + .../mariadb/jdbc/internal/io/socket/SharedMemorySocket.java | 4 ++-- + .../org/mariadb/jdbc/internal/util/pid/JnaPidFactory.java | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/main/java/org/mariadb/jdbc/internal/io/socket/SharedMemorySocket.java b/src/main/java/org/mariadb/jdbc/internal/io/socket/SharedMemorySocket.java +index 74a4f4b1..2abdcba8 100644 +--- a/src/main/java/org/mariadb/jdbc/internal/io/socket/SharedMemorySocket.java ++++ b/src/main/java/org/mariadb/jdbc/internal/io/socket/SharedMemorySocket.java +@@ -284,7 +284,7 @@ public class SharedMemorySocket extends Socket { + + public interface Kernel32 extends StdCallLibrary { + +- Kernel32 INSTANCE = Native.load("Kernel32", Kernel32.class, WIN32API_OPTIONS); ++ Kernel32 INSTANCE = Native.loadLibrary("Kernel32", Kernel32.class, WIN32API_OPTIONS); + int FILE_MAP_WRITE = 0x0002; + int FILE_MAP_READ = 0x0004; + int EVENT_MODIFY_STATE = 0x0002; +@@ -327,7 +327,7 @@ public class SharedMemorySocket extends Socket { + + public interface Advapi32 extends StdCallLibrary { + +- Advapi32 INSTANCE = Native.load("advapi32", Advapi32.class, WIN32API_OPTIONS); ++ Advapi32 INSTANCE = Native.loadLibrary("advapi32", Advapi32.class, WIN32API_OPTIONS); + + boolean ConvertStringSecurityDescriptorToSecurityDescriptor( + String sddl, int sddlVersion, PointerByReference psd, IntByReference length); +diff --git a/src/main/java/org/mariadb/jdbc/internal/util/pid/JnaPidFactory.java b/src/main/java/org/mariadb/jdbc/internal/util/pid/JnaPidFactory.java +index 88cc2d5e..6e872035 100644 +--- a/src/main/java/org/mariadb/jdbc/internal/util/pid/JnaPidFactory.java ++++ b/src/main/java/org/mariadb/jdbc/internal/util/pid/JnaPidFactory.java +@@ -99,7 +99,7 @@ public class JnaPidFactory { + } + + private interface CLibrary extends Library { +- CLibrary INSTANCE = Native.load("c", CLibrary.class); ++ CLibrary INSTANCE = Native.loadLibrary("c", CLibrary.class); + + int getpid(); + } +-- +2.35.1 + diff --git a/SOURCES/remove_waffle-jna.patch b/SOURCES/remove_waffle-jna.patch index 26bea91..e30649c 100644 --- a/SOURCES/remove_waffle-jna.patch +++ b/SOURCES/remove_waffle-jna.patch @@ -1,63 +1,45 @@ -From d4d3f02f3b940693e99f065dd543e6bc03721f53 Mon Sep 17 00:00:00 2001 -From: Jakub Janco -Date: Sat, 5 May 2018 15:37:06 +0200 -Subject: [PATCH] Remove WindowsNativeSspiAuthentication This dependency is - optional and not in Fedora +From c1e587054376db950495c02672675c801f454a6b Mon Sep 17 00:00:00 2001 +From: Ondrej Dubaj +Date: Mon, 10 Feb 2020 18:08:39 +0100 +Subject: [PATCH] remove waffle-jna --- - .../internal/com/send/SendGssApiAuthPacket.java | 26 +--------------------- - 1 file changed, 1 insertion(+), 25 deletions(-) + .../send/authentication/gssapi/GssUtility.java | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) -diff --git a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java -index 55771a61..d6a76979 100644 ---- a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java -+++ b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java -@@ -57,7 +57,6 @@ import org.mariadb.jdbc.internal.com.read.Buffer; - import org.mariadb.jdbc.internal.com.read.ErrorPacket; - import org.mariadb.jdbc.internal.com.send.gssapi.GssapiAuth; - import org.mariadb.jdbc.internal.com.send.gssapi.StandardGssapiAuthentication; --import org.mariadb.jdbc.internal.com.send.gssapi.WindowsNativeSspiAuthentication; - import org.mariadb.jdbc.internal.io.input.PacketInputStream; - import org.mariadb.jdbc.internal.io.output.PacketOutputStream; +diff --git a/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/GssUtility.java b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/GssUtility.java +index 810500e..127b580 100644 +--- a/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/GssUtility.java ++++ b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/GssUtility.java +@@ -5,26 +5,12 @@ import com.sun.jna.*; + public class GssUtility { -@@ -88,7 +87,7 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i - String mechanisms = buffer.readStringNullEnd(StandardCharsets.UTF_8); - if (mechanisms.isEmpty()) mechanisms = "Kerberos"; - -- GssapiAuth gssapiAuth = getAuthenticationMethod(); -+ GssapiAuth gssapiAuth = new StandardGssapiAuthentication(reader, packSeq); - gssapiAuth.authenticate(pos, serverPrincipalName, mechanisms); - } - -@@ -107,28 +106,5 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i - } - } - -- /** -- * Get authentication method according to classpath. -- * Windows native authentication is using Waffle-jna. -- * -- * @return authentication method -- */ -- private GssapiAuth getAuthenticationMethod() { + /** +- * Get authentication method according to classpath. Windows native authentication is using +- * Waffle-jna. ++ * Get authentication method according to classpath. ++ * + * + * @return authentication method + */ + public static GssapiAuth getAuthenticationMethod() { +- try { +- // Waffle-jna has jna as dependency, so if not available on classpath, just use standard +- // authentication +- if (Platform.isWindows()) { - try { -- //Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication -- if (Platform.isWindows()) { -- try { -- Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl"); -- return new WindowsNativeSspiAuthentication(reader, packSeq); -- } catch (ClassNotFoundException cle) { -- //waffle not in the classpath -- } -- } -- } catch (Throwable cle) { -- //jna jar's are not in classpath +- Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl"); +- return new WindowsNativeSspiAuthentication(); +- } catch (ClassNotFoundException cle) { +- // waffle not in the classpath - } -- return new StandardGssapiAuthentication(reader, packSeq); +- } +- } catch (Throwable cle) { +- // jna jar's are not in classpath - } -- + return new StandardGssapiAuthentication(); + } } - -- -2.14.3 +2.19.1 diff --git a/SPECS/mariadb-java-client.spec b/SPECS/mariadb-java-client.spec index 1d3d7de..0a2a40f 100644 --- a/SPECS/mariadb-java-client.spec +++ b/SPECS/mariadb-java-client.spec @@ -1,24 +1,25 @@ Name: mariadb-java-client -Version: 2.2.5 -Release: 3%{?dist} +Version: 2.7.1 +Release: 2%{?dist} Summary: Connects applications developed in Java to MariaDB and MySQL databases # added BSD license because of https://bugzilla.redhat.com/show_bug.cgi?id=1291558#c13 License: BSD and LGPLv2+ URL: https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/ -Source0: https://github.com/MariaDB/mariadb-connector-j/archive/%{version}.tar.gz +Source0: https://github.com/mariadb-corporation/mariadb-connector-j/archive/refs/tags/%{version}.tar.gz/mariadb-connector-j-%{version}.tar.gz # optional dependency not in Fedora Patch0: remove_waffle-jna.patch +Patch1: compliance-for-jna-4.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: mvn(net.java.dev.jna:jna) BuildRequires: mvn(net.java.dev.jna:jna-platform) -BuildRequires: mvn(com.google.code.maven-replacer-plugin:replacer) -# fedora 25 BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) -BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) +BuildRequires: mvn(org.osgi:osgi.cmpn) +BuildRequires: mvn(org.osgi:osgi.core) +BuildRequires: mvn(org.slf4j:slf4j-api) # since version 1.5.2 missing optional dependency (windows) #BuildRequires: mvn(com.github.dblock.waffle:waffle-jna) @@ -47,21 +48,39 @@ done # remove missing optional dependency waffle-jna %pom_remove_dep com.github.waffle:waffle-jna -%pom_remove_dep com.zaxxer:HikariCP %pom_remove_dep ch.qos.logback:logback-classic +%pom_remove_dep junit:junit +%pom_remove_dep com.amazonaws:aws-java-sdk-rds + +# remove and add jna, so that it is stated as +# non-optional dependency +%pom_remove_dep net.java.dev.jna:jna +%pom_add_dep net.java.dev.jna:jna + +# change required version of the jna-platform, as mariadb-java-client is patched to +# be compliant also with jna 4 +%pom_change_dep net.java.dev.jna:jna-platform net.java.dev.jna:jna-platform:any + +# use latest OSGi implementation +%pom_change_dep -r :org.osgi.core org.osgi:osgi.core +%pom_change_dep -r :org.osgi.compendium org.osgi:osgi.cmpn + + # also remove the file using the removed plugin -rm -f src/main/java/org/mariadb/jdbc/internal/com/send/gssapi/WindowsNativeSspiAuthentication.java +rm -r src/main/java/org/mariadb/jdbc/credential/aws +rm src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/WindowsNativeSspiAuthentication.java # patch the sources so that the missing file is not making trouble %patch0 -p1 +%patch1 -p1 %mvn_file org.mariadb.jdbc:%{name} %{name} %mvn_alias org.mariadb.jdbc:%{name} mariadb:mariadb-connector-java -%pom_remove_plugin org.apache.maven.plugins:maven-checkstyle-plugin +%pom_remove_plugin org.jacoco:jacoco-maven-plugin %pom_remove_plugin org.apache.maven.plugins:maven-source-plugin %pom_remove_plugin org.apache.maven.plugins:maven-javadoc-plugin %pom_remove_plugin org.sonatype.plugins:nexus-staging-maven-plugin -%pom_remove_plugin pl.project13.maven:git-commit-id-plugin +%pom_remove_plugin com.coveo:fmt-maven-plugin %pom_remove_plugin -r :maven-gpg-plugin # remove preconfigured OSGi manifest file and generate OSGi manifest file @@ -100,7 +119,7 @@ rm src/main/resources/META-INF/MANIFEST.MF %build # tests are skipped, while they require running application server -%mvn_build -- -Dmaven.test.skip +%mvn_build -f %install %mvn_install @@ -113,6 +132,17 @@ rm src/main/resources/META-INF/MANIFEST.MF %license LICENSE %changelog +* Tue May 24 2022 Zuzana Miklankova - 2.7.1-2 +- autogenerate the Requires only for jna, not jna-platform +- change required version of jna-platform to 'any' in pom.xml + Resolves: #2089627 + +* Mon Feb 07 2022 Zuzana Miklankova - 2.7.1-1 +- Update to 2.7.1 +- Retain compatibility with jna4 +- Adjust pom.xml, so that the rpm Requires jna and jna-platform + Resolves: #2043212 + * Fri Jun 26 2020 Michal Schorm - 2.2.5-3 - Fix requirement on MariaDB Resolves: #1797057