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..938cbc6 --- /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.5-src.tar.gz b/httpcomponents-client-4.5.5-src.tar.gz new file mode 100644 index 0000000..b32efc9 Binary files /dev/null and b/httpcomponents-client-4.5.5-src.tar.gz differ diff --git a/httpcomponents-client.spec b/httpcomponents-client.spec new file mode 100644 index 0000000..cb1ad32 --- /dev/null +++ b/httpcomponents-client.spec @@ -0,0 +1,152 @@ +Name: httpcomponents-client +Version: 4.5.5 +Release: 6 +License: ASL 2.0 +Summary: A library of components for building client side HTTP services +URL: http://hc.apache.org/ +Source0: http://www.apache.org/dist/httpcomponents/httpclient/source/%{name}-%{version}-src.tar.gz +Patch0001: 0001-Use-system-copy-of-effective_tld_names.dat.patch +BuildArch: noarch + +BuildRequires: maven-local mvn(commons-codec:commons-codec) mvn(commons-logging:commons-logging) +BuildRequires: mvn(junit:junit) mvn(net.sf.ehcache:ehcache-core) mvn(net.spy:spymemcached) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) mvn(org.apache.httpcomponents:httpcore) +BuildRequires: mvn(org.apache.httpcomponents:project:pom:) mvn(org.mockito:mockito-core) publicsuffix-list +BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) mvn(org.easymock:easymock) + +Requires: publicsuffix-list +Obsoletes: %{name}-tests < 4.4 + +%description +HttpClient is an HTTP proxy implementation of HTTP / 1.1 extended by +httpcomponents HttpCore,which provides reusable components for +HTTP state management, HTTP connection management, and client-side +authentication. HttpComponents Client is almost equalto Commons +HttpClient 3.x. Users of Commons HttpClient strongly support it. + +%package cache +Summary: Module used to cache for %{name} + +%description cache +This package can be known as a client side, providing client side caching for %{name}. + +%package help +Summary: Help documents javadoc for httpcomponents-client +Provides: %{name}-javadoc = %{version}-%{release} +Obsoletes: %{name}-javadoc < %{version}-%{release} + +%description help +Man pages and other related help documents for httpcomponents-client. + +%prep +%autosetup -n %{name}-%{version} -p1 +%mvn_package :httpclient-cache cache + +%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 + +rm httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLSocketFactory.java + +%pom_remove_plugin org.apache.maven.plugins:maven-jar-plugin httpclient-cache +%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 + +for module in httpclient httpmime httpclient-cache fluent-hc; do + %pom_xpath_remove "pom:project/pom:packaging" $module + %pom_xpath_inject "pom:project" "bundle" $module +done + +%pom_xpath_inject pom:build " + + + org.apache.felix + maven-bundle-plugin + true + +" fluent-hc + +%pom_xpath_inject pom:build/pom:plugins " + + org.apache.felix + maven-bundle-plugin + true + " httpmime + +%pom_xpath_inject pom:reporting/pom:plugins " + + org.apache.felix + maven-bundle-plugin + + + * + + !org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,* + + + " httpclient + +%pom_xpath_inject pom:build/pom:plugins " + + org.apache.felix + maven-bundle-plugin + true + + + 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/pom:plugins " + + org.apache.felix + maven-bundle-plugin + true + + + * + net.sf.ehcache;resolution:=optional,net.spy.memcached;resolution:=optional,* + + <_nouses>true + + true + + " httpclient-cache + +rm httpclient/src/test/java/org/apache/http/client/config/TestRequestConfig.java + +%build +%mvn_file ":{*}" httpcomponents/@1 + +%mvn_build -f + +%install +%mvn_install + +find %{_buildrootdir} -name "httpcomponents-client.xml" | xargs sed -i \ +'s/[[:alnum:]]\{8\}-[[:alnum:]]\{4\}-[[:alnum:]]\{4\}-[[:alnum:]]\{4\}-[[:alnum:]]\{12\}<\/uuid>/12345678-1234-1234-1234-123456789012<\/uuid>/g' + +%files -f .mfiles +%doc LICENSE.txt NOTICE.txt README.txt RELEASE_NOTES.txt + +%files cache -f .mfiles-cache +%files help -f .mfiles-javadoc + +%changelog +* Sun Dec 1 2019 wangzhishun - 4.5.5-6 +- Package init