From 029bafaa994109f88bb990c3584ce8ecd13cb10c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2019 15:51:58 +0000 Subject: import perl-DateTime-1.04-6.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bbcd92e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/DateTime-1.04.tar.gz diff --git a/.perl-DateTime.metadata b/.perl-DateTime.metadata new file mode 100644 index 0000000..a0f1ed1 --- /dev/null +++ b/.perl-DateTime.metadata @@ -0,0 +1 @@ +37c1fb0c6f2d065e53476b0fc8e7c19e8a2a0b35 SOURCES/DateTime-1.04.tar.gz diff --git a/SOURCES/DateTime-1.04-Add-leap-second-on-December-31-2016.patch b/SOURCES/DateTime-1.04-Add-leap-second-on-December-31-2016.patch new file mode 100644 index 0000000..d0d0c96 --- /dev/null +++ b/SOURCES/DateTime-1.04-Add-leap-second-on-December-31-2016.patch @@ -0,0 +1,51 @@ +From 5375759f62132dc8328baf939e471a32a6a3b3f5 Mon Sep 17 00:00:00 2001 +From: Dave Rolsky +Date: Wed, 6 Jul 2016 08:49:37 -0500 +Subject: [PATCH 2/2] Add leap second on December 31, 2016 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + leaptab.txt | 1 + + lib/DateTime/LeapSecond.pm | 1 + + t/19leap-second.t | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/leaptab.txt b/leaptab.txt +index 4075fbd..e9fb846 100644 +--- a/leaptab.txt ++++ b/leaptab.txt +@@ -24,3 +24,4 @@ + 2009 Jan. 1 +1 + 2012 Jul. 1 +1 + 2015 Jul. 1 +1 ++2017 Jan. 1 +1 +diff --git a/lib/DateTime/LeapSecond.pm b/lib/DateTime/LeapSecond.pm +index 736f2eb..b936c72 100644 +--- a/lib/DateTime/LeapSecond.pm ++++ b/lib/DateTime/LeapSecond.pm +@@ -107,6 +107,7 @@ sub _initialize { + 2009 Jan. 1 +1 + 2012 Jun. 1 +1 + 2015 Jul. 1 +1 ++ 2017 Jan. 1 +1 + ) + ); + } +diff --git a/t/19leap-second.t b/t/19leap-second.t +index 3d9434c..9d3f6eb 100644 +--- a/t/19leap-second.t ++++ b/t/19leap-second.t +@@ -1157,6 +1157,7 @@ use DateTime; + [ 2008, 12, 31 ], + [ 2012, 6, 30 ], + [ 2015, 6, 30 ], ++ [ 2016, 12, 31 ], + ) { + my $formatted = join '-', map { sprintf( '%02d', $_ ) } @{$date}; + +-- +2.5.5 + diff --git a/SOURCES/DateTime-1.04-There-will-be-a-leap-second-on-June-30-2015.patch b/SOURCES/DateTime-1.04-There-will-be-a-leap-second-on-June-30-2015.patch new file mode 100644 index 0000000..dcf5c89 --- /dev/null +++ b/SOURCES/DateTime-1.04-There-will-be-a-leap-second-on-June-30-2015.patch @@ -0,0 +1,61 @@ +From 27a96035f1da2ff0f4801fedffdb7a8cdadd3fc7 Mon Sep 17 00:00:00 2001 +From: Dave Rolsky +Date: Mon, 5 Jan 2015 08:53:52 -0600 +Subject: [PATCH 1/2] There will be a leap second on June 30, 2015 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + leaptab.txt | 1 + + lib/DateTime/LeapSecond.pm | 4 +--- + t/19leap-second.t | 1 + + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/leaptab.txt b/leaptab.txt +index f1c7f2e..4075fbd 100644 +--- a/leaptab.txt ++++ b/leaptab.txt +@@ -23,3 +23,4 @@ + 2006 Jan. 1 +1 + 2009 Jan. 1 +1 + 2012 Jul. 1 +1 ++2015 Jul. 1 +1 +diff --git a/lib/DateTime/LeapSecond.pm b/lib/DateTime/LeapSecond.pm +index c5bf97c..736f2eb 100644 +--- a/lib/DateTime/LeapSecond.pm ++++ b/lib/DateTime/LeapSecond.pm +@@ -74,9 +74,6 @@ sub day_length { + + sub _initialize { + +- # this table: ftp://62.161.69.5/pub/tai/publication/leaptab.txt +- # known accurate until (at least): 2005-12-31 +- # + # There are no leap seconds before 1972, because that's the + # year this system was implemented. + # +@@ -109,6 +106,7 @@ sub _initialize { + 2006 Jan. 1 +1 + 2009 Jan. 1 +1 + 2012 Jun. 1 +1 ++ 2015 Jul. 1 +1 + ) + ); + } +diff --git a/t/19leap-second.t b/t/19leap-second.t +index ecd2598..3d9434c 100644 +--- a/t/19leap-second.t ++++ b/t/19leap-second.t +@@ -1156,6 +1156,7 @@ use DateTime; + [ 2005, 12, 31 ], + [ 2008, 12, 31 ], + [ 2012, 6, 30 ], ++ [ 2015, 6, 30 ], + ) { + my $formatted = join '-', map { sprintf( '%02d', $_ ) } @{$date}; + +-- +2.5.5 + diff --git a/SOURCES/DateTime-1.06-Don-t-leave-the-object-in-a-modified-state-after-a-f.patch b/SOURCES/DateTime-1.06-Don-t-leave-the-object-in-a-modified-state-after-a-f.patch new file mode 100644 index 0000000..cd847db --- /dev/null +++ b/SOURCES/DateTime-1.06-Don-t-leave-the-object-in-a-modified-state-after-a-f.patch @@ -0,0 +1,96 @@ +From d744bf17b7a0e0158eb813a8605cc0d8635f8959 Mon Sep 17 00:00:00 2001 +From: Dave Rolsky +Date: Sat, 3 May 2014 11:39:47 +0800 +Subject: [PATCH] Don't leave the object in a modified state after a failed + truncate( to => 'week' ) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Petr Pisar: Ported to 1.06. + +Signed-off-by: Petr Písař +--- + lib/DateTime.pm | 11 ++++++++++- + t/16truncate.t | 38 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 48 insertions(+), 1 deletion(-) + +diff --git a/lib/DateTime.pm b/lib/DateTime.pm +index 1ff4c2e..a8663b2 100644 +--- a/lib/DateTime.pm ++++ b/lib/DateTime.pm +@@ -1985,7 +1985,16 @@ sub set_formatter { + $self->add( days => -1 * $day_diff ); + } + +- return $self->truncate( to => 'day' ); ++ # This can fail if the truncate ends up giving us an invalid local ++ # date time. If that happens we need to reverse the addition we ++ # just did. See https://rt.cpan.org/Ticket/Display.html?id=93347. ++ try { ++ $self->truncate( to => 'day' ); ++ } ++ catch { ++ $self->add( days => $day_diff ); ++ die $_; ++ }; + } + else { + my $truncate; +diff --git a/t/16truncate.t b/t/16truncate.t +index 0058f50..a478760 100644 +--- a/t/16truncate.t ++++ b/t/16truncate.t +@@ -5,6 +5,7 @@ use Test::Fatal; + use Test::More 0.88; + + use DateTime; ++use Try::Tiny; + + my %vals = ( + year => 50, +@@ -233,4 +234,41 @@ my %vals = ( + } + } + ++{ ++ my $dt = DateTime->new( ++ year => 2010, ++ month => 3, ++ day => 25, ++ hour => 1, ++ minute => 5, ++ time_zone => 'Asia/Tehran', ++ ); ++ ++ is( ++ $dt->day_of_week(), ++ 4, ++ 'day of week is Thursday' ++ ); ++ ++ my $error; ++ try { ++ $dt->truncate( to => 'week' ); ++ } ++ catch { ++ $error = $_; ++ }; ++ ++ like( ++ $error, ++ qr/Invalid local time for date/, ++ 'truncate operation threw an error because of an invalid local datetime' ++ ); ++ ++ is( ++ $dt->day_of_week(), ++ 4, ++ 'day of week does not change after failed truncate() call' ++ ); ++} ++ + done_testing(); +-- +1.9.0 + diff --git a/SPECS/perl-DateTime.spec b/SPECS/perl-DateTime.spec new file mode 100644 index 0000000..2e936cd --- /dev/null +++ b/SPECS/perl-DateTime.spec @@ -0,0 +1,352 @@ +Name: perl-DateTime +Epoch: 2 +Version: 1.04 +Release: 6%{?dist} +Summary: Date and time object +License: (Artistic 2.0) and (GPL+ or Artistic) +Group: Development/Libraries +URL: http://search.cpan.org/dist/DateTime/ +Source0: http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-%{version}.tar.gz +# Restore object after failed truncate() call, bug #1095111, CPAN RT#93347, +# in 1.09 +Patch0: DateTime-1.06-Don-t-leave-the-object-in-a-modified-state-after-a-f.patch +# Add 2015-06-30 leap second, bug #1353509, in 1.20 +Patch1: DateTime-1.04-There-will-be-a-leap-second-on-June-30-2015.patch +# Add 2016-12-31 leap second, bug #1353509, in 1.34 +Patch2: DateTime-1.04-Add-leap-second-on-December-31-2016.patch +BuildRequires: perl +BuildRequires: perl(autodie) +BuildRequires: perl(integer) +BuildRequires: perl(lib) +BuildRequires: perl(Module::Build) +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Run-time: +BuildRequires: perl(base) +BuildRequires: perl(Carp) +BuildRequires: perl(constant) +BuildRequires: perl(DateTime::Locale) >= 0.41 +BuildRequires: perl(DateTime::TimeZone) >= 1.09 +BuildRequires: perl(integer) +BuildRequires: perl(overload) +BuildRequires: perl(Params::Validate) >= 0.76 +BuildRequires: perl(POSIX) +BuildRequires: perl(Scalar::Util) +BuildRequires: perl(Try::Tiny) +BuildRequires: perl(vars) +BuildRequires: perl(XSLoader) +# Tests: +# Cwd not used +# Test::DependentModules not used +BuildRequires: perl(Test::Fatal) +BuildRequires: perl(Test::More) >= 0.88 +BuildRequires: perl(utf8) +# Optional tests: +# circular dependency - perl(DateTime::Format::Strptime) >= 1.2000 +BuildRequires: perl(Storable) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Requires: perl(XSLoader) + +# not automatically detected +Provides: perl(DateTimePP) = %{version} +Provides: perl(DateTimePPExtra) = %{version} + +%{?perl_default_filter} +# Filter under-specified dependencies +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\((DateTime::Locale|DateTime::TimeZone|Params::Validate)\\)$ + +%description +DateTime is a class for the representation of date/time combinations. It +represents the Gregorian calendar, extended backwards in time before its +creation (in 1582). This is sometimes known as the "proleptic Gregorian +calendar". In this calendar, the first day of the calendar (the epoch), is the +first day of year 1, which corresponds to the date which was (incorrectly) +believed to be the birth of Jesus Christ. + +%prep +%setup -q -n DateTime-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +./tools/leap_seconds_header.pl + +%build +%{__perl} Build.PL installdirs=vendor optimize="%{optflags}" +./Build + +%install +./Build install destdir=%{buildroot} create_packlist=0 +find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} \; +%{_fixperms} %{buildroot}/* + +%check +./Build test + +%files +%doc Changes CREDITS LICENSE README TODO +%{perl_vendorarch}/auto/* +%{perl_vendorarch}/DateTime* +%{_mandir}/man3/* + +%changelog +* Wed May 07 2014 Petr Pisar - 2:1.04-6 +- Restore object after failed truncate() call (bug #1095111) +- Add 2015-06-30 and 2016-12-31 leap seconds (bug #1353509) + +* Tue Jan 28 2014 Jitka Plesnikova - 2:1.04-5 +- Fix license tag +- Resolves: rhbz#1058691 + +* Tue Jan 28 2014 Jitka Plesnikova - 2:1.04-4 +- Update license tag +- Resolves: rhbz#1058691 + +* Fri Jan 24 2014 Daniel Mach - 2:1.04-3 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2:1.04-2 +- Mass rebuild 2013-12-27 + +* Tue Dec 10 2013 Petr Pisar - 2:1.04-1 +- 1.04 bump + +* Tue Jun 25 2013 Jitka Plesnikova - 2:1.03-1 +- 1.03 bump + +* Tue Apr 02 2013 Petr Šabata - 2:1.01-1 +- 1.01 bump + +* Thu Feb 14 2013 Fedora Release Engineering - 2:0.78-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Nov 19 2012 Petr Pisar - 2:0.78-1 +- 0.78 bump + +* Thu Oct 18 2012 Petr Pisar - 2:0.77-1 +- 0.77 bump + +* Fri Jul 20 2012 Fedora Release Engineering - 2:0.70-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jun 20 2012 Petr Pisar - 2:0.70-4 +- Perl 5.16 rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 2:0.70-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Aug 18 2011 Iain Arnell 2:0.70-2 +- Additional (Build)Requires from unofficial review + +* Mon Aug 15 2011 Iain Arnell 2:0.70-1 +- Unbundle DateTime::TimeZone and DateTime::Locale +- Bump epoch and revert to upstream versioning +- Specfile regenerated by cpanspec 1.78. +- Update description + +* Wed Jul 20 2011 Petr Sabata - 1:0.7000-3 +- Perl mass rebuild + +* Mon Jul 04 2011 Iain Arnell 1:0.7000-2 +- update DateTime::TimeZone to 1.35 (Olson 2011h) +- add rpm 4.9 filtering macros + +* Fri May 13 2011 Iain Arnell 1:0.7000-1 +- update DateTime to 0.70 + +* Wed May 04 2011 Iain Arnell 1:0.6900-1 +- update DateTime to 0.69 +- update DateTime::TimeZone to 1.34 (Olson 2011g) + +* Sun Apr 24 2011 Iain Arnell 1:0.6600-6 +- fix the testing for loop + +* Sun Apr 24 2011 Iain Arnell 1:0.6600-5 +- update DateTime::TimeZone to 1.33 (Olson 2011f) + +* Wed Apr 06 2011 Iain Arnell 1:0.6600-4 +- update DateTime::TimeZone to 1.32 (Olson 2011e) + +* Sat Mar 26 2011 Iain Arnell 1:0.6600-3 +- update DateTime::TimeZone to 1.31 +- DateTime::TimeZone no longer has Build.PL; use Makefile.PL +- whitespace cleanup +- clean up .packlist + +* Tue Feb 08 2011 Fedora Release Engineering - 1:0.6600-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Dec 12 2010 Steven Pritchard 1:0.6600-1 +- Update DateTime to 0.66. +- Update DateTime::TimeZone to 1.26. +- Update URL for FAQ in description. +- BR Class::Load and parent. + +* Sat Oct 09 2010 Iain Arnell 1:0.6300-1 +- Update DateTime to 0.63 +- Update DateTime::TimeZone to 1.22 +- DateTime license changed from "GPL+ or Artistic" to "Artistic 2.0" +- Fix DTLocale/Changelog encoding + +* Mon Jun 14 2010 Petr Sabata - 1:0.5300-4 +- perl-DateTime-Locale-0.45 update + +* Fri Apr 30 2010 Marcela Maslanova - 1:0.5300-3 +- Mass rebuild with perl-5.12.0 + +* Wed Jan 27 2010 Stepan Kasal - 1:0.5300-2 +- new upstream version of DateTime-TimeZone + +* Fri Jan 15 2010 Stepan Kasal - 1:0.5300-1 +- new upstream version +- use Build.PL as Makefile.PL no longer exists +- use iconv to recode to utf-8, not a patch +- update BuildRequires +- drop Provides: perl(DateTime::TimeZoneCatalog), it is no longer there +- use filtering macros + +* Mon Dec 7 2009 Stepan Kasal - 1:0.4501-4 +- rebuild against perl 5.10.1 + +* Sat Jul 25 2009 Fedora Release Engineering - 1:0.4501-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 1:0.4501-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Dec 09 2008 Steven Pritchard 1:0.4501-1 +- Update to DateTime 0.4501. + +* Mon Nov 10 2008 Steven Pritchard 1:0.4401-1 +- Update to DateTime 0.4401. +- Update to DateTime::Locale 0.42. +- Update to DateTime::TimeZone 0.8301. + +* Mon Sep 08 2008 Steven Pritchard 1:0.4304-2 +- Update to DateTime::TimeZone 0.7904. + +* Tue Jul 15 2008 Steven Pritchard 1:0.4304-1 +- Update to DateTime 0.4304. +- Update to DateTime::TimeZone 0.78. +- Update to DateTime::Locale 0.41. + +* Tue Jul 08 2008 Steven Pritchard 1:0.4302-2 +- Update to DateTime::TimeZone 0.7701. + +* Sat May 31 2008 Steven Pritchard 1:0.4302-1 +- Update to DateTime 0.4302. +- Update to DateTime::TimeZone 0.77. +- Update to DateTime::Locale 0.4001. +- BR List::MoreUtils. +- Define IS_MAINTAINER so we run the pod tests. + +* Thu May 15 2008 Steven Pritchard 1:0.42-1 +- Update to DateTime 0.42. +- Update to DateTime::TimeZone 0.75. +- Update FAQ URL in description. + +* Wed Feb 27 2008 Tom "spot" Callaway - 1:0.41-5 +- Rebuild for perl 5.10 (again) + +* Tue Feb 19 2008 Fedora Release Engineering - 1:0.41-4 +- Autorebuild for GCC 4.3 + +* Thu Jan 24 2008 Tom "spot" Callaway 1:0.41-3 +- rebuild for new perl + +* Tue Dec 11 2007 Steven Pritchard 1:0.41-2 +- Update License tag. +- Update to DateTime::TimeZone 0.70. + +* Mon Sep 17 2007 Steven Pritchard 1:0.41-1 +- Update to DateTime 0.41. +- Update to DateTime::Locale 0.35. +- Update to DateTime::TimeZone 0.67. + +* Wed Aug 29 2007 Fedora Release Engineering - 1:0.39-2 +- Rebuild for selinux ppc32 issue. + +* Sun Jul 22 2007 Steven Pritchard 1:0.39-1 +- Update to DateTime 0.39. +- Update to DateTime::TimeZone 0.6603. + +* Thu Jul 05 2007 Steven Pritchard 1:0.38-2 +- BR Test::Output. + +* Mon Jul 02 2007 Steven Pritchard 1:0.38-1 +- Update to DateTime 0.38. +- Update to DateTime::TimeZone 0.6602. +- BR Test::Pod::Coverage. + +* Mon Apr 02 2007 Steven Pritchard 1:0.37-3 +- Drop BR DateTime::Format::* to avoid circular build deps. + +* Mon Apr 02 2007 Steven Pritchard 1:0.37-2 +- Filter Win32::TieRegistry dependency. +- Do the provides filter like we do in cpanspec. +- Drop some macro usage. + +* Sat Mar 31 2007 Steven Pritchard 1:0.37-1 +- Update to DateTime 0.37. +- Update to DateTime::TimeZone 0.63. + +* Tue Mar 13 2007 Steven Pritchard 1:0.36-2 +- Update to DateTime::Locale 0.34. +- Update to DateTime::TimeZone 0.62. + +* Mon Jan 22 2007 Steven Pritchard 1:0.36-1 +- Update to Date::Time 0.36. +- Update to DateTime::Locale 0.33. +- Update to DateTime::TimeZone 0.59. + +* Fri Nov 03 2006 Steven Pritchard 1:0.35-1 +- Update to DateTime 0.35. +- Update to DateTime::Locale 0.3101. +- LICENSE.icu seems to have been renamed LICENSE.cldr. +- Update to DateTime::TimeZone 0.54. +- Use fixperms macro instead of our own chmod incantation. +- Convert DateTime::LeapSecond to UTF-8 to avoid a rpmlint warning. + +* Tue Aug 29 2006 Steven Pritchard 1:0.34-3 +- Update to DateTime::TimeZone 0.48. + +* Mon Aug 28 2006 Steven Pritchard 1:0.34-2 +- Update to DateTime::TimeZone 0.47. + +* Mon Aug 14 2006 Steven Pritchard 1:0.34-1 +- Update to DateTime 0.34. + +* Fri Jul 28 2006 Steven Pritchard 1:0.32-1 +- Update to DateTime 0.32. +- Improve Summary, description, and source URLs. +- Fix find option order. + +* Thu Jul 13 2006 Steven Pritchard 1:0.31-2 +- BR DateTime::Format::ICal and DateTime::Format::Strptime for better + test coverage. + +* Wed May 24 2006 Steven Pritchard 1:0.31-1 +- Update DateTime to 0.31. +- Update DateTime::TimeZone to 0.46. + +* Mon Feb 27 2006 Steven Pritchard 1:0.30-3 +- Bump Epoch (argh, 0.2901 > 0.30 to rpm) +- Update DateTime::TimeZone to 0.42 + +* Sat Feb 18 2006 Steven Pritchard 0.30-2 +- Update DateTime::TimeZone to 0.41 + +* Tue Jan 10 2006 Steven Pritchard 0.30-1 +- Update DateTime to 0.30 +- Update DateTime::TimeZone to 0.40 + +* Fri Sep 16 2005 Paul Howarth 0.2901-2 +- Unpack each tarball only once +- Use Module::Build's build script where available +- Help each module find the others when needed +- Clean up files list +- Include additional documentation from DT::Locale & DT::TimeZone +- Add BR: perl(File::Find::Rule) & perl(Test::Pod) to improve test coverage +- Remove unversioned provides of perl(DateTime) & perl(DateTime::TimeZone) + +* Wed Aug 31 2005 Steven Pritchard 0.2901-1 +- Specfile autogenerated.