diff --git a/ftpserver-1.0.6-src.tar.gz b/ftpserver-1.0.6-src.tar.gz new file mode 100644 index 0000000..bfb85ac Binary files /dev/null and b/ftpserver-1.0.6-src.tar.gz differ diff --git a/mina-ftpserver-1.0.6-mina2.0.9.patch b/mina-ftpserver-1.0.6-mina2.0.9.patch new file mode 100644 index 0000000..f3de55f --- /dev/null +++ b/mina-ftpserver-1.0.6-mina2.0.9.patch @@ -0,0 +1,41 @@ +diff -Nru apache-ftpserver-1.0.6/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java apache-ftpserver-1.0.6.mina/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java +--- apache-ftpserver-1.0.6/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java 2011-06-25 22:48:23.000000000 +0200 ++++ apache-ftpserver-1.0.6.mina/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java 2015-09-28 11:55:31.616329607 +0200 +@@ -37,6 +37,7 @@ + import org.apache.ftpserver.ftplet.Structure; + import org.apache.ftpserver.ftplet.User; + import org.apache.ftpserver.listener.Listener; ++import org.apache.mina.core.filterchain.IoFilter; + import org.apache.mina.core.filterchain.IoFilterChain; + import org.apache.mina.core.future.CloseFuture; + import org.apache.mina.core.future.ReadFuture; +@@ -876,4 +877,18 @@ + public void updateThroughput(long currentTime, boolean force) { + wrappedSession.updateThroughput(currentTime, force); + } ++ ++ public boolean isSecured() { ++ // If the session does not have a SslFilter, we can return false ++ IoFilterChain chain = getFilterChain(); ++ ++ IoFilter sslFilter = chain.get(SslFilter.class); ++ ++ if (sslFilter != null) { ++ // Get the SslHandler from the SslFilter ++ return ((SslFilter)sslFilter).isSslStarted(this); ++ } else { ++ return false; ++ } ++ } + } +diff -Nru apache-ftpserver-1.0.6/core/src/main/java/org/apache/ftpserver/listener/nio/FtpHandlerAdapter.java apache-ftpserver-1.0.6.mina/core/src/main/java/org/apache/ftpserver/listener/nio/FtpHandlerAdapter.java +--- apache-ftpserver-1.0.6/core/src/main/java/org/apache/ftpserver/listener/nio/FtpHandlerAdapter.java 2011-06-25 22:48:22.000000000 +0200 ++++ apache-ftpserver-1.0.6.mina/core/src/main/java/org/apache/ftpserver/listener/nio/FtpHandlerAdapter.java 2015-09-28 11:55:45.981530183 +0200 +@@ -99,4 +99,7 @@ + + } + ++ public void inputClosed(IoSession session) throws Exception { ++ session.close(true); ++ } + } diff --git a/mina-ftpserver.spec b/mina-ftpserver.spec new file mode 100644 index 0000000..917cc18 --- /dev/null +++ b/mina-ftpserver.spec @@ -0,0 +1,108 @@ +Name: mina-ftpserver +Version: 1.0.6 +Release: 1 +Summary: A 100% pure Java FTP server +License: ASL 2.0 +URL: http://mina.apache.org/ftpserver-project/ +Source0: https://archive.apache.org/dist/mina/ftpserver/%{version}/ftpserver-%{version}-src.tar.gz +Patch0: mina-ftpserver-1.0.6-mina2.0.9.patch + +BuildRequires: maven-local mvn(commons-codec:commons-codec) mvn(commons-net:commons-net) +BuildRequires: mvn(hsqldb:hsqldb:1) mvn(junit:junit) mvn(log4j:log4j:1.2.17) +BuildRequires: mvn(org.apache:apache:pom:) mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) +BuildRequires: mvn(org.apache.mina:mina-core) mvn(org.osgi:org.osgi.core) +BuildRequires: mvn(org.slf4j:jcl-over-slf4j) mvn(org.slf4j:slf4j-api) +BuildRequires: mvn(org.slf4j:slf4j-log4j12) mvn(org.springframework:spring-beans) +BuildRequires: mvn(org.springframework:spring-context) +BuildRequires: mvn(org.springframework:spring-context-support) +BuildArch: noarch + +%description +The Apache FtpServer is a 100% pure Java FTP server. It's +designed to be a complete and portable FTP server engine +solution based on currently available open protocols. +FtpServer can be run standalone as a Windows service or +Unix/Linux daemon, or embedded into a Java application. +We also provide support for integration within Spring +applications and provide our releases as OSGi bundles. +The default network support is based on Apache MINA, a +high performance asynchronous IO library. Using MINA, +FtpServer can scale to a large number of concurrent users. +It is also an FTP application platform. We have developed +a Java API to let you write Java code to process FTP event +notifications that we call the Ftplet API. Apache FtpServer +provides an implementation of an FTP server to support this +API. + +%package examples +Summary: Apache FtpServer Examples + +%description examples +This package provides: +* FtpServer OSGi Ftplet service example +* FtpServer OSGi Spring-DM example + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +This package contains javadoc for %{name}. + +%prep +%setup -q -n apache-ftpserver-%{version} +mv src/* . +find . -name "*.bat" -delete +find . -name "*.class" -delete +find . -name "*.exe" -delete +find . -name "*.jar" -delete +%patch0 -p1 +%pom_disable_module distribution +%pom_disable_module ftpserver-example-spring-war examples +%pom_remove_plugin :maven-source-plugin +%pom_remove_plugin -r :rat-maven-plugin +%pom_remove_plugin :jxr-maven-plugin ftplet-api +%pom_xpath_set "pom:Bundle-SymbolicName" '${project.artifactId}' ftplet-api +%pom_xpath_set "pom:Bundle-SymbolicName" '${project.artifactId}' core +%pom_xpath_set "pom:Bundle-SymbolicName" '${project.artifactId}' examples/ftpserver-osgi-ftplet-service +%pom_xpath_set "pom:Bundle-SymbolicName" '${project.artifactId}' examples/ftpserver-osgi-spring-service +%pom_xpath_remove "pom:Private-Package" core +%pom_xpath_inject "pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions" " +org.apache.ftpserver.command.impl, +org.apache.ftpserver.command.impl.listing, +org.apache.ftpserver.filesystem.nativefs.impl, +org.apache.ftpserver.ftpletcontainer.impl, +org.apache.ftpserver.impl, org.apache.ftpserver.listener.nio, +org.apache.ftpserver.message.impl, org.apache.ftpserver.ssl.impl, +org.apache.ftpserver.usermanager.impl, +org.apache.ftpserver.util" core +%pom_change_dep org.osgi:osgi_R4_core org.osgi:org.osgi.core examples/ftpserver-osgi-ftplet-service +%pom_change_dep -r :hsqldb :hsqldb:1 +%pom_change_dep -r :log4j :log4j:1.2.17 +%mvn_package :ftpserver-examples examples +%mvn_package :ftpserver-osgi-*-service examples +rm core/src/test/java/org/apache/ftpserver/impl/DefaultFtpServerTest.java \ + core/src/test/java/org/apache/ftpserver/ssl/MinaExplicitSSLTest.java \ + core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java \ + core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitSSLTest.java \ + core/src/test/java/org/apache/ftpserver/clienttests/PasvUsedPortTest.java + +%build +%mvn_build -- -Dproject.build.sourceEncoding=UTF-8 + +%install +%mvn_install + +%files -f .mfiles +%doc distribution/README.txt +%license LICENSE NOTICE + +%files examples -f .mfiles-examples +%license LICENSE NOTICE + +%files javadoc -f .mfiles-javadoc +%license LICENSE NOTICE + +%changelog +* Tue Jul 28 2020 leiju - 1.0.6-1 +- Package init diff --git a/mina-ftpserver.yaml b/mina-ftpserver.yaml new file mode 100644 index 0000000..3e2cb4f --- /dev/null +++ b/mina-ftpserver.yaml @@ -0,0 +1,4 @@ +version_control: svn +src_repo: https://svn.apache.org/repos/asf/mina/ftpserver +tag_prefix: "^" +seperator: "."