# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif Name: perl-DateTime-Format-Strptime Epoch: 1 Version: 1.79 Release: 7.%{__distinit}%{__distvers} Summary: Parse and format strptime and strftime patterns License: Artistic-2.0 URL: https://metacpan.org/release/DateTime-Format-Strptime Source0: https://cpan.metacpan.org/modules/by-module/DateTime/DateTime-Format-Strptime-%{version}.tar.gz BuildArch: noarch # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) # Module Runtime BuildRequires: perl(Carp) BuildRequires: perl(constant) BuildRequires: perl(DateTime) >= 1.00 BuildRequires: perl(DateTime::Locale) >= 1.30 BuildRequires: perl(DateTime::Locale::Base) BuildRequires: perl(DateTime::TimeZone) >= 2.09 BuildRequires: perl(Exporter) BuildRequires: perl(Params::ValidationCompiler) BuildRequires: perl(parent) BuildRequires: perl(Specio) >= 0.33 BuildRequires: perl(Specio::Declare) BuildRequires: perl(Specio::Exporter) BuildRequires: perl(Specio::Library::Builtins) BuildRequires: perl(Specio::Library::String) BuildRequires: perl(strict) BuildRequires: perl(Try::Tiny) BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(File::Spec) BuildRequires: perl(FindBin) BuildRequires: perl(lib) BuildRequires: perl(Test::Builder) BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::More) >= 0.96 BuildRequires: perl(Test::Warnings) BuildRequires: perl(utf8) # Optional Tests BuildRequires: perl(CPAN::Meta) >= 2.120900 BuildRequires: perl(CPAN::Meta::Prereqs) # Runtime %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif %description This module implements most of strptime(3), the POSIX function that is the reverse of strftime(3), for DateTime. While strftime takes a DateTime and a pattern and returns a string, strptime takes a string and a pattern and returns the DateTime object associated. %prep %setup -q -n DateTime-Format-Strptime-%{version} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} %check make test %files %license LICENSE %doc Changes CODE_OF_CONDUCT.md CONTRIBUTING.md README.md %{perl_vendorlib}/DateTime/ %{_mandir}/man3/DateTime::Format::Strptime.3* %{_mandir}/man3/DateTime::Format::Strptime::Types.3* %changelog * Tue Mar 28 2023 Paul Howarth - 1:1.79-7 - Use SPDX-format license tag * Mon May 3 2021 Paul Howarth - 1:1.79-1 - Update to 1.79 - Fix too-strict type checking for time zones: this module now uses the same check as DateTime itself, which allows for things that don't subclass DateTime::TimeZone as long as they provide the same API (GH#30) - Don't bother trying to run the extra tests - Use %%license unconditionally * Wed Dec 16 2020 Paul Howarth - 1:1.78-1 - Update to 1.78 - Fix tests for new failure caused by locale data changes in DateTime::Locale 1.29 (GH#28) - Added a warning about using locale-specific patterns; some of these patterns can change quite a bit as the locale data is updated, so using them for parsing does not produce stable results across time - this is what caused the test failures that this release fixes * Mon Mar 2 2020 Paul Howarth - 1:1.77-1 - Update to 1.77 - When the parsed string contained an invalid time zone offset (parsed with "%%z") like "-9999", the error handling set in the parser's constructor was ignored and an exception was always thrown (GH#25) * Sun Jun 9 2019 Paul Howarth - 1:1.76-2 - Perl 5.30 rebuild - Temporarily disable Code::TidyAll test because it breaks with dubious result * Fri Feb 8 2019 Paul Howarth - 1:1.76-1 - Update to 1.76 - The ability to set the pattern, time_zone, and locale via accessor methods has been removed; this was deprecated over three years ago in version 1.60 (it also turns out that the setting was actually broken for a long time but no one seemed to notice) - Package new upstream document CODE_OF_CONDUCT.md - Work around locale issues in mock builder * Tue Dec 26 2017 Paul Howarth - 1:1.75-1 - Update to 1.75 - Fixed tests to pass with blead Perl (GH#19) * Fri Aug 4 2017 Paul Howarth - 1:1.74-1 - Update to 1.74 - Fix text not to rely on a very specific exception message from Specio; this was broken in 0.39 (GH#18) - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - Drop workaround for building with Test::More < 0.96 - Spell checker is always hunspell now - Test::Warnings is always available now * Wed Feb 1 2017 Paul Howarth - 1:1.73-1 - Update to 1.73 - The format_datetime method now checks that the object it is given isa DateTime object (GH#17) - Update patches as needed * Wed Jan 25 2017 Paul Howarth - 1:1.72-1 - Update to 1.72 - By default, the word boundary checks added in 1.69 are now off; you can enable them by passing "strict => 1" to the constructor (GH#15) - Switched from Params::Validate to Params::ValidationCompiler - Require DateTime::Locale 1.05; this fixes some test failures seen on CPAN Testers - Require DateTime::TimeZone 2.09 because you should really update this on a regular basis - Require Specio 0.33 to fix other test failures seen on CPAN (I hope) - Update patches as needed * Mon Jan 9 2017 Paul Howarth - 1:1.70-2 - Test::Warnings now available back to Fedora 9 * Sun Dec 11 2016 Paul Howarth - 1:1.70-1 - Update to 1.70 - The word boundary check supposedly added in 1.67 didn't really work properly, and still matched too much (GH#11) - Added docs for several formats that have long been supported but not documented; these are %%P, %%c, %%x, and %%X (GH#10) - Altered the conversion specifier %%z to accept ±HH, ±HHMM, ±HH:MM and Z; previously only ±HHMM were accepted (GH#13) - Update patches as needed * Tue Aug 16 2016 Paul Howarth - 1:1.68-2 - Fix FTBFS when perl is not in the minimal buildroot - BR: perl-generators where available * Mon May 9 2016 Paul Howarth - 1:1.68-1 - Update to 1.68 - Author tests are no longer in t/, which makes running tests for non-authors much faster (CPAN RT#114237) - Explicitly run extra tests - Update patches as needed * Fri Apr 1 2016 Paul Howarth - 1:1.67-1 - Update to 1.67 - Fixed a regression introduced in 1.60; older versions of this library would match dates pretty much anywhere in a string, so "%%Y-%%m-%%d" would match a string like "abcd1234-12-30efgh" - this is probably too permissive, but we definitely want to match on word boundaries so that we match "log.2016-03-31" (GH#3) - Update patches as needed * Tue Mar 29 2016 Paul Howarth - 1:1.66-1 - Update to 1.66 - Added a zone_map constructor argument; this lets you supply a mapping for ambiguous time zone abbreviations (CPAN RT#74762) - Simplify find command using -delete - Update patches as needed * Sun Mar 20 2016 Paul Howarth - 1:1.65-1 - Update to 1.65 - Updated zone short name parsing to handle names like "+07", which were introduced in the latest IANA time zone database release - Update patches as needed * Mon Feb 22 2016 Paul Howarth - 1:1.64-1 - Update to 1.64 - Changed how a string that contains separate epoch and nanosecond fields is turned into a DateTime object in order to deal with changes coming in the next DateTime release - Update patches as needed * Thu Jan 14 2016 Paul Howarth - 1:1.63-1 - Update to 1.63 - The behaviour of silently ignoring text after the matching part was lost in the rewrite; this has been restored (CPAN RT#111155) - Update patches as needed * Mon Dec 21 2015 Paul Howarth - 1:1.62-1 - Update to 1.62 - When on_error was set to something that did not die (including the default error handling), calling ->parse_datetime with some bad inputs could cause the module to error out internally by trying to call methods on an undefined value instead of returning undef (CPAN RT#110247) * Sat Nov 14 2015 Paul Howarth - 1:1.61-1 - Update to 1.61 - If you loaded this module with warnings globally enabled, you'd get a warning about the import subroutine being redefined, which broke the Package::DeprecationManager API for turning off deprecation warnings; this has been fixed in Package::DeprecationManager 0.15 (CPAN RT#108871) - Epoch bump to match Fedora version - Bundle Test::Warnings for use with old distributions * Sun Nov 8 2015 Paul Howarth - 1.6000-1 - Update to 1.60 Backwards Incompatibilities - The error messages for various types of failures have changed - The never-documented diagnostic parameter for the constructor has been removed - The never-documented feature to allow you to use arbitrary DateTime.pm methods in the parsing pattern has been removed; this never made much sense anyway, since most DateTime.pm methods are not constructor params, but they were used that way - Using the pattern, locale, and time_zone to set the respective attribute is now deprecated; make a new object instead of changing one of these values Bug Fixes - Fixed a warning from the tests with newer Perl versions (CPAN RT#107620) - Clarified docs to note that %%Y and %%G require 4-digit years (CPAN RT#103147) - Using the 24-hour token (%%H) with an AM/PM specifier (%%p) now leads to an error if you try to parse something like "23:01 AM" (CPAN RT#92445) - Update patches as needed * Mon Oct 5 2015 Paul Howarth - 1.5700-1 - Update to 1.57 (rpm version 1.5700 to maintain upgrade path) - Make all tests pass with both the current DateTime::Locale and the upcoming new version (currently still in trial releases) - Instead of making extensive changes to the test suite to accomodate old versions of Test::More, bundle a suitably-recent version to use if necessary - Add patch to support building without Test::Code::TidyAll - Update other patches as needed * Mon Jun 29 2015 Paul Howarth - 1.5600-4 - Get rid of tabs if using Test::NoTabs! - Classify buildreqs by usage * Tue Sep 16 2014 Paul Howarth - 1.5600-2 - BR: perl(Test::Spelling) unconditionally * Tue Aug 12 2014 Paul Howarth - 1.5600-1 - Update to 1.56 (rpm version 1.5600 to maintain upgrade path) - Recent DateTime::TimeZone changes broke the tests - Fixed Latin-1 content in test code: it's now UTF-8 - Use %%license where possible - Update patches as needed * Sun May 4 2014 Paul Howarth - 1.5500-1 - Update to 1.55 (rpm version 1.5500 to maintain upgrade path) - If diagnostic is true for an object, it will now use Test::More::diag() under the test harness rather than printing to STDOUT - The %%z specifier will now parse UTC offsets with a colon like "+01:00" (CPAN RT#91458) - Made the regexes to parse day and months abbreviations and names a little more specific: as it stood, they tended to eat up more non-word characters than they should, so a pattern like '%%a%%m%%d_%%Y' broke on a date like 'Fri0215_2013' - the day name would be parsed as 'Fri02' and the month would not be parsed at all (CPAN RT#93863, CPAN RT#93865) - Update patches as needed - Drop support for old distributions prior to FC-5 - Drop patch supporting building with ExtUtils::MakeMaker < 6.30 - Drop %%defattr, redundant since rpm 4.4 * Thu Jan 16 2014 Paul Howarth - 1.5400-4 - Avoid Test::Spelling when bootstrapping * Wed Jul 24 2013 Paul Howarth - 1.5400-3 - Perl 5.18 rebuild * Fri Jul 5 2013 Paul Howarth - 1.5400-2 - Drop redundant BR: perl(Test::Kwalitee) * Wed Apr 3 2013 Paul Howarth - 1.5400-1 - Update to 1.54 (rpm version 1.5400 to maintain upgrade path) - Require DateTime.pm 1.00 because without it tests will break * Tue Apr 2 2013 Paul Howarth - 1.5300-1 - Update to 1.53 (rpm version 1.5300 to maintain upgrade path) - A fix in DateTime.pm 1.00 broke a test in this distro (CPAN RT#84371) - Update old Test::More patch * Mon Jul 2 2012 Paul Howarth - 1.5200-1 - Update to 1.52 (rpm version 1.5200 to maintain upgrade path) - Shut up "unescaped braces in regex" warning from 5.17.0 (CPAN RT#77514) - Update spelling patch * Mon May 28 2012 Paul Howarth - 1.5100-1 - Update to 1.51 (rpm version 1.5100 to maintain upgrade path) - Packaging cleanup, including listing Test::More as a test prereq, not a runtime prereq (CPAN RT#76128) - Add patch to support building with Test::More < 0.88 if necessary - Update other patches - BR: perl(Carp) and perl(Exporter) - Don't need to remove empty directories from buildroot - Drop support for old distributions prior to FC-3: - Don't need to define %%perl_version or %%{perl_vendorlib} - Use DESTDIR rather than PERL_INSTALL_ROOT - Drop workaround for 5.8.0 - Unconditionally BR: perl(Test::Spelling) and aspell-en * Thu Jun 23 2011 Paul Howarth - 1.5000-4 - Rebuild for perl 5.14.1 in Rawhide - Fix dist tag for CentOS 6 and Scientific Linux * Wed Mar 23 2011 Paul Howarth - 1.5000-3 - Test::Kwalitee now available universally - Nobody else likes macros for commands * Tue Mar 22 2011 Paul Howarth - 1.5000-2 - Test::Kwalitee now available down to F-1 * Mon Oct 18 2010 Paul Howarth - 1.5000-1 - Update to 1.5000 - Module did not recognize UTC as a valid time zone (CPAN RT#59209) - Update spelling patch - BR: Test::Kwalitee where available (from F-9) * Tue Jun 29 2010 Paul Howarth - 1.4000-1 - Update to 1.4000 (actually update $VERSION in module file) - Update patch for building with ExtUtils::MakeMaker < 6.31 - Update spelling patch * Mon Jun 28 2010 Paul Howarth - 1.3000-1 - Update to 1.3000 (specifiers such as %%e that allowed for leading space before a number would cause DateTime.pm to throw an error if the date being parsed actually contained leading space [CPAN RT#58459]) - Enable AUTHOR_TESTING and RELEASE_TESTING - BR: Test::EOL, Test::NoTabs, Test::Pod, Test::Pod::Coverage, Test::Spelling - Add patch for building with ExtUtils::MakeMaker < 6.31 - Add patch to fix spell check test - License changed to Artistic 2.0 * Fri Jun 25 2010 Paul Howarth - 1.2000-3 - Rebuild for perl 5.12.1 in Rawhide * Wed May 19 2010 Paul Howarth - 1.2000-2 - Fix dist tag for RHEL-6 Beta * Sun Mar 21 2010 Paul Howarth - 1.2000-1 - Update to 1.2000 (updated to use non-deprecated DateTime::Locale API) - This release by DROLSKY -> update source URL - Bump required perl(DateTime::Locale) version to 0.45 and add runtime dep too - Upstream dropped "test_more" tests - probably due to error by new maintainer * Thu Feb 4 2010 Paul Howarth - 1.1000-1 - Import from Fedora - Update to 1.1000 - Drop locale patch, issue addressed upstream - Add new patch for 006_locales test in Perl 5.8.0 - some locales broken - Bump dependency versions - Run additional tests * Mon Dec 7 2009 Stepan Kasal - 1.0800-4 - Rebuild against perl 5.10.1 * Sat Jul 25 2009 Fedora Release Engineering - 1.0800-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 1.0800-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Fri Aug 29 2008 Steven Pritchard - 1.0800-1 - Update to 1.0800 - Update versions on build dependencies * Tue Jul 08 2008 Steven Pritchard - 1.0702-3 - Patch t/004_locale_defaults.t to work around change in DateTime::Locale * Tue Mar 04 2008 Tom "spot" Callaway - 1.0702-2 - Rebuild for new perl * Thu Jan 03 2008 Steven Pritchard - 1.0702-1 - Update to 1.0702 - Drop charset patch - Update License tag - BR Test::More * Tue Apr 17 2007 Steven Pritchard - 1.0700-3 - Use fixperms macro instead of our own chmod incantation - BR ExtUtils::MakeMaker * Sat Sep 16 2006 Steven Pritchard - 1.0700-2 - Fix find option order * Mon Jul 03 2006 Steven Pritchard - 1.0700-1 - Specfile autogenerated by cpanspec 1.66 - Fix License - Remove versioned DateTime deps (0.1402 > 0.30 according to rpm) - Remove versioned explicit dependencies that rpmbuild picks up - Substitute literal "©" for E<169> in pod documentation (the result should be the same, but apparently the man page conversion is generating something that rpmlint doesn't like)