2011-05-02 17:01:04 +02:00
|
|
|
#
|
|
|
|
# spec file for package perl-Eval-Closure
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2011-05-02 17:00:51 +02:00
|
|
|
|
|
|
|
Name: perl-Eval-Closure
|
|
|
|
Version: 0.03
|
2011-05-02 17:01:04 +02:00
|
|
|
Release: 1
|
2011-05-02 17:00:51 +02:00
|
|
|
Summary: Safely and cleanly create closures via string eval
|
|
|
|
Source: http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Eval-Closure-%{version}.tar.gz
|
2011-05-02 17:01:04 +02:00
|
|
|
Url: http://search.cpan.org/dist/Eval-Closure
|
2011-05-02 17:00:51 +02:00
|
|
|
Group: Development/Libraries/Perl
|
|
|
|
License: Perl License
|
2011-05-02 17:01:04 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-05-02 17:00:51 +02:00
|
|
|
%{perl_requires}
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: make
|
|
|
|
BuildRequires: perl(Test::Requires)
|
|
|
|
BuildRequires: perl(Test::Output)
|
|
|
|
BuildRequires: perl(Test::More) >= 0.88
|
|
|
|
BuildRequires: perl(Test::Fatal)
|
|
|
|
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.31
|
|
|
|
BuildRequires: perl(Try::Tiny)
|
|
|
|
BuildRequires: perl(Scalar::Util)
|
|
|
|
BuildRequires: perl(Sub::Exporter)
|
|
|
|
Requires: perl(Try::Tiny)
|
|
|
|
Requires: perl(Scalar::Util)
|
|
|
|
Requires: perl(Sub::Exporter)
|
|
|
|
%if 0%{?suse_version} >= 1120
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
|
|
|
String eval is often used for dynamic code generation. For instance,
|
|
|
|
"Moose" uses it heavily, to generate inlined versions of accessors and
|
|
|
|
constructors, which speeds code up at runtime by a significant amount.
|
|
|
|
String eval is not without its issues however - it's difficult to control
|
|
|
|
the scope it's used in (which determines which variables are in scope
|
|
|
|
inside the eval), and it can be quite slow, especially if doing a large
|
|
|
|
number of evals.
|
|
|
|
This module attempts to solve both of those problems. It provides an
|
|
|
|
"eval_closure" function, which evals a string in a clean environment,
|
|
|
|
other than a fixed list of specified variables. It also caches the result
|
|
|
|
of the eval, so that doing repeated evals of the same source, even with a
|
|
|
|
different environment, will be much faster (but note that the description
|
|
|
|
is part of the string to be evaled, so it must also be the same (or
|
|
|
|
non-existent) if caching is to work properly).
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n "Eval-Closure-%{version}"
|
|
|
|
%__sed -i '/^auto_install/d' Makefile.PL
|
|
|
|
|
|
|
|
%build
|
|
|
|
%__perl Makefile.PL PREFIX="%{_prefix}"
|
|
|
|
%__make %{?_smp_flags}
|
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
|
|
|
|
%check
|
|
|
|
%__make test
|
|
|
|
|
|
|
|
%clean
|
|
|
|
%{?buildroot:%__rm -rf "%{buildroot}"}
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc README Changes LICENSE
|
|
|
|
%dir %{perl_vendorlib}/Eval
|
|
|
|
%{perl_vendorlib}/Eval/Closure.pm
|
|
|
|
%doc %{perl_man3dir}/Eval::Closure.%{perl_man3ext}%{ext_man}
|
2011-05-02 17:01:04 +02:00
|
|
|
%changelog
|