File perl-Try-Tiny.spec of Package perl-Try-Tiny
#
# spec file for package perl-Try-Tiny
#
# Copyright (c) 2024 Andreas Vögele <andreas@andreasvoegele.com>
#
# 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.
# Please send bugfixes or comments to the author.
#
Name: perl-Try-Tiny
Version: 0.32
Release: 0
Summary: Minimal try/catch with proper localization of $@
License: MIT
URL: https://metacpan.org/dist/Try-Tiny
Source: https://cpan.metacpan.org/authors/id/E/ET/ETHER/Try-Tiny-%{version}.tar.gz
BuildArch: noarch
AutoProv: 1
AutoReq: 0
# Build:
BuildRequires: coreutils
BuildRequires: make
BuildRequires: perl
%if 0%{?fedora} > 0 || 0%{?rhel} > 0
BuildRequires: perl-generators
Requires: perl-libs
%endif
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
# Runtime:
BuildRequires: perl(Carp)
BuildRequires: perl(Exporter)
BuildRequires: perl(constant)
# Tests:
BuildRequires: perl(File::Spec)
BuildRequires: perl(Test::More)
BuildRequires: perl(if)
Requires: perl(Carp)
Requires: perl(Exporter)
Requires: perl(constant)
Requires: perl(strict)
Requires: perl(warnings)
%{?perl_requires}
%{?perl_default_filter}
%description
This module provides bare bones try/catch statements that are designed to
minimize common mistakes with eval blocks, and NOTHING else.
This is unlike TryCatch, which provides a nice syntax and avoids adding
another call stack layer, and supports calling return from the try block to
return from the parent subroutine. These extra features come at a cost of a
few dependencies, namely Devel::Declare and Scope::Upper that are occasionally
problematic, and the additional catch filtering uses Moose type constraints,
which may not be desirable either.
%prep
%autosetup -n Try-Tiny-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor
make
%install
%{make_install}
%{_fixperms} %{buildroot}/*
find %{buildroot} \
\( -name perllocal.pod -o -name .packlist -o -type d -empty \) \
-delete
%check
make test
%files
%defattr(-, root, root)
%license LICENCE
%doc Changes README
%{perl_vendorlib}/*
%{_mandir}/man3/*
%changelog