From 58c8eccff92fd8b0003b62bb0605fef4b1419391b5aab2d14872cc4a40b944e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 13:36:23 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main httpcomponents-client revision 2461c984fbd045f4691797cb54cc4a6f --- .gitattributes | 23 ++ ...stem-copy-of-effective_tld_names.dat.patch | 31 +++ httpcomponents-client-4.5.12-src.tar.gz | 3 + httpcomponents-client-build.tar.xz | 3 + httpcomponents-client-java8compat.patch | 19 ++ httpcomponents-client.changes | 21 ++ httpcomponents-client.spec | 223 ++++++++++++++++++ 7 files changed, 323 insertions(+) create mode 100644 .gitattributes create mode 100644 0001-Use-system-copy-of-effective_tld_names.dat.patch create mode 100644 httpcomponents-client-4.5.12-src.tar.gz create mode 100644 httpcomponents-client-build.tar.xz create mode 100644 httpcomponents-client-java8compat.patch create mode 100644 httpcomponents-client.changes create mode 100644 httpcomponents-client.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/0001-Use-system-copy-of-effective_tld_names.dat.patch b/0001-Use-system-copy-of-effective_tld_names.dat.patch new file mode 100644 index 0000000..e940914 --- /dev/null +++ b/0001-Use-system-copy-of-effective_tld_names.dat.patch @@ -0,0 +1,31 @@ +From 3514ce0f38dddafd052d76e6a0da9bbb862ff8a4 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +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 + diff --git a/httpcomponents-client-4.5.12-src.tar.gz b/httpcomponents-client-4.5.12-src.tar.gz new file mode 100644 index 0000000..20d4b5c --- /dev/null +++ b/httpcomponents-client-4.5.12-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bfebea73129db129582eafe8379d1e47ba464b9e2d89d36d8910af6454d49ed +size 823758 diff --git a/httpcomponents-client-build.tar.xz b/httpcomponents-client-build.tar.xz new file mode 100644 index 0000000..0a55ef0 --- /dev/null +++ b/httpcomponents-client-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86451124bff0d34fd652fc1371684773c8df755561abf30d362d90bb520c054f +size 3628 diff --git a/httpcomponents-client-java8compat.patch b/httpcomponents-client-java8compat.patch new file mode 100644 index 0000000..bc6becf --- /dev/null +++ b/httpcomponents-client-java8compat.patch @@ -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(); + } + diff --git a/httpcomponents-client.changes b/httpcomponents-client.changes new file mode 100644 index 0000000..f83da8d --- /dev/null +++ b/httpcomponents-client.changes @@ -0,0 +1,21 @@ +------------------------------------------------------------------- +Sat Mar 19 07:28:15 UTC 2022 - Fridrich Strba + +- Build with source/target levels 8 + +------------------------------------------------------------------- +Mon Apr 27 12:01:16 UTC 2020 - Fridrich Strba + +- Update to version 4.5.12 + +------------------------------------------------------------------- +Sat Oct 5 12:42:31 UTC 2019 - Fridrich Strba + +- 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 + +- Initial packaging of httpcomponents-client 4.5.6 +- Generate and customize ant build files diff --git a/httpcomponents-client.spec b/httpcomponents-client.spec new file mode 100644 index 0000000..124c835 --- /dev/null +++ b/httpcomponents-client.spec @@ -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" " + \${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 + +%pom_xpath_inject pom:build " + + + + org.apache.felix + maven-bundle-plugin + true + + + * + net.sf.ehcache;resolution:=optional,net.spy.memcached;resolution:=optional,* + + <_nouses>true + + true + + + +" 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" " + org.apache.httpcomponents + %{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