From d1162288d4e9190626b491a91e930a077c024949fc71f4fe35d8d90b1a7f4415 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 16 Nov 2022 08:44:14 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/apache-sshd?expand=0&rev=10 --- ...ependency-on-native-tomcat-APR-libra.patch | 4 +- 0002-Fix-manifest-generation.patch | 11 --- apache-sshd-2.7.0-java8.patch | 75 ------------------- apache-sshd-2.7.0-src.tar.gz | 3 - apache-sshd-2.9.2-src.tar.gz | 3 + apache-sshd.spec | 17 +++-- 6 files changed, 14 insertions(+), 99 deletions(-) delete mode 100644 0002-Fix-manifest-generation.patch delete mode 100644 apache-sshd-2.7.0-java8.patch delete mode 100644 apache-sshd-2.7.0-src.tar.gz create mode 100644 apache-sshd-2.9.2-src.tar.gz diff --git a/0001-Avoid-optional-dependency-on-native-tomcat-APR-libra.patch b/0001-Avoid-optional-dependency-on-native-tomcat-APR-libra.patch index 16dc5e1..b303f72 100644 --- a/0001-Avoid-optional-dependency-on-native-tomcat-APR-libra.patch +++ b/0001-Avoid-optional-dependency-on-native-tomcat-APR-libra.patch @@ -14,9 +14,9 @@ diff --git a/pom.xml b/pom.xml index 867ca88..7c29678 100644 --- a/pom.xml +++ b/pom.xml -@@ -406,11 +406,6 @@ +@@ -428,11 +428,6 @@ mina-core - 2.0.21 + 2.0.23 - - tomcat diff --git a/0002-Fix-manifest-generation.patch b/0002-Fix-manifest-generation.patch deleted file mode 100644 index 1de880f..0000000 --- a/0002-Fix-manifest-generation.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up ./pom.xml.fix ./pom.xml ---- ./pom.xml.fix 2021-04-20 21:32:51.749782800 -0400 -+++ ./pom.xml 2021-04-20 21:33:22.600740917 -0400 -@@ -1020,7 +1020,6 @@ - - - -- org.apache.sshd*;version="[$(version;==;${sshd.osgi.version.clean}),$(version;=+;${sshd.osgi.version.clean}))",* - *;-noimport:=true - - pom diff --git a/apache-sshd-2.7.0-java8.patch b/apache-sshd-2.7.0-java8.patch deleted file mode 100644 index 21ff9ca..0000000 --- a/apache-sshd-2.7.0-java8.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- apache-sshd-2.7.0/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java 2021-07-30 09:48:59.082251041 +0200 -+++ apache-sshd-2.7.0/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java 2021-07-30 09:54:40.568508196 +0200 -@@ -353,13 +353,13 @@ - log.trace("handleReadCycleCompletion({}) read {} bytes after {} nanos at cycle={}", - this, result, System.nanoTime() - lastReadCycleStart.get(), readCyclesCounter); - } -- buffer.flip(); -+ ((java.nio.Buffer)buffer).flip(); - - IoHandler handler = getIoHandler(); - handler.messageReceived(this, bufReader); - if (!closeFuture.isClosed()) { - // re-use reference for next iteration since we finished processing it -- buffer.clear(); -+ ((java.nio.Buffer)buffer).clear(); - doReadCycle(buffer, completionHandler); - } else { - if (debugEnabled) { ---- apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java 2021-07-30 09:48:59.150251491 +0200 -+++ apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java 2021-07-30 09:54:40.572508221 +0200 -@@ -21,6 +21,7 @@ - - import java.io.IOException; - import java.io.StreamCorruptedException; -+import java.nio.Buffer; - import java.nio.ByteBuffer; - import java.nio.MappedByteBuffer; - import java.nio.channels.AsynchronousCloseException; -@@ -153,7 +154,7 @@ - if (read > 0) { - // reference equality on purpose - if (wrap == buffer) { -- wrap.position(wrap.position() + read); -+ ((Buffer)wrap).position(wrap.position() + read); - } else { - buffer.put(wrap.array(), wrap.arrayOffset(), read); - } -@@ -258,7 +259,7 @@ - wrap.arrayOffset() + wrap.position(), written); - // reference equality on purpose - if (wrap == buffer) { -- wrap.position(wrap.position() + written); -+ ((Buffer)wrap).position(wrap.position() + written); - } - curPos += written; - totalWritten += written; ---- apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/AbstractSftpSubsystemHelper.java 2021-07-30 09:48:59.150251491 +0200 -+++ apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/AbstractSftpSubsystemHelper.java 2021-07-30 09:55:19.804767492 +0200 -@@ -942,7 +942,7 @@ - if (remainLen < digestBuf.length) { - bb = ByteBuffer.wrap(digestBuf, 0, remainLen); - } -- bb.clear(); // prepare for next read -+ ((java.nio.Buffer)bb).clear(); // prepare for next read - - int readLen = channel.read(bb); - if (readLen < 0) { -@@ -967,7 +967,7 @@ - if (remainLen < digestBuf.length) { - bb = ByteBuffer.wrap(digestBuf, 0, remainLen); - } -- bb.clear(); // prepare for next read -+ ((java.nio.Buffer)bb).clear(); // prepare for next read - - int readLen = channel.read(bb); - if (readLen < 0) { -@@ -1101,7 +1101,7 @@ - if (remainLen < digestBuf.length) { - bb = ByteBuffer.wrap(digestBuf, 0, remainLen); - } -- bb.clear(); // prepare for next read -+ ((java.nio.Buffer)bb).clear(); // prepare for next read - - int readLen = channel.read(bb); - if (readLen < 0) { diff --git a/apache-sshd-2.7.0-src.tar.gz b/apache-sshd-2.7.0-src.tar.gz deleted file mode 100644 index 6306bf9..0000000 --- a/apache-sshd-2.7.0-src.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fe3f9ca72930fd4b01e2969f32f7d2aedd9b364fd42ca124cc3384bd23de7007 -size 1535548 diff --git a/apache-sshd-2.9.2-src.tar.gz b/apache-sshd-2.9.2-src.tar.gz new file mode 100644 index 0000000..e5ba2c8 --- /dev/null +++ b/apache-sshd-2.9.2-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeea62247ea87213f20f6b1d6f817776d2c7493ff23fbc4a1f99e0081631c02e +size 1743627 diff --git a/apache-sshd.spec b/apache-sshd.spec index a627b9d..567b105 100644 --- a/apache-sshd.spec +++ b/apache-sshd.spec @@ -1,7 +1,7 @@ # # spec file for package apache-sshd # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: apache-sshd -Version: 2.7.0 +Version: 2.9.2 Release: 0 Summary: Apache SSHD # One file has ISC licensing: @@ -27,8 +27,6 @@ URL: https://mina.apache.org/sshd-project Source0: https://archive.apache.org/dist/mina/sshd/%{version}/apache-sshd-%{version}-src.tar.gz # Avoid optional dep on tomcat native APR library Patch0: 0001-Avoid-optional-dependency-on-native-tomcat-APR-libra.patch -Patch1: 0002-Fix-manifest-generation.patch -Patch2: apache-sshd-2.7.0-java8.patch BuildRequires: fdupes BuildRequires: maven-local BuildRequires: mvn(junit:junit) @@ -46,6 +44,7 @@ BuildRequires: mvn(org.bouncycastle:bcpg-jdk15on) BuildRequires: mvn(org.bouncycastle:bcpkix-jdk15on) BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) BuildRequires: mvn(org.codehaus.plexus:plexus-archiver) +BuildRequires: mvn(org.slf4j:jcl-over-slf4j) BuildRequires: mvn(org.slf4j:slf4j-api) BuildArch: noarch @@ -64,14 +63,12 @@ This package provides %{name}. # Avoid optional dep on tomcat native APR library %patch0 -p1 -%patch1 -p1 -%patch2 -p1 rm -rf sshd-core/src/main/java/org/apache/sshd/agent/unix # Avoid unnecessary dep on spring framework %pom_remove_dep :spring-framework-bom -%pom_remove_dep :testcontainers-bom sshd-sftp +%pom_remove_dep :testcontainers-bom sshd-sftp sshd-core # Build the core modules only %pom_disable_module assembly @@ -101,7 +98,11 @@ rm -rf sshd-core/src/main/java/org/apache/sshd/agent/unix %build # Can't run tests, they require ch.ethz.ganymed:ganymed-ssh2 -%{mvn_build} -f -- -Dworkspace.root.dir=$(pwd) -Dsource=8 +%{mvn_build} -f -- -Dworkspace.root.dir=$(pwd) \ +%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0} + -Dmaven.compiler.release=8 \ +%endif + -Dsource=8 %install %mvn_install