From 1117252b88fab70c907b0f0b4a2fba4906b61166 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 20 Jan 2015 16:05:10 +0100 Subject: [PATCH] Unbundle publicsuffix-list - Resolves: rhbz#1183782 --- ...stem-copy-of-effective_tld_names.dat.patch | 31 +++++++++++++++++++ httpcomponents-client.spec | 20 +++++++----- sources | 1 - 3 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 0001-Use-system-copy-of-effective_tld_names.dat.patch 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..87df41d --- /dev/null +++ b/0001-Use-system-copy-of-effective_tld_names.dat.patch @@ -0,0 +1,31 @@ +From b4954ca99dcc6daa344c9223a5997487e0806605 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 173763a..d792eca 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 +@@ -80,11 +80,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 (IOException ex) { + // Should never happen + final Log log = LogFactory.getLog(PublicSuffixMatcherLoader.class); +-- +2.1.0 + diff --git a/httpcomponents-client.spec b/httpcomponents-client.spec index 24bb6b5..8ece766 100644 --- a/httpcomponents-client.spec +++ b/httpcomponents-client.spec @@ -3,11 +3,12 @@ Name: httpcomponents-client Summary: HTTP agent implementation based on httpcomponents HttpCore Version: 4.4 -Release: 0.1.beta1%{?dist} -License: ASL 2.0 and MPL +Release: 0.2.beta1%{?dist} +License: ASL 2.0 URL: http://hc.apache.org/ Source0: http://www.apache.org/dist/httpcomponents/httpclient/source/%{name}-%{version}-beta1-src.tar.gz -Source1: https://publicsuffix.org/list/effective_tld_names.dat + +Patch0: 0001-Use-system-copy-of-effective_tld_names.dat.patch BuildArch: noarch @@ -20,9 +21,9 @@ BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) BuildRequires: mvn(org.mockito:mockito-core) BuildRequires: mvn(net.sf.ehcache:ehcache-core) BuildRequires: mvn(spy:spymemcached) -# TODO: unbundle publicsuffix-list once it gets into Fedora -# see https://bugzilla.redhat.com/show_bug.cgi?id=1175293 -#BuildRequires: publicsuffix-list +BuildRequires: publicsuffix-list + +Requires: publicsuffix-list Obsoletes: %{name}-tests < 4.4 @@ -42,6 +43,7 @@ Summary: API documentation for %{name} %prep %setup -q -n %{name}-%{version}-beta1 +%patch0 -p1 # Don't install javadoc and sources jars %mvn_package ":{*}::{sources,javadoc}:" __noinstall @@ -64,8 +66,6 @@ done rm -rf httpclient-cache/src/test %pom_remove_plugin :download-maven-plugin httpclient -mkdir -p httpclient/target/classes/mozilla -cp -a %{SOURCE1} httpclient/target/classes/mozilla/public-suffix-list.txt # Add proper Apache felix bundle plugin instructions # so that we get a reasonable OSGi manifest. @@ -130,6 +130,10 @@ rm httpclient/src/test/java/org/apache/http/client/config/TestRequestConfig.java %doc LICENSE.txt NOTICE.txt %changelog +* Tue Jan 20 2015 Mikolaj Izdebski - 4.4-0.2.beta1 +- Unbundle publicsuffix-list +- Resolves: rhbz#1183782 + * Mon Jan 19 2015 Mikolaj Izdebski - 4.4-0.1.beta1 - Update to upstream version 4.4 beta1 - Remove tests subpackage diff --git a/sources b/sources index cdaa0fb..6813e0b 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ 2a1b26a5a10384a02016d072ee0fea98 httpcomponents-client-4.4-beta1-src.tar.gz -bcd261f923113157fa42db633aa4bc16 effective_tld_names.dat