From b8f023dd788768be90c496550d4b947fb750c6cc82e9c3f79eccfdcadbb0fab3 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 30 May 2023 16:09:21 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jsch?expand=0&rev=35 --- jsch-0.1.54-sourcetarget.patch | 13 -- jsch-0.1.55.pom | 111 -------------- jsch-0.1.55.zip | 3 - jsch-0.2.9.tar.gz | 3 + jsch-build.xml | 269 +++++++++++++++++++++++++++++++++ jsch-junixsocket.patch | 35 +++++ jsch-osgi-manifest.patch | 23 --- jsch.spec | 53 +++---- plugin.properties | 13 -- 9 files changed, 334 insertions(+), 189 deletions(-) delete mode 100644 jsch-0.1.54-sourcetarget.patch delete mode 100644 jsch-0.1.55.pom delete mode 100644 jsch-0.1.55.zip create mode 100644 jsch-0.2.9.tar.gz create mode 100644 jsch-build.xml create mode 100644 jsch-junixsocket.patch delete mode 100644 jsch-osgi-manifest.patch delete mode 100644 plugin.properties diff --git a/jsch-0.1.54-sourcetarget.patch b/jsch-0.1.54-sourcetarget.patch deleted file mode 100644 index d4453fb..0000000 --- a/jsch-0.1.54-sourcetarget.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- jsch-0.1.54/build.xml 2016-08-30 09:06:39.000000000 +0200 -+++ jsch-0.1.54/build.xml 2017-09-08 10:27:56.694518991 +0200 -@@ -35,8 +35,8 @@ - - - - - 4.0.0 - com.jcraft - jsch - jar - 0.1.55 - JSch - http://www.jcraft.com/jsch/ - JSch is a pure Java implementation of SSH2 - - JCraft,Inc. - http://www.jcraft.com/ - - - scm:git:http://git.jcraft.com/jsch.git - scm:git:http://git.jcraft.com/jsch.git - http://git.jcraft.com/jsch.git - - - - ymnk - Atsuhiko Yamanaka - ymnk at jcraft D0t com - http://github.com/ymnk - JCraft,Inc. - http://www.jcraft.com/ - - architect - developer - - +9 - - - - - Revised BSD - http://www.jcraft.com/jsch/LICENSE.txt - - - - - com.jcraft - jzlib - 1.0.7 - true - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - org.apache.maven.wagon - wagon-ssh-external - 1.0-alpha-5 - - - - - - org.sonatype.oss - oss-parent - 6 - - diff --git a/jsch-0.1.55.zip b/jsch-0.1.55.zip deleted file mode 100644 index 856eeb9..0000000 --- a/jsch-0.1.55.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:063bf66e163f43b7d7897ac14efe1e80ed094d4016afe1181fe2285e3797bed3 -size 369664 diff --git a/jsch-0.2.9.tar.gz b/jsch-0.2.9.tar.gz new file mode 100644 index 0000000..43b705f --- /dev/null +++ b/jsch-0.2.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f7c7437115466c53781be7683aa84237f5d968ac7925997beef8f4311ebaad9 +size 382571 diff --git a/jsch-build.xml b/jsch-build.xml new file mode 100644 index 0000000..471738c --- /dev/null +++ b/jsch-build.xml @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jsch-junixsocket.patch b/jsch-junixsocket.patch new file mode 100644 index 0000000..761649f --- /dev/null +++ b/jsch-junixsocket.patch @@ -0,0 +1,35 @@ +--- a/src/main/java/com/jcraft/jsch/SSHAgentConnector.java ++++ b/src/main/java/com/jcraft/jsch/SSHAgentConnector.java +@@ -93,21 +93,7 @@ public class SSHAgentConnector implements AgentConnector { + } + + private static USocketFactory getUSocketFactory() throws AgentProxyException { +- try { +- return new UnixDomainSocketFactory(); +- } catch (AgentProxyException e) { +- try { +- return new JUnixSocketFactory(); +- } catch (NoClassDefFoundError ee) { +- AgentProxyException eee = new AgentProxyException("junixsocket library unavailable"); +- eee.addSuppressed(e); +- eee.addSuppressed(ee); +- throw eee; +- } catch (AgentProxyException ee) { +- ee.addSuppressed(e); +- throw e; +- } +- } ++ return new UnixDomainSocketFactory(); + } + + private static Path getSshAuthSocket() throws AgentProxyException { +--- a/src/main/java9/module-info.java ++++ b/src/main/java9/module-info.java +@@ -6,7 +6,6 @@ module com.jcraft.jsch { + requires static org.apache.logging.log4j; + requires static org.slf4j; + requires static org.bouncycastle.provider; +- requires static org.newsclub.net.unix; + requires static com.sun.jna; + requires static com.sun.jna.platform; + } diff --git a/jsch-osgi-manifest.patch b/jsch-osgi-manifest.patch deleted file mode 100644 index 491f77a..0000000 --- a/jsch-osgi-manifest.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- jsch-0.1.54/build.xml 2016-08-30 09:06:39.000000000 +0200 -+++ jsch-0.1.54/build.xml 2020-04-07 15:40:40.461145903 +0200 -@@ -50,9 +50,7 @@ - - - -- - - - diff --git a/jsch.spec b/jsch.spec index 0054f11..879b2b7 100644 --- a/jsch.spec +++ b/jsch.spec @@ -17,25 +17,27 @@ Name: jsch -Version: 0.1.55 +Version: 0.2.9 Release: 0 Summary: Pure Java implementation of SSH2 License: BSD-3-Clause Group: Development/Libraries/Java URL: https://www.jcraft.com/jsch/ -Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.zip -Source1: https://repo1.maven.org/maven2/com/jcraft/%{name}/%{version}/%{name}-%{version}.pom -Source2: plugin.properties -Patch0: jsch-0.1.54-sourcetarget.patch -Patch1: jsch-osgi-manifest.patch +Source0: https://github.com/mwiede/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz +Source1: %{name}-build.xml +Patch0: jsch-junixsocket.patch BuildRequires: ant BuildRequires: fdupes -BuildRequires: java-devel >= 1.6.0 -BuildRequires: javapackages-local -BuildRequires: jzlib -BuildRequires: unzip -BuildRequires: zip -Requires: jzlib +# We build different multiversion overrides for 9, 10, 11, 15 and 16 +BuildRequires: java-devel >= 17 +BuildRequires: bouncycastle +BuildRequires: javapackages-local >= 6 +BuildRequires: jna +BuildRequires: jna-contrib +BuildRequires: log4j +BuildRequires: slf4j +# The jar still works with Java 8 +Requires: java >= 1.8 BuildArch: noarch %description @@ -62,32 +64,31 @@ X11 forwarding, file transfer, etc., and you can integrate its functionality into your own Java programs. %prep -%setup -q +%setup -q -n %{name}-%{name}-%{version} +cp %{SOURCE1} build.xml + +# We don't have junixsocket +%pom_remove_dep com.kohlschutter.junixsocket: +rm src/main/java/com/jcraft/jsch/JUnixSocketFactory.java %patch0 -p1 -%patch1 -p1 -cp %{SOURCE1} pom.xml -%pom_remove_parent %build -export CLASSPATH=$(build-classpath jzlib) -ant dist javadoc +mkdir -p lib +build-jar-repository -s lib jna jna-platform slf4j/api bcprov log4j/log4j-api +ant jar javadoc %install -# inject the OSGi Manifest -cp %{SOURCE2} plugin.properties -jar uf dist/lib/%{name}-*.jar plugin.properties - # jars -install -Dpm 644 dist/lib/%{name}-*.jar %{buildroot}%{_javadir}/%{name}.jar +install -Dpm 644 target/%{name}-*.jar %{buildroot}%{_javadir}/%{name}.jar # pom install -d -m 755 %{buildroot}%{_mavenpomdir} -install -p -m 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom -%add_maven_depmap %{name}.pom %{name}.jar +%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom +%add_maven_depmap %{name}.pom %{name}.jar -a com.jcraft:jsch # javadoc install -dm 755 %{buildroot}%{_javadocdir}/%{name} -cp -pr javadoc/* %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %fdupes -s %{buildroot}%{_javadocdir}/%{name} # examples diff --git a/plugin.properties b/plugin.properties deleted file mode 100644 index 175e422..0000000 --- a/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################### -# Copyright (c) 2006 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Atsuhiko Yamanaka, JCraft,Inc. - initial API and implementation. -# IBM Corporation - implementation -############################################################################### -venderName=JCraft, Inc. -bundleName=JSch