Sync from SUSE:SLFO:Main httpcomponents-client revision 2461c984fbd045f4691797cb54cc4a6f

This commit is contained in:
Adrian Schröter 2024-05-03 13:36:23 +02:00
commit 58c8eccff9
7 changed files with 323 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,31 @@
From 3514ce0f38dddafd052d76e6a0da9bbb862ff8a4 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 20 Jan 2015 16:04:31 +0100
Subject: [PATCH] Use system copy of effective_tld_names.dat
---
.../java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java b/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java
index 8783c5b..c858220 100644
--- a/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java
+++ b/httpclient/src/main/java/org/apache/http/conn/util/PublicSuffixMatcherLoader.java
@@ -82,11 +82,10 @@ public final class PublicSuffixMatcherLoader {
if (DEFAULT_INSTANCE == null) {
synchronized (PublicSuffixMatcherLoader.class) {
if (DEFAULT_INSTANCE == null){
- final URL url = PublicSuffixMatcherLoader.class.getResource(
- "/mozilla/public-suffix-list.txt");
- if (url != null) {
+ final File file = new File("/usr/share/publicsuffix/effective_tld_names.dat");
+ if (file.exists()) {
try {
- DEFAULT_INSTANCE = load(url);
+ DEFAULT_INSTANCE = load(file);
} catch (final IOException ex) {
// Should never happen
final Log log = LogFactory.getLog(PublicSuffixMatcherLoader.class);
--
2.9.3

BIN
httpcomponents-client-4.5.12-src.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
httpcomponents-client-build.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,19 @@
--- httpcomponents-client-4.5.6/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java 2018-11-06 09:37:41.743463818 +0100
+++ httpcomponents-client-4.5.6.new/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java 2019-03-13 10:49:52.762831489 +0100
@@ -32,6 +32,7 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URI;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
@@ -587,7 +588,7 @@
bb.put((byte) c);
}
}
- bb.flip();
+ ((Buffer)bb).flip();
return charset.decode(bb).toString();
}

View File

@ -0,0 +1,21 @@
-------------------------------------------------------------------
Sat Mar 19 07:28:15 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Build with source/target levels 8
-------------------------------------------------------------------
Mon Apr 27 12:01:16 UTC 2020 - Fridrich Strba <fstrba@suse.com>
- Update to version 4.5.12
-------------------------------------------------------------------
Sat Oct 5 12:42:31 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Avoid version-less dependencies in pom files, since
xmvn-connector-gradle does not handle them well
-------------------------------------------------------------------
Wed Mar 13 16:41:34 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Initial packaging of httpcomponents-client 4.5.6
- Generate and customize ant build files

223
httpcomponents-client.spec Normal file
View File

@ -0,0 +1,223 @@
#
# spec file for package httpcomponents-client
#
# Copyright (c) 2022 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/
#
%bcond_with tests
Name: httpcomponents-client
Version: 4.5.12
Release: 0
Summary: HTTP agent implementation based on httpcomponents HttpCore
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://hc.apache.org/
Source0: https://archive.apache.org/dist/httpcomponents/httpclient/source/%{name}-%{version}-src.tar.gz
Source1: %{name}-build.tar.xz
Patch0: 0001-Use-system-copy-of-effective_tld_names.dat.patch
Patch1: %{name}-java8compat.patch
BuildRequires: ant
BuildRequires: apache-commons-codec
BuildRequires: apache-commons-logging
BuildRequires: fdupes
BuildRequires: httpcomponents-core
BuildRequires: javapackages-local
BuildRequires: publicsuffix
Requires: publicsuffix
Requires: mvn(commons-codec:commons-codec)
Requires: mvn(commons-logging:commons-logging)
Requires: mvn(org.apache.httpcomponents:httpcore)
BuildArch: noarch
%if %{with tests}
BuildRequires: ant-junit
BuildRequires: cglib
BuildRequires: mockito
BuildRequires: objectweb-asm
BuildRequires: objenesis
%endif
%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.
%package cache
Summary: Cache module for %{name}
Group: Development/Libraries/Java
Requires: mvn(commons-logging:commons-logging)
Requires: mvn(org.apache.httpcomponents:httpclient) = %{version}
%description cache
This package provides client side caching for %{name}.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
%{summary}.
%prep
%setup -q -a1
%patch0 -p1
%patch1 -p1
# Remove optional build deps not available in openSUSE
%pom_disable_module httpclient-osgi
%pom_disable_module httpclient-win
%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
# Fails due to strict crypto policy - uses DSA in test data
rm httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLSocketFactory.java
# Don't compile/run httpclient-cache tests - they are incompatible with EasyMock 3.3
%pom_remove_dep org.easymock:easymockclassextension
for dep in org.easymock:easymockclassextension org.slf4j:slf4j-jcl; do
%pom_remove_dep $dep httpclient-cache
done
rm -rf httpclient-cache/src/test
%pom_remove_plugin :download-maven-plugin httpclient
%pom_xpath_inject "pom:archive" "
<manifestFile>\${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>"
%pom_xpath_inject pom:build/pom:plugins "
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>"
%pom_xpath_inject pom:build "
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>org.apache.http.*,!org.apache.http.param</Export-Package>
<Private-Package></Private-Package>
<_nouses>true</_nouses>
<Import-Package>!org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,*</Import-Package>
</instructions>
<excludeDependencies>true</excludeDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>
" httpclient
%pom_xpath_inject pom:build "
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>*</Export-Package>
<Import-Package>net.sf.ehcache;resolution:=optional,net.spy.memcached;resolution:=optional,*</Import-Package>
<Private-Package></Private-Package>
<_nouses>true</_nouses>
</instructions>
<excludeDependencies>true</excludeDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>" httpclient-cache
# requires network
rm httpclient/src/test/java/org/apache/http/client/config/TestRequestConfig.java
rm -r httpclient-cache/src/*/java/org/apache/http/impl/client/cache/memcached
%pom_remove_dep :spymemcached httpclient-cache
rm -r httpclient-cache/src/*/java/org/apache/http/impl/client/cache/ehcache
%pom_remove_dep :ehcache-core httpclient-cache
for module in fluent-hc httpclient httpclient-cache httpmime; do
%pom_xpath_inject "pom:project" "
<groupId>org.apache.httpcomponents</groupId>
<version>%{version}</version>" $module
%pom_remove_parent $module
# adds version "any" if none is specified
%pom_change_dep ::::: ::::: $module
done
%build
mkdir -p lib
build-jar-repository -s lib httpcomponents/httpcore commons-logging commons-codec
%if %{with tests}
build-jar-repository -s lib cglib/cglib mockito/mockito-core objectweb-asm/asm objenesis/objenesis
%endif
%{ant} \
%if %{without tests}
-Dtest.skip=true \
%endif
package javadoc
%install
# jar
install -dm 0755 %{buildroot}%{_javadir}/httpcomponents
for module in fluent-hc httpclient httpclient-cache httpmime; do
install -pm 0644 ${module}/target/${module}-%{version}.jar %{buildroot}%{_javadir}/httpcomponents/${module}.jar
done
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}/httpcomponents
for module in fluent-hc httpclient httpmime; do
install -pm 0644 ${module}/pom.xml %{buildroot}%{_mavenpomdir}/httpcomponents/${module}.pom
%add_maven_depmap httpcomponents/${module}.pom httpcomponents/${module}.jar
done
install -pm 0644 httpclient-cache/pom.xml %{buildroot}%{_mavenpomdir}/httpcomponents/httpclient-cache.pom
%add_maven_depmap httpcomponents/httpclient-cache.pom httpcomponents/httpclient-cache.jar -f cache
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
for module in fluent-hc httpclient httpclient-cache httpmime; do
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/${module}
cp -pr ${module}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/${module}/
done
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license LICENSE.txt
%doc NOTICE.txt README.txt RELEASE_NOTES.txt
%files cache -f .mfiles-cache
%files javadoc
%license LICENSE.txt
%doc NOTICE.txt
%{_javadocdir}/%{name}
%changelog