diff --git a/.gitignore b/.gitignore index 24e91a1..bceceda 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SOURCES/DateTime-TimeZone-1.63.tar.gz +SOURCES/DateTime-TimeZone-1.70.tar.gz +SOURCES/tzdata2017b.tar.gz diff --git a/.perl-DateTime-TimeZone.metadata b/.perl-DateTime-TimeZone.metadata index 18714a1..f4dc566 100644 --- a/.perl-DateTime-TimeZone.metadata +++ b/.perl-DateTime-TimeZone.metadata @@ -1 +1,2 @@ -1b7e0ae1bce875d11d119cb59062fbad8290bbb3 SOURCES/DateTime-TimeZone-1.63.tar.gz +0f9b98d777f21e50cd123397a505539e7788342e SOURCES/DateTime-TimeZone-1.70.tar.gz +0f13bbb641f5742796609d3484006fe01fa654f1 SOURCES/tzdata2017b.tar.gz diff --git a/SOURCES/DateTime-TimeZone-1.70-Adjust-tests-to-time-zone-data-2017b.patch b/SOURCES/DateTime-TimeZone-1.70-Adjust-tests-to-time-zone-data-2017b.patch new file mode 100644 index 0000000..dd76cd7 --- /dev/null +++ b/SOURCES/DateTime-TimeZone-1.70-Adjust-tests-to-time-zone-data-2017b.patch @@ -0,0 +1,54 @@ +From 4100d95d3af754ac17c8d04c5fb76c726c78c3ee Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 10 Jul 2017 17:47:47 +0200 +Subject: [PATCH] Adjust tests to time zone data 2017b + +Africa/Kinshasa renamed to Africa/Lagos in upstream 1.74. +Third Chille time zone America/Punta_Arenas added in upstream 2.10. +--- + t/04local.t | 6 +++--- + t/15catalog.t | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/t/04local.t b/t/04local.t +index 4969f86..53ffabc 100644 +--- a/t/04local.t ++++ b/t/04local.t +@@ -73,12 +73,12 @@ local $ENV{TZ} = undef; + } + + { +- local $ENV{TZ} = 'Africa/Kinshasa'; ++ local $ENV{TZ} = 'Africa/Lagos'; + + my $tz = DateTime::TimeZone::Local::Unix->FromEnv(); + is( +- $tz->name(), 'Africa/Kinshasa', +- 'tz object name() is Africa::Kinshasa' ++ $tz->name(), 'Africa/Lagos', ++ 'tz object name() is Africa::Lagos' + ); + + local $ENV{TZ} = 0; +diff --git a/t/15catalog.t b/t/15catalog.t +index 2246253..0102898 100644 +--- a/t/15catalog.t ++++ b/t/15catalog.t +@@ -97,11 +97,11 @@ use DateTime::TimeZone; + + { + my @zones = DateTime::TimeZone->names_in_country('cl'); +- is( @zones, 2, 'two zones for Chile' ); ++ is( @zones, 3, 'two zones for Chile' ); + is_deeply( + [ sort @zones ], +- [ 'America/Santiago', 'Pacific/Easter' ], +- 'zones for Chile are America/Santiago and Pacific/Easter' ++ [ 'America/Punta_Arenas', 'America/Santiago', 'Pacific/Easter' ], ++ 'zones for Chile are America/Punta_Arenas, America/Santiago, and Pacific/Easter' + ); + } + +-- +1.8.3.1 + diff --git a/SOURCES/DateTime-TimeZone-1.70-Inject-DT-TZ-version-when-generating-modules.patch b/SOURCES/DateTime-TimeZone-1.70-Inject-DT-TZ-version-when-generating-modules.patch new file mode 100644 index 0000000..22becf7 --- /dev/null +++ b/SOURCES/DateTime-TimeZone-1.70-Inject-DT-TZ-version-when-generating-modules.patch @@ -0,0 +1,54 @@ +From 5650e9d07940825507e65ae71d30c4579ffea353 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 10 Jul 2017 15:12:17 +0200 +Subject: [PATCH] Inject DT::TZ version when generating modules + +This is implemented with new parse_olson --dtdzversion option. +--- + tools/parse_olson | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/tools/parse_olson b/tools/parse_olson +index c948de8..ff9c1f6 100755 +--- a/tools/parse_olson ++++ b/tools/parse_olson +@@ -32,6 +32,7 @@ GetOptions( + 'dir:s' => \$opts{dir}, + 'clean' => \$opts{clean}, + 'version:s' => \$opts{version}, ++ 'dttzversion:s' => \$opts{dttzversion}, + 'old' => \$opts{old}, + 'file:s' => \$opts{file}, + 'name:s' => \$opts{name}, +@@ -47,6 +48,8 @@ $opts{help} = 1 + + $opts{version} ||= 'test'; + ++$opts{dttversion} ||= '0'; ++ + if ( $opts{help} ) { + print <<'EOF'; + +@@ -65,6 +68,10 @@ It takes the following arguments: + --version The version of the Olson data files being used. + Required unless one of the debugging options is given. + ++ --dttzversion ++ The version of the DateTime-TimeZone distribution to inject into ++ each generated module as its version. Default is 0. ++ + --clean Remove old generated modules (which may not be valid with + the latest Olson database) + +@@ -208,7 +215,7 @@ $autogen_warning + # Do not edit this file directly. + # + $pkg_keyword DateTime::TimeZone::$mod_name; +- ++\$DateTime::TimeZone::${mod_name}::VERSION = '$opts{dttzversion}'; + use strict; + + use Class::Singleton 1.03; +-- +1.8.3.1 + diff --git a/SOURCES/DateTime-TimeZone-1.70-Recognize-short-zone-names-starting-with-a-sign.patch b/SOURCES/DateTime-TimeZone-1.70-Recognize-short-zone-names-starting-with-a-sign.patch new file mode 100644 index 0000000..f61b004 --- /dev/null +++ b/SOURCES/DateTime-TimeZone-1.70-Recognize-short-zone-names-starting-with-a-sign.patch @@ -0,0 +1,41 @@ +From cbca7770b9ead257b43f073b09abea3bd400ac0e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 11 Jul 2017 14:09:46 +0200 +Subject: [PATCH] Recognize short zone names starting with a sign + +Since tzdata 2017a, Africa/Accra uses GMT/+0020 short names and the conversion +script from DateTime-TimeZones-1.96 adds support for this syntax. +--- + lib/DateTime/TimeZone/OlsonDB/Change.pm | 2 +- + tools/tests_from_zdump | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/DateTime/TimeZone/OlsonDB/Change.pm b/lib/DateTime/TimeZone/OlsonDB/Change.pm +index 5bebbfa..b312f97 100644 +--- a/lib/DateTime/TimeZone/OlsonDB/Change.pm ++++ b/lib/DateTime/TimeZone/OlsonDB/Change.pm +@@ -43,7 +43,7 @@ sub new { + $p{is_dst} = 1 if $p{rule} && $p{rule}->offset_from_std; + $p{is_dst} = 1 if $p{observance}->offset_from_std; + +- if ( $p{short_name} =~ m{(\w+)/(\w+)} ) { ++ if ( $p{short_name} =~ m{([\-\+\w]+)/([\-\+\w]+)} ) { + $p{short_name} = $p{is_dst} ? $2 : $1; + } + +diff --git a/tools/tests_from_zdump b/tools/tests_from_zdump +index b013b7c..03465ee 100755 +--- a/tools/tests_from_zdump ++++ b/tools/tests_from_zdump +@@ -147,7 +147,7 @@ sub make_test_file { + \s+ + (\d\d\d\d) # local year + \s+ +- (\w+) # local short name ++ ([\-\+\w]+) # local short name + \s+ + isdst=(1|0) + \s+ +-- +1.8.3.1 + diff --git a/SOURCES/DateTime-TimeZone-1.70-Use-List-Util-max-directly-instead-of-List-AllUtils-.patch b/SOURCES/DateTime-TimeZone-1.70-Use-List-Util-max-directly-instead-of-List-AllUtils-.patch new file mode 100644 index 0000000..ded59ea --- /dev/null +++ b/SOURCES/DateTime-TimeZone-1.70-Use-List-Util-max-directly-instead-of-List-AllUtils-.patch @@ -0,0 +1,25 @@ +From 539066aad4edeb1cacc0ec9e0cc52caa8311a84c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 10 Jul 2017 14:32:38 +0200 +Subject: [PATCH] Use List::Util::max directly instead of List::AllUtils::max + +--- + tools/parse_olson | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/parse_olson b/tools/parse_olson +index f9597ed..c948de8 100755 +--- a/tools/parse_olson ++++ b/tools/parse_olson +@@ -16,7 +16,7 @@ use File::Find::Rule; + use File::Path; + use File::Spec; + use Getopt::Long; +-use List::AllUtils qw( max ); ++use List::Util qw( max ); + use Locale::Country 3.11 qw( code2country ); + + $Data::Dumper::Indent = 1; +-- +1.8.3.1 + diff --git a/SPECS/perl-DateTime-TimeZone.spec b/SPECS/perl-DateTime-TimeZone.spec index 9e1b472..e9475f7 100644 --- a/SPECS/perl-DateTime-TimeZone.spec +++ b/SPECS/perl-DateTime-TimeZone.spec @@ -1,52 +1,56 @@ +# Regenerate Perl library code from upstream Olson database of this date +%global tzversion 2017b + Name: perl-DateTime-TimeZone -Version: 1.63 -Release: 2%{?dist} +Version: 1.70 +Release: 1%{?dist} Summary: Time zone object base class and factory -License: GPL+ or Artistic +# tzdata%%{tzversion}.tar.gz archive: Public Domain +# other files: GPL+ or Artistic +License: (GPL+ or Artistic) and Public Domain Group: Development/Libraries URL: http://search.cpan.org/dist/DateTime-TimeZone/ -Source0: http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-TimeZone-%{version}.tar.gz +Source0: http://backpan.perl.org/authors/id/D/DR/DROLSKY/DateTime-TimeZone-%{version}.tar.gz +%if %{defined tzversion} +Source1: ftp://ftp.iana.org/tz/releases/tzdata%{tzversion}.tar.gz +%endif +# Do not use List::AllUtils in parse_olson tool, bug #1101251 +Patch0: DateTime-TimeZone-1.70-Use-List-Util-max-directly-instead-of-List-AllUtils-.patch +# Preserve DateTime-TimeZone version in regenerated modules, bug #1101251 +Patch1: DateTime-TimeZone-1.70-Inject-DT-TZ-version-when-generating-modules.patch +# Adjust tests to 2017b, bug #1101251, in upstream 2.10 +Patch2: DateTime-TimeZone-1.70-Adjust-tests-to-time-zone-data-2017b.patch +# Adjust conversion script to 2017b, bug #1101251, in upstream 1.96 +Patch3: DateTime-TimeZone-1.70-Recognize-short-zone-names-starting-with-a-sign.patch BuildArch: noarch +BuildRequires: findutils +BuildRequires: make BuildRequires: perl -BuildRequires: perl(base) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +%if !%{defined perl_bootstrap} && %{defined tzversion} +# avoid circular dependencies - DateTime strictly requires DateTime::TimeZone +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(DateTime) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Find::Rule) +BuildRequires: perl(File::Path) +BuildRequires: perl(File::Spec) +BuildRequires: perl(Getopt::Long) +BuildRequires: perl(integer) BuildRequires: perl(lib) +BuildRequires: perl(List::Util) +BuildRequires: perl(Locale::Country) >= 3.11 +%endif +# Run-time: BuildRequires: perl(Class::Load) BuildRequires: perl(Class::Singleton) >= 1.03 BuildRequires: perl(constant) BuildRequires: perl(Cwd) >= 3 -BuildRequires: perl(ExtUtils::MakeMaker) -BuildRequires: perl(File::Basename) -BuildRequires: perl(File::Compare) -BuildRequires: perl(File::Copy) -BuildRequires: perl(File::Spec) -BuildRequires: perl(List::Util) -BuildRequires: perl(overload) -BuildRequires: perl(Params::Validate) >= 0.72 -BuildRequires: perl(parent) -BuildRequires: perl(Test::More) >= 0.88 -BuildRequires: perl(Test::Output) -BuildRequires: perl(Storable) -BuildRequires: perl(strict) -BuildRequires: perl(Sys::Hostname) -BuildRequires: perl(vars) -BuildRequires: perl(warnings) -# not automatically detected -Requires: perl(File::Compare) -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) - -%{?filter_setup: -%filter_from_requires /^perl(Win32/d -%if 0%{?perl_bootstrap} -%filter_from_requires /^perl(DateTime\(::Duration\)?)/d -%endif -%?perl_default_filter} - -%global __requires_exclude %{__requires_exclude}|perl\\(Params::Validate\\)$|perl\\(Class::Singleton\\)$ - %if 0%{?perl_bootstrap} # avoid circular dependencies - DateTime strictly requires DateTime::TimeZone -%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(DateTime\\) -%global __requires_exclude %{__requires_exclude}|perl\\(DateTime::Duration\\) +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((DateTime|DateTime::Duration)\\) # perl-DateTime-TimeZone used to be bundled with perl-DateTime # when bootstrapping, we can't require the unbundled version, so # need to conflict with the old package @@ -58,6 +62,39 @@ Requires: perl-DateTime >= 2:0.70-1 BuildRequires: perl(DateTime) BuildRequires: perl(DateTime::Duration) %endif +BuildRequires: perl(File::Basename) +BuildRequires: perl(File::Compare) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Spec) +BuildRequires: perl(List::Util) +BuildRequires: perl(Params::Validate) >= 0.72 +BuildRequires: perl(parent) +BuildRequires: perl(vars) +# Win32::TieRegistry not used +# Tests: +BuildRequires: perl(base) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Path) +BuildRequires: perl(File::Spec::Functions) +BuildRequires: perl(File::Temp) +BuildRequires: perl(lib) +BuildRequires: perl(overload) +BuildRequires: perl(Storable) +BuildRequires: perl(Sys::Hostname) +BuildRequires: perl(Test::Fatal) +BuildRequires: perl(Test::More) >= 0.88 +BuildRequires: perl(Test::Output) +BuildRequires: perl(Test::Requires) +BuildRequires: perl(Test::Taint) +# not automatically detected +Requires: perl(File::Compare) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +# Remove non-Linux unused dependencies +%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Win32 + +# Remove under-specified dependencies +%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Params::Validate|Class::Singleton)\\)$ %description This class is the base class for all time zone objects. A time zone is @@ -65,17 +102,26 @@ represented internally as a set of observances, each of which describes the offset from GMT for a given time period. %prep -%setup -q -n DateTime-TimeZone-%{version} +%if !%{defined perl_bootstrap} && %{defined tzversion} +%setup -q -T -a 1 -c -n tzdata-%{tzversion} +%endif +%setup -q -T -b 0 -n DateTime-TimeZone-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build +%if !%{defined perl_bootstrap} && %{defined tzversion} +perl tools/parse_olson --dir ../tzdata-%{tzversion} --version %{tzversion} \ + --dttzversion %{version} --clean +%endif %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} - -find %{buildroot} -type f -name .packlist -exec rm -f {} \; - +find %{buildroot} -type f -name .packlist -delete %{_fixperms} %{buildroot}/* %check @@ -87,6 +133,14 @@ make test %{_mandir}/man3/* %changelog +* Mon Jul 10 2017 Petr Pisar - 1.70-1 +- 1.70 bump (bug #1101251) +- Regenerate Perl code from timezone sources (bug #1101251) +- Update time zone data to Olson 2017b (bug #1101251) + +* Thu Oct 06 2016 Petr Pisar - 1.64-1 +- 1.64 bump (bug #1241818) + * Fri Dec 27 2013 Daniel Mach - 1.63-2 - Mass rebuild 2013-12-27