commit e192f87d684547e3b843cc475d4a98bf5ed256a3 Author: Yanko Kaneti <yaneti@xxxxxxxxxxx> Date: Tue Jan 20 16:17:24 2015 +0200 Unbundle the publicsuffix list Mozilla-PublicSuffix-unbundle.patch | 49 + effective_tld_names.dat | 8529 ----------------------------------- perl-Mozilla-PublicSuffix.spec | 16 +- 3 files changed, 60 insertions(+), 8534 deletions(-) --- diff --git a/Mozilla-PublicSuffix-unbundle.patch b/Mozilla-PublicSuffix-unbundle.patch new file mode 100644 index 0000000..595cb27 --- /dev/null +++ b/Mozilla-PublicSuffix-unbundle.patch @@ -0,0 +1,49 @@ +diff -ur Mozilla-PublicSuffix-v0.1.19/Build.PL Mozilla-PublicSuffix-v0.1.19.unbundle/Build.PL +--- Mozilla-PublicSuffix-v0.1.19/Build.PL 2014-07-23 18:54:16.000000000 +0300 ++++ Mozilla-PublicSuffix-v0.1.19.unbundle/Build.PL 2015-01-20 16:11:50.580869673 +0200 +@@ -40,6 +40,7 @@ + ); + + my $dat_file = "effective_tld_names.dat"; ++my $system_dat_file = $builder->config('system_publicsuffix_list'); + my $get_new_list = $builder->y_n( + "Check for a new version of the Public Suffix List?", "N" + ); +@@ -73,7 +74,13 @@ + } IO::File->new($dat_file)->getlines; + + tie my @pm, "Tie::File", "lib/Mozilla/PublicSuffix.pm"; +-for (@pm) { s/(my %rules = qw\()\)/$1$rules)/ and last } ++for (@pm) { ++ if ($system_dat_file) { ++ s/(my %rules = qw\(\);)/$1\n_parse_file(\\%rules,\"$system_dat_file\");/ and last ++ } else { ++ s/(my %rules = qw\()\)/$1$rules)/ and last ++ } ++} + untie @pm; + + $builder->create_build_script; +diff -ur Mozilla-PublicSuffix-v0.1.19/lib/Mozilla/PublicSuffix.pm Mozilla-PublicSuffix-v0.1.19.unbundle/lib/Mozilla/PublicSuffix.pm +--- Mozilla-PublicSuffix-v0.1.19/lib/Mozilla/PublicSuffix.pm 2014-07-23 18:54:16.000000000 +0300 ++++ Mozilla-PublicSuffix-v0.1.19.unbundle/lib/Mozilla/PublicSuffix.pm 2015-01-20 16:11:50.580869673 +0200 +@@ -93,6 +93,19 @@ + } + } + ++sub _parse_file { ++ my $rulesref = shift; ++ my $dat_file = shift; ++ open DAT ,"<:encoding(UTF-8)", "$dat_file"; ++ foreach (<DAT>) { ++ s/\s//g; ++ if ( s/^!// ) { $rulesref->{$_} = "e" } # exception rule ++ elsif ( s/^\*\.// ) { $rulesref->{$_} = "w" } # wildcard rule ++ elsif ( /^[\p{Word}]/ ) { $rulesref->{$_} = "i" } # identity rule ++ } ++ close DAT; ++} ++ + 1; + =encoding utf8 + diff --git a/perl-Mozilla-PublicSuffix.spec b/perl-Mozilla-PublicSuffix.spec index b119e8a..9f54846 100644 --- a/perl-Mozilla-PublicSuffix.spec +++ b/perl-Mozilla-PublicSuffix.spec @@ -8,8 +8,9 @@ License: MIT Group: Development/Libraries URL: http://search.cpan.org/dist/Mozilla-PublicSuffix/ Source0: http://www.cpan.org/authors/id/R/RS/RSIMOES/Mozilla-PublicSuffix-v%{version}.tar.gz -# http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1 -Source1: effective_tld_names.dat + +# https://github.com/rsimoes/Mozilla-PublicSuffix/pull/6 +Patch1: Mozilla-PublicSuffix-unbundle.patch BuildArch: noarch BuildRequires: perl >= 0:5.008 @@ -20,9 +21,11 @@ BuildRequires: perl(URI::_idna) BuildRequires: perl(HTTP::Tiny) BuildRequires: perl(Tie::File) BuildRequires: perl(Exporter) +BuildRequires: publicsuffix-list Requires: perl(URI::_idna) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: publicsuffix-list %description This module provides a single function that returns the public suffix of a @@ -31,10 +34,10 @@ From the official website at http://publicsuffix.org/ %prep %setup -q -n Mozilla-PublicSuffix-v%{version} -cp -a %{SOURCE1} ./ +%patch1 -p1 %build -perl Build.PL installdirs=vendor </dev/null +perl Build.PL installdirs=vendor --config system_publicsuffix_list=/usr/share/publicsuffix/effective_tld_names.dat </dev/null ./Build %install @@ -46,11 +49,14 @@ perl Build.PL installdirs=vendor </dev/null ./Build test %files -%doc Changes effective_tld_names.dat LICENSE README +%doc Changes LICENSE README %{perl_vendorlib}/* %{_mandir}/man3/* %changelog +* Tue Jan 20 2015 Yanko Kaneti <yaneti@xxxxxxxxxxx> 0.1.19-2 +- Unbundle the publicsuffix list + * Thu Aug 28 2014 Jitka Plesnikova <jplesnik@xxxxxxxxxx> - 0.1.19-2.20140613 - Perl 5.20 rebuild -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel