2014-03-18 11:53:21 +01:00
|
|
|
#
|
|
|
|
# spec file for package perl-Time-Out
|
|
|
|
#
|
2024-03-09 00:06:45 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2014-03-18 11:53:21 +01: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.
|
|
|
|
|
2023-12-09 14:22:34 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-03-18 11:53:21 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-12-09 14:22:34 +01:00
|
|
|
%define cpan_name Time-Out
|
2014-03-18 11:53:21 +01:00
|
|
|
Name: perl-Time-Out
|
2023-12-09 14:22:34 +01:00
|
|
|
Version: 0.240.0
|
2014-03-18 11:53:21 +01:00
|
|
|
Release: 0
|
2023-12-09 14:22:34 +01:00
|
|
|
%define cpan_version 0.24
|
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2014-03-18 11:53:21 +01:00
|
|
|
Summary: Easily timeout long running operations
|
2023-12-09 14:22:34 +01:00
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/S/SV/SVW/%{cpan_name}-%{cpan_version}.tar.gz
|
2014-03-18 11:53:21 +01:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
2023-12-09 14:22:34 +01:00
|
|
|
BuildRequires: perl(App::cpanminus) >= 1.7046
|
|
|
|
BuildRequires: perl(ExtUtils::MakeMaker::CPANfile) >= 0.09
|
|
|
|
BuildRequires: perl(Test::Fatal)
|
|
|
|
BuildRequires: perl(Test::Needs)
|
|
|
|
BuildRequires: perl(Try::Tiny)
|
|
|
|
Requires: perl(Try::Tiny)
|
|
|
|
Provides: perl(Time::Out) = %{version}
|
|
|
|
Provides: perl(Time::Out::Exception) = %{version}
|
|
|
|
Provides: perl(Time::Out::ParamConstraints) = %{version}
|
2024-03-09 00:06:45 +01:00
|
|
|
%undefine __perllib_provides
|
2023-12-09 14:22:34 +01:00
|
|
|
Recommends: perl(Time::HiRes) >= 1.972.600
|
2014-03-18 11:53:21 +01:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
2023-12-09 14:22:34 +01:00
|
|
|
The 'Time::Out' module provides an easy interface to alarm(2) based
|
|
|
|
timeouts. Nested timeouts are supported. The module exports the 'timeout()'
|
|
|
|
function by default. The function returns whatever the code placed inside
|
|
|
|
the subroutine reference returns:
|
|
|
|
|
|
|
|
use Time::Out qw( timeout );
|
|
|
|
|
|
|
|
my $result = timeout 5 => sub {
|
|
|
|
return 7;
|
|
|
|
};
|
|
|
|
# $result == 7
|
|
|
|
|
|
|
|
If 'Time::Out' sees that Time::HiRes has been loaded, it will use that
|
|
|
|
'alarm()' function (if available) instead of the default one, allowing
|
|
|
|
float timeout values to be used effectively:
|
|
|
|
|
|
|
|
use Time::HiRes qw();
|
|
|
|
use Time::Out qw( timeout );
|
|
|
|
|
|
|
|
timeout 3.1416 => sub {
|
|
|
|
# ...
|
|
|
|
};
|
2014-03-18 11:53:21 +01:00
|
|
|
|
|
|
|
%prep
|
2023-12-09 14:22:34 +01:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
2014-03-18 11:53:21 +01:00
|
|
|
|
|
|
|
%build
|
2023-12-09 14:22:34 +01:00
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%make_build
|
2014-03-18 11:53:21 +01:00
|
|
|
|
|
|
|
%check
|
2023-12-09 14:22:34 +01:00
|
|
|
make test
|
2014-03-18 11:53:21 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%doc Changes README
|
2023-12-09 14:22:34 +01:00
|
|
|
%license LICENSE
|
2014-03-18 11:53:21 +01:00
|
|
|
|
|
|
|
%changelog
|