diff --git a/apache-sshd.spec b/apache-sshd.spec index b965ea8..40cb9c6 100644 --- a/apache-sshd.spec +++ b/apache-sshd.spec @@ -22,6 +22,7 @@ %else %bcond_with extras %endif +%global homedir %{_datadir}/apache-sshd Version: 2.12.0 Release: 0 Summary: Apache SSHD @@ -51,6 +52,7 @@ BuildRequires: mvn(org.slf4j:slf4j-api) BuildArch: noarch %if %{with extras} Name: apache-sshd-%{flavor} +BuildRequires: xmvn-subst BuildRequires: mvn(io.netty:netty-handler) BuildRequires: mvn(io.netty:netty-transport) BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) @@ -77,6 +79,31 @@ BuildRequires: mvn(org.codehaus.plexus:plexus-archiver) Apache SSHD is a 100% pure java library to support the SSH protocols on both the client and server side. +%if %{with extras} +%package -n apache-sshd-standalone +Summary: Standalone installation of apache-sshd +Requires: apache-sshd +Requires: apache-sshd-extras +Requires: assertj-core +Requires: bouncycastle +Requires: bouncycastle-pg +Requires: bouncycastle-pkix +Requires: bouncycastle-util +Requires: byte-buddy +Requires: ed25519-java +Requires: javaewah +Requires: jcl-over-slf4j +Requires: jctools +Requires: jgit +Requires: netty +Requires: objectweb-asm +Requires: slf4j +Requires: slf4j-jdk14 + +%description -n apache-sshd-standalone +This package provides standalone installation of apache-sshd +%endif + %package javadoc Summary: API documentation for %{name} @@ -135,6 +162,11 @@ rm -rf sshd-core/src/main/java/org/apache/sshd/agent/unix %pom_remove_plugin :maven-clean-plugin %pom_remove_plugin :formatter-maven-plugin . sshd-core +# We only need the unix-bin execution +%pom_xpath_remove "pom:executions/pom:execution[pom:id[text()='unix-src']]" assembly +%pom_xpath_remove "pom:executions/pom:execution[pom:id[text()='windows-bin']]" assembly +%pom_xpath_remove "pom:executions/pom:execution[pom:id[text()='windows-src']]" assembly + # Suppress generation of uses clauses %pom_xpath_inject "pom:configuration/pom:instructions" "<_nouses>true" . @@ -152,14 +184,36 @@ rm -rf sshd-core/src/main/java/org/apache/sshd/agent/unix %endif -Dsource=8 +%if %{with extras} +mkdir sshd_home +(cd sshd_home + tar --delay-directory-restore -xvf \ + ../assembly/target/apache-sshd-%{version}.tar.gz +) +%endif + %install %mvn_install %fdupes -s %{buildroot}%{_javadocdir} +%if %{with extras} +export SSHD_HOME=$(pwd)/sshd_home/apache-sshd-%{version} +rm $SSHD_HOME/bin/*.bat + +install -d -m 0755 %{buildroot}%{homedir} +cp -a $SSHD_HOME/{bin,dependencies,extras,lib} %{buildroot}%{homedir}/ +xmvn-subst -s -R %{buildroot} -s %{buildroot}%{homedir} +%endif + %files -f .mfiles %doc CHANGES.md %license LICENSE.txt NOTICE.txt assembly/src/main/legal/licenses/jbcrypt.txt +%if %{with extras} +%files -n apache-sshd-standalone +%{homedir} +%endif + %files javadoc -f .mfiles-javadoc %license LICENSE.txt NOTICE.txt assembly/src/main/legal/licenses/jbcrypt.txt