%bcond_with bootstrap
Name: httpcomponents-client4
Summary: HTTP agent implementation based on httpcomponents HttpCore
Version: 4.5.14
Release: 1%{?dist}
License: Apache-2.0
URL: https://hc.apache.org/
Source0: https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/%{version}/httpcomponents-client-%{version}-source-release.zip
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Patch1: 0001-Use-system-copy-of-effective_tld_names.dat.patch
Patch2: 0002-Port-to-mockito-2.patch
Patch3: 0003-Port-to-Mockito-5.patch
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
BuildRequires: mvn(commons-codec:commons-codec)
BuildRequires: mvn(commons-logging:commons-logging)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.httpcomponents:httpcomponents-parent:pom:)
BuildRequires: mvn(org.apache.httpcomponents:httpcore)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.mockito:mockito-core)
%endif
%if %{without bootstrap}
BuildRequires: publicsuffix-list
%endif
Requires: publicsuffix-list
%description
HttpClient is a HTTP/1.1 compliant HTTP agent implementation based on
httpcomponents HttpCore. It also provides reusable components for
client-side authentication, HTTP state management, and HTTP connection
management. HttpComponents Client is a successor of and replacement
for Commons HttpClient 3.x. Users of Commons HttpClient are strongly
encouraged to upgrade.
%{?javadoc_package}
%prep
%setup -q -n httpcomponents-client-%{version}
%patch 1 -p1
%patch 2 -p1
%patch 3 -p1
%mvn_package :::tests: __noinstall
# Change scope of commons-logging to provided
%pom_change_dep :commons-logging :::provided httpclient
# Remove optional build deps not available in Fedora
%pom_disable_module httpclient-osgi
%pom_disable_module httpclient-win
%pom_disable_module fluent-hc
%pom_disable_module httpmime
%pom_disable_module httpclient-cache
%pom_remove_plugin :docbkx-maven-plugin
%pom_remove_plugin :clirr-maven-plugin
%pom_remove_plugin :maven-checkstyle-plugin
%pom_remove_plugin :apache-rat-plugin
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-javadoc-plugin
%pom_remove_plugin :animal-sniffer-maven-plugin
# Fails due to strict crypto policy - uses DSA in test data
rm httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLSocketFactory.java
%pom_remove_plugin :download-maven-plugin httpclient
%pom_xpath_inject "pom:archive" "
\${project.build.outputDirectory}/META-INF/MANIFEST.MF"
%pom_xpath_inject pom:build/pom:plugins "
org.apache.felix
maven-bundle-plugin
bundle-manifest
process-classes
manifest
"
%pom_xpath_inject pom:build "
org.apache.felix
maven-bundle-plugin
org.apache.http.*,!org.apache.http.param
<_nouses>true
!org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,*
true
" httpclient
# requires network
rm httpclient/src/test/java/org/apache/http/client/config/TestRequestConfig.java
%build
%mvn_file ":{*}" httpcomponents/@1
%mvn_build -- -Dmaven.compiler.release=8
%install
%mvn_install
%files -f .mfiles
%license LICENSE.txt NOTICE.txt
%doc README.txt RELEASE_NOTES.txt
%changelog
* Wed Dec 13 2023 Marian Koncek - 4.5.14-1
- Initial build