2011-05-02 17:01:04 +02:00
|
|
|
#
|
2011-05-31 13:38:18 +02:00
|
|
|
# spec file for package perl-Eval-Closure
|
2011-05-02 17:01:04 +02:00
|
|
|
#
|
2013-03-21 15:12:46 +01:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-05-02 17:01:04 +02: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.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2011-05-31 13:38:18 +02:00
|
|
|
|
2011-05-02 17:00:51 +02:00
|
|
|
Name: perl-Eval-Closure
|
2013-07-31 16:13:44 +02:00
|
|
|
Version: 0.11
|
2012-05-29 16:44:05 +02:00
|
|
|
Release: 0
|
2011-05-31 13:38:06 +02:00
|
|
|
%define cpan_name Eval-Closure
|
2011-06-04 20:58:04 +02:00
|
|
|
Summary: Safely and cleanly create closures via string eval
|
2013-07-31 16:13:44 +02:00
|
|
|
License: Artistic-1.0 or GPL-1.0+
|
2011-05-02 17:00:51 +02:00
|
|
|
Group: Development/Libraries/Perl
|
2012-05-29 16:44:05 +02:00
|
|
|
Url: http://search.cpan.org/dist/Eval-Closure/
|
2011-05-31 13:38:06 +02:00
|
|
|
Source: http://www.cpan.org/authors/id/D/DO/DOY/%{cpan_name}-%{version}.tar.gz
|
|
|
|
BuildArch: noarch
|
2011-05-02 17:01:04 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-05-31 13:38:06 +02:00
|
|
|
BuildRequires: perl
|
2011-05-02 17:00:51 +02:00
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(Test::Fatal)
|
2011-05-31 13:38:06 +02:00
|
|
|
BuildRequires: perl(Test::More) >= 0.88
|
|
|
|
BuildRequires: perl(Test::Requires)
|
2011-05-02 17:00:51 +02:00
|
|
|
BuildRequires: perl(Try::Tiny)
|
2013-07-31 16:13:44 +02:00
|
|
|
#BuildRequires: perl(Devel::LexAlias)
|
|
|
|
#BuildRequires: perl(Eval::Closure)
|
|
|
|
#BuildRequires: perl(Perl::Tidy)
|
2011-05-31 13:38:06 +02:00
|
|
|
Requires: perl(Try::Tiny)
|
2013-07-31 16:13:44 +02:00
|
|
|
Recommends: perl(Devel::LexAlias) >= 0.05
|
2011-05-31 13:38:06 +02:00
|
|
|
Recommends: perl(Perl::Tidy)
|
|
|
|
%{perl_requires}
|
2011-05-02 17:00:51 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
String eval is often used for dynamic code generation. For instance,
|
2011-05-31 13:38:06 +02:00
|
|
|
'Moose' uses it heavily, to generate inlined versions of accessors and
|
2011-05-02 17:00:51 +02:00
|
|
|
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
|
2013-07-31 16:13:44 +02:00
|
|
|
inside the eval), and it's easy to miss compilation errors, since eval
|
|
|
|
catches them and sticks them in $@ instead.
|
2011-05-31 13:38:06 +02:00
|
|
|
|
2013-07-31 16:13:44 +02:00
|
|
|
This module attempts to solve these problems. It provides an 'eval_closure'
|
|
|
|
function, which evals a string in a clean environment, other than a fixed
|
|
|
|
list of specified variables. Compilation errors are rethrown automatically.
|
2011-05-02 17:00:51 +02:00
|
|
|
|
|
|
|
%prep
|
2011-05-31 13:38:06 +02:00
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
2012-05-29 16:44:05 +02:00
|
|
|
%if 0%{?suse_version} < 1210
|
2013-03-21 15:12:46 +01:00
|
|
|
mv t/00-compile.t t/00-compile.t.disable
|
|
|
|
sed -i "s|^use Test::More;|use Test::More qw(no_plan);|g; \
|
2013-07-31 16:13:44 +02:00
|
|
|
s|^done_testing;|#done_testing;|g" t/*.t
|
2013-03-21 15:12:46 +01:00
|
|
|
mv t/00-compile.t.disable t/00-compile.t
|
2011-06-04 20:58:04 +02:00
|
|
|
%endif
|
2011-05-02 17:00:51 +02:00
|
|
|
|
|
|
|
%build
|
2011-05-31 13:38:06 +02:00
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
|
|
%check
|
|
|
|
%{__make} test
|
2011-05-02 17:00:51 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2011-05-31 13:38:06 +02:00
|
|
|
%perl_gen_filelist
|
2011-05-02 17:00:51 +02:00
|
|
|
|
2011-05-31 13:38:06 +02:00
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
2013-07-31 16:13:44 +02:00
|
|
|
%doc Changes LICENSE README
|
2011-05-02 17:00:51 +02:00
|
|
|
|
2011-05-02 17:01:04 +02:00
|
|
|
%changelog
|