diff --git a/0001-FTfunds-updated-to-current-website.patch b/0001-FTfunds-updated-to-current-website.patch deleted file mode 100644 index 84ca183..0000000 --- a/0001-FTfunds-updated-to-current-website.patch +++ /dev/null @@ -1,106 +0,0 @@ -From e72536e4d9ead0c6f7b6ee7f94ef5b47ef7d73a3 Mon Sep 17 00:00:00 2001 -From: Paul Howarth -Date: Mon, 6 Nov 2017 09:36:48 +0000 -Subject: [PATCH] FTfunds updated to current website - ---- - lib/Finance/Quote/FTfunds.pm | 45 ++++++++++++++++++-------------------------- - 1 file changed, 18 insertions(+), 27 deletions(-) - -diff --git a/lib/Finance/Quote/FTfunds.pm b/lib/Finance/Quote/FTfunds.pm -index 9035ddd..c59f361 100644 ---- a/lib/Finance/Quote/FTfunds.pm -+++ b/lib/Finance/Quote/FTfunds.pm -@@ -46,7 +46,7 @@ require 5.005; - use strict; - use warnings; - --# Set DEBUG => 1 for no debug messages, => 1 for first level, => 2 for 2nd level, etc. -+# Set DEBUG => 0 for no debug messages, => 1 for first level, => 2 for 2nd level, etc. - - use constant DEBUG => 0; - -@@ -61,8 +61,8 @@ use HTML::TokeParser; - - our $VERSION = '1.49'; # VERSION - --$FTFUNDS_MAIN_URL = "http://funds.ft.com"; --$FTFUNDS_LOOK_LD = "http://funds.ft.com/UK/Tearsheet/Summary?s="; -+$FTFUNDS_MAIN_URL = "https://markets.ft.com"; -+$FTFUNDS_LOOK_LD = "https://markets.ft.com/data/funds/tearsheet/summary?s="; - $FTFUNDS_LOOK_UD = "http://funds.ft.com/UnlistedTearsheet/Summary?s="; - - # this will work with ISIN codes only. -@@ -165,7 +165,7 @@ DEBUG > 1 and print "\nCookie Jar = : \n - - my $name; - if ($webdoc->content =~ -- m[(.*) Summary - FT.com] ) -+ m[<title>(.*) [Ss]ummary - FT.com] ) - { - $name = $1 ; - } -@@ -178,13 +178,21 @@ DEBUG > 1 and print "\nCookie Jar = : \n - } - $fundquote {$code, "name"} = $name; # set name - --# Find price -+# Find price and currency -+ my $currency; - my $price; - if ($webdoc->content =~ -- m[<div class="contains wsodModuleContent"><table><tbody><tr><td class="text first">([\.\,0-9]*)</td>] ) -+ m[<span class="mod-ui-data-list__label">Price [(]([A-Z]{3})[)]</span><span class="mod-ui-data-list__value">([\.\,0-9]*)</span>] ) - { -- $price = $1; -+ $currency = $1; -+ $price = $2; - } -+ if (!defined($currency)) { -+ # serious error, report it and give up -+ $fundquote {$code,"success"} = 0; -+ $fundquote {$code,"errormsg"} = "Error - failed to find a currency"; -+ next; -+ } - if (!defined($price)) { - # serious error, report it and give up - $fundquote {$code,"success"} = 0; -@@ -200,10 +208,10 @@ DEBUG > 1 and print "\nCookie Jar = : \n - my $net; - my $pchange; - if ($webdoc->content =~ -- m[<span class="(pos|neg) color ">([\.0-9]*) / ([\.0-9]*)%</span>] ) -+ m[<span class="mod-ui-data-list__label">Today's Change</span><span class="mod-ui-data-list__value"><span [^>]*><i [^>]*></i>(-?[\.0-9]*) / (-?[\.0-9]*)%</span>] ) - { -- $net = $2 ; # allow for alternates in match string -- $pchange = $3; -+ $net = $1 ; -+ $pchange = $2; - } - if (!defined($net)) { - # not a serious error - don't report it .... -@@ -230,24 +238,7 @@ DEBUG > 1 and print "\nCookie Jar = : \n - $pchange = $1 * 1000 + $2; - } - --# Find the currency -- my $currency; -- if ($webdoc->content =~ -- m[<th>(Price currency)</th><td>([A-Z]{3})</td>] ) -- { -- -- $currency = $2; -- } -- -- if (!defined($currency)) { -- # serious error, report it and give up -- $fundquote {$code,"success"} = 0; -- $fundquote {$code,"errormsg"} = "Error - failed to find a currency"; -- next; -- } -- - # deal with GBX pricing of UK unit trusts -- - if ($currency eq "GBX") - { - $currency = "GBP" ; diff --git a/177.patch b/177.patch new file mode 100644 index 0000000..be687cf --- /dev/null +++ b/177.patch @@ -0,0 +1,24 @@ +From 03560135ff7b6d8d527cdc94c8ce5ed1fd2ee224 Mon Sep 17 00:00:00 2001 +From: gregor herrmann <gregoa@debian.org> +Date: Sun, 7 Mar 2021 01:45:55 +0100 +Subject: [PATCH] guard another test with $ENV{'ONLINE_TEST'} + +--- + t/fq-object-methods.t | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/t/fq-object-methods.t b/t/fq-object-methods.t +index ae25accd..1aaebf44 100644 +--- a/t/fq-object-methods.t ++++ b/t/fq-object-methods.t +@@ -2,6 +2,10 @@ + use strict; + use Test::More; + ++if (not $ENV{'ONLINE_TEST'}) { ++ plan skip_all => 'Set $ENV{ONLINE_TEST} to run this test'; ++} ++ + plan tests => 23; + + use Finance::Quote; diff --git a/perl-Finance-Quote.spec b/perl-Finance-Quote.spec index 32afecc..fd19384 100644 --- a/perl-Finance-Quote.spec +++ b/perl-Finance-Quote.spec @@ -1,11 +1,11 @@ Name: perl-Finance-Quote -Version: 1.49 -Release: 8%{?dist} +Version: 1.50 +Release: 1%{?dist} Summary: A Perl module that retrieves stock and mutual fund quotes License: GPLv2+ URL: https://metacpan.org/release/Finance-Quote Source0: https://cpan.metacpan.org/modules/by-module/Finance/Finance-Quote-%{version}.tar.gz -Patch0: 0001-FTfunds-updated-to-current-website.patch +Patch0: https://patch-diff.githubusercontent.com/raw/finance-quote/finance-quote/pull/177.patch BuildArch: noarch # Module Build BuildRequires: coreutils @@ -17,43 +17,52 @@ BuildRequires: perl(ExtUtils::MakeMaker) # Module Runtime BuildRequires: perl(base) BuildRequires: perl(Carp) -BuildRequires: perl(CGI) BuildRequires: perl(constant) BuildRequires: perl(DateTime) BuildRequires: perl(DateTime::Format::Strptime) BuildRequires: perl(Encode) BuildRequires: perl(Exporter) -BuildRequires: perl(File::Temp) -BuildRequires: perl(HTML::Parser) BuildRequires: perl(HTML::TableExtract) BuildRequires: perl(HTML::TokeParser) +BuildRequires: perl(HTML::TokeParser::Simple) BuildRequires: perl(HTML::TreeBuilder) +BuildRequires: perl(HTML::TreeBuilder::XPath) BuildRequires: perl(HTTP::Cookies) BuildRequires: perl(HTTP::Headers) +BuildRequires: perl(HTTP::Request) BuildRequires: perl(HTTP::Request::Common) BuildRequires: perl(HTTP::Status) +BuildRequires: perl(if) +BuildRequires: perl(IO::Uncompress::Unzip) BuildRequires: perl(JSON) -BuildRequires: perl(JSON::Parse) -BuildRequires: perl(LWP::Protocol::https) +#BuildRequires: perl(LWP::Protocol::https) BuildRequires: perl(LWP::Simple) BuildRequires: perl(LWP::UserAgent) -BuildRequires: perl(Mozilla::CA) +BuildRequires: perl(Module::Load) BuildRequires: perl(POSIX) BuildRequires: perl(Scalar::Util) +BuildRequires: perl(Spreadsheet::XLSX) BuildRequires: perl(strict) BuildRequires: perl(String::Util) BuildRequires: perl(Text::Template) BuildRequires: perl(Time::Piece) -BuildRequires: perl(URI) -BuildRequires: perl(URI::QueryParam) +BuildRequires: perl(Time::Seconds) +BuildRequires: perl(Try::Tiny) BuildRequires: perl(utf8) BuildRequires: perl(vars) BuildRequires: perl(warnings) +BuildRequires: perl(Web::Scraper) +BuildRequires: perl(XML::LibXML) # Test Suite -BuildRequires: perl(Data::Dumper) +BuildRequires: perl(Date::Manip) +BuildRequires: perl(Date::Range) +BuildRequires: perl(Date::Simple) +BuildRequires: perl(DateTime::Duration) +BuildRequires: perl(DateTime::Format::ISO8601) BuildRequires: perl(feature) BuildRequires: perl(File::Spec) BuildRequires: perl(Test::More) +BuildRequires: perl(Test::Pod::Coverage) # Runtime Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) @@ -64,16 +73,12 @@ using various source. %prep %setup -q -n Finance-Quote-%{version} -# Remove BerkeleyDB files shipped by mistake -rm lib/G* -sed -i -e '/^lib\/G/d' MANIFEST +# Guard an online-only test (GH#177) +%patch0 -p1 # Remove redundant exec permissions find lib/ -type f -name '*.pm' -exec chmod -c -x {} \; -# Fix FTfunds (CPAN RT#129586) -%patch0 -p1 - # Avoid documentation name clash cp -p README README.dist @@ -90,66 +95,66 @@ find %{buildroot} -type f -name .packlist -delete make test %files -%if 0%{?_licensedir:1} %license LICENSE -%else -%doc LICENSE -%endif %doc Change* Documentation/* README.dist %{perl_vendorlib}/Finance/ %{_mandir}/man3/Finance::Quote.3* %{_mandir}/man3/Finance::Quote::AEX.3* -%{_mandir}/man3/Finance::Quote::AIAHK.3* +%{_mandir}/man3/Finance::Quote::AlphaVantage.3* %{_mandir}/man3/Finance::Quote::ASEGR.3* %{_mandir}/man3/Finance::Quote::ASX.3* -%{_mandir}/man3/Finance::Quote::BMONesbittBurns.3* -%{_mandir}/man3/Finance::Quote::BSERO.3* +%{_mandir}/man3/Finance::Quote::Bloomberg.3* %{_mandir}/man3/Finance::Quote::Bourso.3* +%{_mandir}/man3/Finance::Quote::BSEIndia.3* %{_mandir}/man3/Finance::Quote::CSE.3* %{_mandir}/man3/Finance::Quote::Cdnfundlibrary.3* -%{_mandir}/man3/Finance::Quote::Citywire.3* -%{_mandir}/man3/Finance::Quote::Cominvest.3* +%{_mandir}/man3/Finance::Quote::Comdirect.3* %{_mandir}/man3/Finance::Quote::Currencies.3* +%{_mandir}/man3/Finance::Quote::CurrencyRates::AlphaVantage.3* +%{_mandir}/man3/Finance::Quote::CurrencyRates::ECB.3* +%{_mandir}/man3/Finance::Quote::CurrencyRates::Fixer.3* +%{_mandir}/man3/Finance::Quote::CurrencyRates::OpenExchange.3* %{_mandir}/man3/Finance::Quote::DWS.3* %{_mandir}/man3/Finance::Quote::Deka.3* -%{_mandir}/man3/Finance::Quote::FTPortfolios.3* %{_mandir}/man3/Finance::Quote::FTfunds.3* %{_mandir}/man3/Finance::Quote::Fidelity.3* -%{_mandir}/man3/Finance::Quote::FidelityFixed.3* -%{_mandir}/man3/Finance::Quote::FinanceCanada.3* %{_mandir}/man3/Finance::Quote::Finanzpartner.3* +%{_mandir}/man3/Finance::Quote::Fondsweb.3* %{_mandir}/man3/Finance::Quote::Fool.3* +%{_mandir}/man3/Finance::Quote::Fundata.3* %{_mandir}/man3/Finance::Quote::GoldMoney.3* -%{_mandir}/man3/Finance::Quote::HEX.3* %{_mandir}/man3/Finance::Quote::HU.3* +%{_mandir}/man3/Finance::Quote::IEXCloud.3* %{_mandir}/man3/Finance::Quote::IndiaMutual.3* -%{_mandir}/man3/Finance::Quote::LeRevenu.3* %{_mandir}/man3/Finance::Quote::MStaruk.3* -%{_mandir}/man3/Finance::Quote::ManInvestments.3* -%{_mandir}/man3/Finance::Quote::Morningstar.3* %{_mandir}/man3/Finance::Quote::MorningstarAU.3* -%{_mandir}/man3/Finance::Quote::MorningstarCH.3* %{_mandir}/man3/Finance::Quote::MorningstarJP.3* +%{_mandir}/man3/Finance::Quote::NSEIndia.3* %{_mandir}/man3/Finance::Quote::NZX.3* -%{_mandir}/man3/Finance::Quote::Platinum.3* +%{_mandir}/man3/Finance::Quote::OnVista.3* +%{_mandir}/man3/Finance::Quote::Oslobors.3* %{_mandir}/man3/Finance::Quote::SEB.3* -%{_mandir}/man3/Finance::Quote::TNetuk.3* +%{_mandir}/man3/Finance::Quote::SIX.3* +%{_mandir}/man3/Finance::Quote::TMX.3* +%{_mandir}/man3/Finance::Quote::Tradeville.3* %{_mandir}/man3/Finance::Quote::TSP.3* -%{_mandir}/man3/Finance::Quote::TSX.3* -%{_mandir}/man3/Finance::Quote::Tdefunds.3* -%{_mandir}/man3/Finance::Quote::Tdwaterhouse.3* %{_mandir}/man3/Finance::Quote::Tiaacref.3* %{_mandir}/man3/Finance::Quote::Troweprice.3* -%{_mandir}/man3/Finance::Quote::Trustnet.3* %{_mandir}/man3/Finance::Quote::USFedBonds.3* %{_mandir}/man3/Finance::Quote::Union.3* -%{_mandir}/man3/Finance::Quote::VWD.3* +%{_mandir}/man3/Finance::Quote::XETRA.3* %{_mandir}/man3/Finance::Quote::YahooJSON.3* -%{_mandir}/man3/Finance::Quote::YahooYQL.3* %{_mandir}/man3/Finance::Quote::ZA.3* -%{_mandir}/man3/Finance::Quote::ZA_UnitTrusts.3* %changelog +* Sun Jun 27 2021 Paul Howarth <paul@city-fan.org> - 1.50-1 +- Update to 1.50 + - New modules: CurrencyRates + - Updated modules: ASX, TIAA-CREF, Fool, Currencies + - Corrected some POD issues (thanks to the Debian Perl Group) +- Add patch to fix FTBFS due to online test (GH#177) +- Use %%license unconditionally + * Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.49-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index 75366d1..f957c37 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Finance-Quote-1.49.tar.gz) = 5b4b8836e1529409f1f6aa41345bf906ba2cc1c1b44e89b59765a883cf0db082cef9df91a4eaa671e494f5e9a842c4e1fbfcc31e57964d74f7895f3e25c4d91c +SHA512 (Finance-Quote-1.50.tar.gz) = 5e894f234c8e400b09fab2e08a9765c6e6d1ef7b8a4f06b9c5b85bc725edfc766cb6120a9fc2b59e4433863d7087f475db4a6e325b07c4175f6739a7bd957698