2007-01-15 23:32:01 +00:00
|
|
|
#
|
2011-11-17 15:55:06 +00:00
|
|
|
# spec file for package perl-Time-Duration
|
2007-01-15 23:32:01 +00:00
|
|
|
#
|
2015-04-15 05:06:05 +00:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-15 23:32:01 +00:00
|
|
|
#
|
2009-06-18 15:14:34 +00:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2007-01-15 23:32:01 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2009-06-18 15:14:34 +00:00
|
|
|
|
2007-01-15 23:32:01 +00:00
|
|
|
Name: perl-Time-Duration
|
2015-04-15 05:06:05 +00:00
|
|
|
Version: 1.1
|
|
|
|
Release: 0
|
|
|
|
%define cpan_name Time-Duration
|
|
|
|
Summary: rounded or exact English expression of durations
|
2011-12-14 12:39:09 +00:00
|
|
|
License: Artistic-1.0 or GPL-1.0+
|
|
|
|
Group: Development/Libraries/Perl
|
2015-04-15 05:06:05 +00:00
|
|
|
Url: http://search.cpan.org/dist/Time-Duration/
|
|
|
|
Source: http://www.cpan.org/authors/id/A/AV/AVIF/%{cpan_name}-%{version}.tar.gz
|
|
|
|
BuildArch: noarch
|
2007-01-15 23:32:01 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2015-04-15 05:06:05 +00:00
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(Test::Pod)
|
|
|
|
BuildRequires: perl(Test::Pod::Coverage)
|
2010-12-03 14:54:38 +00:00
|
|
|
%{perl_requires}
|
2007-01-15 23:32:01 +00:00
|
|
|
|
|
|
|
%description
|
2015-04-15 05:06:05 +00:00
|
|
|
This module provides functions for expressing durations in rounded or exact
|
|
|
|
terms.
|
|
|
|
|
|
|
|
In the first example in the Synopsis, using duration($interval_seconds):
|
2007-01-15 23:32:01 +00:00
|
|
|
|
2015-04-15 05:06:05 +00:00
|
|
|
If the 'time() - $start_time' is 3 seconds, this prints "Runtime: *3
|
|
|
|
seconds*.". If it's 0 seconds, it's "Runtime: *0 seconds*.". If it's 1
|
|
|
|
second, it's "Runtime: *1 second*.". If it's 125 seconds, you get "Runtime:
|
|
|
|
*2 minutes and 5 seconds*.". If it's 3820 seconds (which is exactly 1h, 3m,
|
|
|
|
40s), you get it rounded to fit within two expressed units: "Runtime: *1
|
|
|
|
hour and 4 minutes*.". Using duration_exact instead would return "Runtime:
|
|
|
|
*1 hour, 3 minutes, and 40 seconds*".
|
2007-01-15 23:32:01 +00:00
|
|
|
|
2015-04-15 05:06:05 +00:00
|
|
|
In the second example in the Synopsis, using ago($interval_seconds):
|
2007-01-15 23:32:01 +00:00
|
|
|
|
2015-04-15 05:06:05 +00:00
|
|
|
If the $age is 3 seconds, this prints "_file_ was modified *3 seconds
|
|
|
|
ago*". If it's 0 seconds, it's "_file_ was modified *just now*", as a
|
|
|
|
special case. If it's 1 second, it's "from *1 second ago*". If it's 125
|
|
|
|
seconds, you get "_file_ was modified *2 minutes and 5 seconds ago*". If
|
|
|
|
it's 3820 seconds (which is exactly 1h, 3m, 40s), you get it rounded to fit
|
|
|
|
within two expressed units: "_file_ was modified *1 hour and 4 minutes
|
|
|
|
ago*". Using ago_exact instead would return "_file_ was modified *1 hour, 3
|
|
|
|
minutes, and 40 seconds ago*". And if the file's modtime is, surprisingly,
|
|
|
|
three seconds into the future, $age is -3, and you'll get the equally and
|
|
|
|
appropriately surprising "_file_ was modified *3 seconds from now*."
|
2007-01-15 23:32:01 +00:00
|
|
|
|
|
|
|
%prep
|
2015-04-15 05:06:05 +00:00
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
2007-01-15 23:32:01 +00:00
|
|
|
|
|
|
|
%build
|
2015-04-15 05:06:05 +00:00
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%{__make} %{?_smp_mflags}
|
2007-10-04 22:38:18 +00:00
|
|
|
|
|
|
|
%check
|
2015-04-15 05:06:05 +00:00
|
|
|
%{__make} test
|
2007-01-15 23:32:01 +00:00
|
|
|
|
|
|
|
%install
|
2015-04-15 05:06:05 +00:00
|
|
|
%perl_make_install
|
2007-01-15 23:32:01 +00:00
|
|
|
%perl_process_packlist
|
2015-04-15 05:06:05 +00:00
|
|
|
%perl_gen_filelist
|
2007-01-15 23:32:01 +00:00
|
|
|
|
2015-04-15 05:06:05 +00:00
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
|
|
|
%doc ChangeLog README
|
2009-06-18 15:14:34 +00:00
|
|
|
|
2007-10-04 22:38:18 +00:00
|
|
|
%changelog
|