From d05930a15548626d18199f658b204846fe08a5db Mon Sep 17 00:00:00 2001 From: Zuzana Miklankova Date: Fri, 4 Feb 2022 08:27:55 +0100 Subject: [PATCH] Rebase to 3.0.3 (GA) Co-authored-by: mizdebsk@redhat.com 1) Javadoc generation is disabled temporarily, because xmvn javadoc is not able to exclude packages from generating the javadocs. Because of this the javadoc build is failing. The javadoc build can be reenabled when this feature is implemented: https://github.com/fedora-java/xmvn/issues/161 2) Add patch for changing compileSourceRoot for Java9. Resolves: #2049625 --- .gitignore | 1 + compile_source_root.patch | 25 ++++++++++++++++++++ mariadb-java-client.spec | 50 ++++++++++++++++++++++++++++++--------- sources | 2 +- 4 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 compile_source_root.patch diff --git a/.gitignore b/.gitignore index 0f27f9c..280412e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /2.7.3.tar.gz /3.0.0.tar.gz /3.0.1.tar.gz +/3.0.3.tar.gz diff --git a/compile_source_root.patch b/compile_source_root.patch new file mode 100644 index 0000000..f33edd2 --- /dev/null +++ b/compile_source_root.patch @@ -0,0 +1,25 @@ +commit 5cee5e0b2a68d9a62cc5bb447dc1487457517238 +Author: Mikolaj Izdebski +Date: Thu Feb 3 15:10:07 2022 +0100 + + [PATCH] change Java9 compile source root + +--- + pom.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pom.xml b/pom.xml +index 6354ce0a..c6690f8b 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -124,7 +124,7 @@ + 9 + 9 + +- ${project.basedir}/src/main/java9 ++ ${project.basedir}/src/main/java + + true + +-- +2.34.1 diff --git a/mariadb-java-client.spec b/mariadb-java-client.spec index 33ea9db..725f548 100644 --- a/mariadb-java-client.spec +++ b/mariadb-java-client.spec @@ -1,13 +1,16 @@ +%global build_javadoc 0 + Name: mariadb-java-client -Version: 3.0.1 +Version: 3.0.3 Release: 1%{?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 +URL: https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/ +Source0: https://github.com/mariadb-corporation/mariadb-connector-j/archive/refs/tags/%{version}.tar.gz # optional dependency not in Fedora Patch0: remove_waffle-jna.patch +Patch1: compile_source_root.patch BuildArch: noarch BuildRequires: maven-local @@ -25,43 +28,58 @@ BuildRequires: mvn(org.osgi:osgi.core) # since version 1.5.2 missing optional dependency (windows) #BuildRequires: mvn(com.github.dblock.waffle:waffle-jna) +%if %build_javadoc == 0 +Obsoletes: %{name}-javadoc < 3.0.3 +%endif + %description MariaDB Connector/J is a Type 4 JDBC driver, also known as the Direct to Database Pure Java Driver. It was developed specifically as a lightweight JDBC connector for use with MySQL and MariaDB database servers. +%if %build_javadoc %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains the API documentation for %{name}. +%endif %prep -%setup -qn mariadb-connector-j-%{version}-beta +%setup -qn mariadb-connector-j-%{version} # remove missing optional dependency waffle-jna %pom_remove_dep com.github.waffle:waffle-jna %pom_remove_dep ch.qos.logback:logback-classic -%pom_remove_dep com.amazonaws:aws-java-sdk-rds -%pom_remove_dep com.amazonaws:aws-java-sdk-bom +%pom_remove_dep software.amazon.awssdk:bom +%pom_remove_dep software.amazon.awssdk:rds %pom_remove_dep org.junit:junit-bom +%pom_remove_dep org.junit.jupiter:junit-jupiter-engine +%pom_remove_dep org.slf4j:slf4j-api %pom_add_dep net.java.dev.jna:jna %pom_add_dep net.java.dev.jna:jna-platform +# add slf4j dep again, this time not dependent on any specific version %pom_add_dep org.slf4j:slf4j-api # 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 - +%pom_change_dep -r :org.osgi.compendium org.osgi:osgi.cmpn + rm -r src/main/java/org/mariadb/jdbc/plugin/credential/aws -sed -i 's/public void close() {/public void close() throws Exception {/' src/main/java/org/mariadb/jdbc/pool/Pool.java +# removing dependencies and 'provides', which mariadb-java-client cannot process from module-info.java +sed -i '/aws/d' src/main/java9/module-info.java +sed -i '/waffle/d' src/main/java9/module-info.java +# removing missing dependencies from META-INF, so that the mariadb-java-client module would be valid +sed -i '/aws/d' src/main/resources/META-INF/services/org.mariadb.jdbc.plugin.CredentialPlugin +sed -i '/aws/d' src/test/resources/META-INF/services/org.mariadb.jdbc.plugin.CredentialPlugin # also remove the file using the removed plugin rm -f src/main/java/org/mariadb/jdbc/plugin/authentication/addon/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 @@ -74,8 +92,11 @@ rm -f src/main/java/org/mariadb/jdbc/plugin/authentication/addon/gssapi/WindowsN %pom_remove_plugin -r :maven-javadoc-plugin %build +%if %build_javadoc == 0 +opts="-j" +%endif # tests are skipped, while they require running application server -%mvn_build -f +%mvn_build -f $opts %install %mvn_install @@ -84,10 +105,17 @@ rm -f src/main/java/org/mariadb/jdbc/plugin/authentication/addon/gssapi/WindowsN %doc README.md %license LICENSE +%if %build_javadoc %files javadoc -f .mfiles-javadoc %license LICENSE +%endif %changelog +* Thu Feb 03 2022 Zuzana Miklankova - 3.0.3-1 +- Rebase to 3.0.3 +- Temporarily disable generation of -javadoc.rpm, due to missing feature in xmvn, + which leads to build crash + * Wed Aug 18 2021 Ondrej Dubaj - 3.0.1-1 - Rebase to new major version 3.0.1 (it's Beta version) - Removed documentation/ folder, as it was removed by upstream @@ -97,7 +125,7 @@ rm -f src/main/java/org/mariadb/jdbc/plugin/authentication/addon/gssapi/WindowsN Related: rhbz#1991688 * Wed Jun 30 2021 Ondrej Dubaj - 2.7.1-4 -- Remove maven-javadoc-plugin dependency +- Remove maven-javadoc-plugin dependency * Fri Apr 16 2021 Mohan Boddu - 2.7.1-3 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 diff --git a/sources b/sources index 0ddcd1b..b632cc7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (3.0.1.tar.gz) = 10e8137f9899ba7834363d19985d8c355250daf01ca41a30db5e0cedbf134df6efcac0709e37fe76ddb560848879bbce92b26c3d23816211fa543a1bc573c5eb +SHA512 (3.0.3.tar.gz) = cf4dafc53a8b51becbb87cf61b5dec93f339f6d8d1ec04eaf804ea4e8f43afe541f8af1dbb1c54d79a24c42b89d099e87935a287d7449a87422f79fa187020cc