File perl-Try-Tiny.spec of Package perl-Try-Tiny

#
# spec file for package perl-Try-Tiny (Version 0.07)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           perl-Try-Tiny
%define cpan_name Try-Tiny
Summary:        Minimal try/catch with proper localization of $@
Version:        0.07
Release:        2
License:        MIT
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/Try-Tiny/
#Source:         http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Try-Tiny-0.07.tar.gz
Source:         %{cpan_name}-%{version}.tar.bz2
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Test::More)

%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 which are occasionally
problematic, and the additional catch filtering uses Moose type constraints
which may not be desirable either.

The main focus of this module is to provide simple and reliable error handling
for those having a hard time installing TryCatch, but who still want to write
correct eval blocks without 5 lines of boilerplate each time.

It's designed to work as correctly as possible in light of the various
pathological edge cases (see BACKGROUND) and to be compatible with any style of
error values (simple strings, references, objects, overloaded objects, etc).

Authors:
--------
    Yuval Kogman <nothingmuch@woobling.org>

%prep
%setup -q -n %{cpan_name}-%{version}

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}

%check
%{__make} test

%install
%perl_make_install
# do not perl_process_packlist (noarch)
# remove .packlist file
%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
# remove perllocal.pod file
%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
%perl_gen_filelist

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.files
%defattr(-,root,root,-)
%doc Changes

%changelog
openSUSE Build Service is sponsored by