File perl-Scope-Guard.spec of Package perl-Scope-Guard

#
# spec file for package perl-Scope-Guard
#
# Copyright (c) 2011 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/
#


%define cpan_name Scope-Guard

Name:           perl-%cpan_name
Version:        0.20
Release:        1
Provides:       %cpan_name
Group:          Development/Libraries/Perl
License:        Artistic-1.0
Url:            http://search.cpan.org/dist/Scope-Guard/
Summary:        Lexically scoped resource management
Source:         %cpan_name-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires:  perl-Test-Pod perl-Test-Pod-Coverage
BuildRequires:  perl-macros

%description
This module provides a convenient way to perform cleanup or other forms of
resource management at the end of a scope. It is particularly useful when
dealing with exceptions: the Scope::Guard constructor takes a reference to
a subroutine that is guaranteed to be called even if the thread of execution
is aborted prematurely. This effectively allows lexically-scoped "promises"
to be made that are automatically honoured by perl's garbage collector.

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

%build
perl Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall"
make
make test

%install
make DESTDIR=$RPM_BUILD_ROOT install_vendor
%perl_process_packlist

%clean
# clean up the hard disc after build
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc %{_mandir}/man?/*
%{perl_vendorlib}/Scope
%{perl_vendorarch}/auto/Scope
%doc Changes MANIFEST README 

%changelog
openSUSE Build Service is sponsored by