File maven-wagon.spec of Package maven-wagon

#
# spec file for package maven-wagon
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           maven-wagon
Version:        3.5.3
Release:        0
Summary:        Tools to manage artifacts and deployment
License:        Apache-2.0
Group:          Development/Libraries/Java
URL:            https://maven.apache.org/wagon
Source0:        https://repo1.maven.org/maven2/org/apache/maven/wagon/wagon/%{version}/wagon-%{version}-source-release.zip
Source1:        %{name}-build.tar.xz
BuildRequires:  ant
BuildRequires:  apache-commons-io
BuildRequires:  apache-commons-net
BuildRequires:  fdupes
BuildRequires:  httpcomponents-client
BuildRequires:  httpcomponents-core
BuildRequires:  javapackages-local >= 6
BuildRequires:  jsch
BuildRequires:  jsch-agent-proxy-connector-factory
BuildRequires:  jsch-agent-proxy-jsch
BuildRequires:  jsoup
BuildRequires:  plexus-interactivity-api
BuildRequires:  plexus-metadata-generator
BuildRequires:  plexus-utils
BuildRequires:  slf4j
BuildRequires:  unzip
BuildArch:      noarch

%description
Maven Wagon is a transport abstraction that is used in Maven's
artifact and repository handling code. Currently wagon has the
following providers:
* File
* HTTP
* FTP
* SSH/SCP
* WebDAV
* SCM (in progress)

%package provider-api
Summary:        The provider-api module for %{name}
Group:          Development/Libraries/Java

%description provider-api
The provider-api module for %{name}.

%package file
Summary:        The file module for %{name}
Group:          Development/Libraries/Java

%description file
The file module for %{name}.

%package ftp
Summary:        The ftp module for %{name}
Group:          Development/Libraries/Java

%description ftp
The ftp module for %{name}.

%package http
Summary:        The http module for %{name}
Group:          Development/Libraries/Java

%description http
The http module for %{name}.

%package http-shared
Summary:        The http-shared module for %{name}
Group:          Development/Libraries/Java

%description http-shared
The http-shared module for %{name}.

%package http-lightweight
Summary:        The http-lightweight module for %{name}
Group:          Development/Libraries/Java

%description http-lightweight
The http-lightweight module for %{name}.

%package ssh-common
Summary:        The ssh-common module for %{name}
Group:          Development/Libraries/Java

%description ssh-common
The ssh-common module for %{name}

%package ssh
Summary:        The ssh module for %{name}
Group:          Development/Libraries/Java

%description ssh
The ssh module for %{name}

%package ssh-external
Summary:        The ssh-external module for %{name}
Group:          Development/Libraries/Java

%description ssh-external
The ssh-external module for %{name}

%package javadoc
Summary:        Javadoc for %{name}
Group:          Documentation/HTML

%description javadoc
Javadoc for %{name}.

%prep
%setup -q -n wagon-%{version} -a1

%pom_remove_plugin :animal-sniffer-maven-plugin
%pom_remove_plugin :maven-enforcer-plugin
%pom_remove_dep :wagon-tck-http wagon-providers/wagon-http

# disable tests, missing dependencies
%pom_disable_module wagon-tcks
%pom_disable_module wagon-ssh-common-test wagon-providers/pom.xml
%pom_disable_module wagon-provider-test
%pom_remove_dep :wagon-provider-test
%pom_remove_dep :wagon-provider-test wagon-providers

# missing dependencies
%pom_disable_module wagon-webdav-jackrabbit wagon-providers

%pom_disable_module wagon-scm wagon-providers

%build
mkdir -p lib
build-jar-repository -s lib \
	commons-io commons-net jsch \
	jsch.agentproxy.core jsch.agentproxy.jsch jsch.agentproxy.connector-factory \
	httpcomponents/httpclient httpcomponents/httpcore \
	jsoup/jsoup plexus/utils plexus/interactivity-api slf4j/api
# tests are disabled because of missing dependencies
%{ant} package javadoc

%install
# jars
install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -pm 0644 wagon-provider-api/target/wagon-provider-api-%{version}.jar %{buildroot}%{_javadir}/%{name}/provider-api.jar
for i in file ftp http http-shared http-lightweight ssh-common ssh ssh-external; do
  install -pm 0644 wagon-providers/wagon-${i}/target/wagon-${i}-%{version}.jar %{buildroot}%{_javadir}/%{name}/${i}.jar
done
# poms
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
%{mvn_install_pom} wagon-provider-api/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/provider-api.pom
%add_maven_depmap %{name}/provider-api.pom %{name}/provider-api.jar -f provider-api
for i in file ftp http http-shared http-lightweight ssh-common ssh ssh-external; do
  %{mvn_install_pom} wagon-providers/wagon-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom
  if [ x${i} = xhttp ]; then
    # Maven requires Wagon HTTP with classifier "shaded"
    %add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar -a org.apache.maven.wagon:wagon-http::shaded: -f ${i}
  else
    %add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar -f ${i}
  fi
done
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/provider-api
cp -pr wagon-provider-api/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/provider-api
for i in file ftp http http-shared http-lightweight ssh-common ssh ssh-external; do
  install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/${i}
  cp -pr wagon-providers/wagon-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/${i}/
done
%fdupes -s %{buildroot}%{_javadocdir}

%files provider-api -f .mfiles-provider-api
%license LICENSE NOTICE
%doc DEPENDENCIES

%files file -f .mfiles-file

%files ftp -f .mfiles-ftp

%files http -f .mfiles-http

%files http-shared -f .mfiles-http-shared

%files http-lightweight -f .mfiles-http-lightweight

%files ssh-common -f .mfiles-ssh-common

%files ssh -f .mfiles-ssh

%files ssh-external -f .mfiles-ssh-external

%files javadoc
%license LICENSE NOTICE
%doc DEPENDENCIES
%{_javadocdir}/%{name}

%changelog
openSUSE Build Service is sponsored by