From ede2d2198607fa0a9e91a1d34e7c2bb7188bd2a6 Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 8 Aug 2022 14:07:50 -0400 Subject: [PATCH] Import rpm: d3567196dd3f71b30fb506a9313557aa9da3a98d --- .gitignore | 1 + jline-apache-sshd.patch | 129 +++++++++++++++++++++ jline.spec | 248 ++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 379 insertions(+) create mode 100644 .gitignore create mode 100644 jline-apache-sshd.patch create mode 100644 jline.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7980866 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/jline-2.14.6.tar.gz diff --git a/jline-apache-sshd.patch b/jline-apache-sshd.patch new file mode 100644 index 0000000..8f1ac03 --- /dev/null +++ b/jline-apache-sshd.patch @@ -0,0 +1,129 @@ +--- remote-ssh/src/main/java/org/jline/builtins/ssh/ShellCommand.java.orig 2020-12-11 02:25:01.000000000 -0700 ++++ remote-ssh/src/main/java/org/jline/builtins/ssh/ShellCommand.java 2020-12-13 21:00:45.364500609 -0700 +@@ -18,6 +18,7 @@ import java.util.logging.Logger; + import org.apache.sshd.server.Environment; + import org.apache.sshd.server.ExitCallback; + import org.apache.sshd.server.SessionAware; ++import org.apache.sshd.server.channel.ChannelSession; + import org.apache.sshd.server.command.Command; + import org.apache.sshd.server.session.ServerSession; + +@@ -59,7 +60,7 @@ public class ShellCommand implements Com + this.session = session; + } + +- public void start(final Environment env) throws IOException { ++ public void start(ChannelSession channel, final Environment env) throws IOException { + this.env = env; + new Thread(this::run).start(); + } +@@ -84,7 +85,7 @@ public class ShellCommand implements Com + } + } + +- public void destroy() { ++ public void destroy(ChannelSession session) { + } + + } +--- remote-ssh/src/main/java/org/jline/builtins/ssh/ShellFactoryImpl.java.orig 2020-12-11 02:25:01.000000000 -0700 ++++ remote-ssh/src/main/java/org/jline/builtins/ssh/ShellFactoryImpl.java 2020-12-13 21:00:45.365500608 -0700 +@@ -15,14 +15,15 @@ import java.io.OutputStream; + import java.util.Map; + import java.util.function.Consumer; + +-import org.apache.sshd.common.Factory; + import org.apache.sshd.common.channel.PtyMode; + import org.apache.sshd.server.Environment; + import org.apache.sshd.server.ExitCallback; + import org.apache.sshd.server.SessionAware; + import org.apache.sshd.server.Signal; ++import org.apache.sshd.server.channel.ChannelSession; + import org.apache.sshd.server.command.Command; + import org.apache.sshd.server.session.ServerSession; ++import org.apache.sshd.server.shell.ShellFactory; + import org.jline.terminal.Attributes; + import org.jline.terminal.Attributes.ControlChar; + import org.jline.terminal.Attributes.InputFlag; +@@ -36,7 +37,7 @@ import org.jline.terminal.TerminalBuilde + * SSHD {@link org.apache.sshd.server.command.Command} factory which provides access to + * Shell. + */ +-public class ShellFactoryImpl implements Factory { ++public class ShellFactoryImpl implements ShellFactory { + private final Consumer shell; + + public ShellFactoryImpl(Consumer shell) { +@@ -63,7 +64,7 @@ public class ShellFactoryImpl implements + } + } + +- public Command create() { ++ public Command createShell(ChannelSession channel) throws IOException { + return new ShellImpl(); + } + +@@ -100,7 +101,7 @@ public class ShellFactoryImpl implements + this.session = session; + } + +- public void start(final Environment env) throws IOException { ++ public void start(ChannelSession channel, final Environment env) throws IOException { + try { + new Thread(() -> { + try { +@@ -216,7 +217,7 @@ public class ShellFactoryImpl implements + } + } + terminal.setAttributes(attr); +- env.addSignalListener(signals -> { ++ env.addSignalListener((channel, signal) -> { + terminal.setSize(new Size(Integer.parseInt(env.getEnv().get("COLUMNS")), + Integer.parseInt(env.getEnv().get("LINES")))); + terminal.raise(Terminal.Signal.WINCH); +@@ -229,6 +230,10 @@ public class ShellFactoryImpl implements + } + + public void destroy() { ++ this.destroy(null); ++ } ++ ++ public void destroy(ChannelSession session) { + if (!closed) { + closed = true; + flush(out, err); +--- remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java.orig 2020-12-11 02:25:01.000000000 -0700 ++++ remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java 2020-12-13 21:00:45.366500608 -0700 +@@ -20,8 +20,10 @@ import org.apache.sshd.client.channel.Cl + import org.apache.sshd.client.channel.ClientChannelEvent; + import org.apache.sshd.client.future.ConnectFuture; + import org.apache.sshd.client.session.ClientSession; ++import org.apache.sshd.common.NamedResource; + import org.apache.sshd.common.channel.PtyMode; + import org.apache.sshd.common.config.keys.FilePasswordProvider; ++import org.apache.sshd.common.session.SessionContext; + import org.apache.sshd.common.util.io.NoCloseInputStream; + import org.apache.sshd.common.util.io.NoCloseOutputStream; + import org.apache.sshd.server.SshServer; +@@ -362,7 +364,7 @@ public class Ssh { + server.setHost(ip); + server.setShellFactory(new ShellFactoryImpl(shell)); + server.setCommandFactory(new ScpCommandFactory.Builder() +- .withDelegate(command -> new ShellCommand(execute, command)).build()); ++ .withDelegate((channel, command) -> new ShellCommand(execute, command)).build()); + server.setSubsystemFactories(Collections.singletonList( + new SftpSubsystemFactory.Builder().build() + )); +@@ -390,8 +392,10 @@ public class Ssh { + } + + @Override +- public String getPassword(String resourceKey) throws IOException { +- return readLine("Enter password for " + resourceKey + ":", false); ++ public String getPassword(SessionContext session, NamedResource resourceKey, int retryIndex) throws IOException { ++ if (retryIndex == 0) ++ return readLine("Enter password for " + resourceKey.getName() + ":", false); ++ return readLine("Enter password again for " + resourceKey.getName() + ":", false); + } + + @Override diff --git a/jline.spec b/jline.spec new file mode 100644 index 0000000..5704e4b --- /dev/null +++ b/jline.spec @@ -0,0 +1,248 @@ +Name: jline +Version: 2.14.6 +Release: 2%{?dist} +Summary: JLine is a Java library for handling console input +License: BSD +URL: https://github.com/jline/jline2 +BuildArch: noarch + +Source0: https://github.com/jline/jline2/archive/jline-%{version}.tar.gz + +BuildRequires: maven-local +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) +BuildRequires: mvn(org.easymock:easymock) +BuildRequires: mvn(org.fusesource.jansi:jansi) +BuildRequires: mvn(org.powermock:powermock-api-easymock) +BuildRequires: mvn(org.powermock:powermock-module-junit4) +BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) + +Obsoletes: jline2 < %{version}-%{release} +Provides: jline2 = %{version}-%{release} + +%description +JLine is a Java library for handling console input. It is similar +in functionality to BSD editline and GNU readline. People familiar +with the readline/editline capabilities for modern shells (such as +bash and tcsh) will find most of the command editing features of +JLine to be familiar. + +%package javadoc +Summary: Javadocs for %{name} +Obsoletes: jline2-javadoc < %{version}-%{release} +Provides: jline2-javadoc = %{version}-%{release} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n jline2-jline-%{version} + +# Remove maven-shade-plugin usage +%pom_remove_plugin "org.apache.maven.plugins:maven-shade-plugin" +# Remove animal sniffer plugin in order to reduce deps +%pom_remove_plugin "org.codehaus.mojo:animal-sniffer-maven-plugin" + +# Remove unavailable and unneeded deps +%pom_xpath_remove "pom:build/pom:extensions" +%pom_remove_plugin :maven-site-plugin +%pom_remove_plugin :maven-enforcer-plugin +%pom_remove_plugin :maven-javadoc-plugin + +# Makes the build fail on deprecation warnings from jansi +%pom_xpath_remove 'pom:arg[text()="-Werror"]' + +# Do not import non-existing internal package +%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Import-Package" +%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions" "javax.swing;resolution:=optional,org.fusesource.jansi,!org.fusesource.jansi.internal" + +# Be sure to export jline.internal, but not org.fusesource.jansi. +# See https://bugzilla.redhat.com/show_bug.cgi?id=1317551 +%pom_xpath_set "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:executions/pom:execution/pom:configuration/pom:instructions/pom:Export-Package" "jline.*;-noimport:=true" + +# For some reason these directories do not exist, failing compilation due to -Werror +mkdir -p target/generated-sources/annotations +mkdir -p target/generated-test-sources/test-annotations + +# nondeterministic +find -name TerminalFactoryTest.java -delete + +%build +%mvn_build + +%install +%mvn_install + +%files -f .mfiles + +%files javadoc -f .mfiles-javadoc + +%changelog +* Fri Jun 29 2018 Mikolaj Izdebski - 2.14.6-2 +- Remove explicit invocation of maven-javadoc-plugin + +* Thu May 24 2018 Michael Simacek - 2.14.6-1 +- Update to upstream version 2.14.6 + +* Fri Mar 16 2018 Michael Simacek - 2.13-12 +- Remove -Werror to fix FTBFS + +* Wed Feb 07 2018 Fedora Release Engineering - 2.13-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.13-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Feb 16 2017 Michael Simacek - 2.13-9 +- Correct license tag to just BSD + +* Fri Feb 10 2017 Fedora Release Engineering - 2.13-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 02 2017 Michael Simacek - 2.13-7 +- Remove BR on site-plugin + +* Wed Jun 22 2016 Michael Simacek - 2.13-6 +- Remove nondeterministic test + +* Wed Jun 15 2016 Mikolaj Izdebski - 2.13-5 +- Regenerate build-requires + +* Thu May 05 2016 Michael Simacek - 2.13-4 +- Try to eliminate test nondeterminism + +* Mon Mar 14 2016 Severin Gehwolf - 2.13-3 +- OSGi export jline.internal. Resolves RHBZ#1317551. + +* Thu Feb 04 2016 Fedora Release Engineering - 2.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Nov 25 2015 Severin Gehwolf - 2.13-1 +- Update to upstream 2.13 release. + +* Wed Jun 17 2015 Fedora Release Engineering - 2.12.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Feb 18 2015 Alexander Kurtakov 2.12.1-1 +- Update to upstream 2.12.1 release. + +* Mon Jan 26 2015 Mat Booth - 2.10-15 +- Fix FTBFS due to missing BR on site-plugin +- Fix directory ownership +- Fix bogus date in changelog + +* Sun Jun 08 2014 Fedora Release Engineering - 2.10-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 26 2014 Mikolaj Izdebski - 2.10-13 +- Migrate BuildRequires from junit4 to junit + +* Mon May 26 2014 Mikolaj Izdebski - 2.10-12 +- Remove BuildRequires on maven-surefire-provider-junit4 + +* Tue Mar 11 2014 Michael Simacek - 2.10-11 +- Drop manual requires + +* Tue Mar 04 2014 Stanislav Ochotnicky - 2.10-10 +- Use Requires: java-headless rebuild (#1067528) + +* Tue Oct 29 2013 Severin Gehwolf - 2.10-9 +- Package jline 2.x as jline. Resolves RHBZ#1022915. +- Part of a large effort to make jline1 a compat package rather than jline2. + See RHBZ#1022897. +- Switch to xmvn. + +* Sat Aug 03 2013 Fedora Release Engineering - 1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Feb 06 2013 Java SIG - 1.0-3 +- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild +- Replace maven BuildRequires with maven-local + +* Thu Jul 19 2012 Fedora Release Engineering - 1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Feb 1 2012 Alexander Kurtakov 1.0-1 +- Update to 1.0. + +* Fri Jan 13 2012 Fedora Release Engineering - 0.9.94-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Dec 13 2011 Alexander Kurtakov 0.9.94-6 +- Build with maven 3.x. + +* Sat Oct 15 2011 Ville Skyttä - 0.9.94-5 +- BuildRequire maven2. + +* Sat Oct 15 2011 Ville Skyttä - 0.9.94-4 +- Patch delete to actually behave as delete instead of backspace, include + keybindings.properties in docs (#720170). +- Drop executable bit from jar. +- Crosslink with local javadocs. +- Include LICENSE.txt in -javadoc. + +* Wed Feb 09 2011 Fedora Release Engineering - 0.9.94-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Dec 18 2010 Mat Booth - 0.9.94-2 +- Remove pre-built Windows-only binary artifacts. +- Demo package was defined but never built for some reason. +- Don't also package jar in the javadoc package! +- Drop versioned java and javadocs. + +* Sat Dec 18 2010 Mat Booth - 0.9.94-1 +- Remove bundled jars in %%prep phase. +- Tidy up spec file, fix some rpmlint warnings. +- Add pom and depmaps. + +* Mon Mar 8 2010 Peter Lemenkov - 0:0.9.94-0.6 +- Added missing Requires: jpackage-utils (%%{_javadir} and %%{_javadocdir}) + +* Tue Jan 12 2010 Alexander Kurtakov 0:0.9.94-0.5 +- Fix BRs. +- Drop gcj_support. + +* Fri Jul 24 2009 Fedora Release Engineering - 0:0.9.94-0.4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 0:0.9.94-0.3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Jul 9 2008 Tom "spot" Callaway - 0:9.94-0.2 +- drop repotag + +* Mon Mar 24 2008 Matt Wringe - 0:9.94-0jpp.1 +- Update to 0.9.94 (BZ #436204) + +* Tue Feb 19 2008 Fedora Release Engineering - 0:0.9.9-2jpp.1 +- Autorebuild for GCC 4.3 + +* Tue Mar 06 2007 Matt Wringe - 0:0.9.9-1jpp.1 +- Add option to build with ant. +- Fix various rpmlint issues +- Specify proper license + +* Thu May 04 2006 Alexander Kurtakov - 0:0.9.9-1jpp +- Upgrade to 0.9.9 + +* Thu May 04 2006 Ralph Apel - 0:0.9.5-1jpp +- Upgrade to 0.9.5 +- First JPP-1.7 release + +* Mon Apr 25 2005 Fernando Nasser - 0:0.9.1-1jpp +- Upgrade to 0.9.1 +- Disable attempt to include external jars + +* Mon Apr 25 2005 Fernando Nasser - 0:0.8.1-3jpp +- Changes to use locally installed DTDs +- Do not try and access sun site for linking javadoc + +* Mon Aug 23 2004 Randy Watler - 0:0.8.1-2jpp +- Rebuild with ant-1.6.2 + +* Mon Jan 26 2004 David Walluck 0:0.8.1-1jpp +- release diff --git a/sources b/sources new file mode 100644 index 0000000..03772fb --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (jline-2.14.6.tar.gz) = 9c060a752498e68b70a91ae29c915093f6f75927