From ddcd1cf9743f9c8165363f95b3a957dbb4dc8c2f Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Wed, 12 Nov 2014 14:22:59 +0000 Subject: [PATCH] Update to 0.11 - New upstream release 0.11 - Support lexical subs on 5.18+ - Fix pod links - Add "alias => 1" option for making closure variables actually alias the closed over variables (so the variable referenced in the environment hashref will actually be updated by changes made in the closure) - Classify buildreqs by usage - Use %license - Make %files list more explicit - Update %description - Don't need to remove empty directories from the buildroot --- .gitignore | 9 +---- perl-Eval-Closure.spec | 77 ++++++++++++++++++++++++++++-------------- sources | 2 +- 3 files changed, 54 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 6a1d6ba..3e90571 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1 @@ -/Eval-Closure-0.01.tar.gz -/Eval-Closure-0.02.tar.gz -/Eval-Closure-0.03.tar.gz -/Eval-Closure-0.04.tar.gz -/Eval-Closure-0.05.tar.gz -/Eval-Closure-0.06.tar.gz -/Eval-Closure-0.07.tar.gz -/Eval-Closure-0.08.tar.gz +/Eval-Closure-[0-9.]*.tar.gz diff --git a/perl-Eval-Closure.spec b/perl-Eval-Closure.spec index 9cf7e55..9e6c911 100644 --- a/perl-Eval-Closure.spec +++ b/perl-Eval-Closure.spec @@ -1,63 +1,90 @@ Name: perl-Eval-Closure -Version: 0.08 -Release: 8%{?dist} +Version: 0.11 +Release: 1%{?dist} Summary: Safely and cleanly create closures via string eval License: GPL+ or Artistic -Group: Development/Libraries URL: http://search.cpan.org/dist/Eval-Closure/ -Source0: http://www.cpan.org/authors/id/D/DO/DOY/Eval-Closure-%{version}.tar.gz +Source0: http://search.cpan.org/CPAN/authors/id/D/DO/DOY/Eval-Closure-%{version}.tar.gz BuildArch: noarch -BuildRequires: perl(ExtUtils::MakeMaker) -BuildRequires: perl(PadWalker) +# Module Build +BuildRequires: perl +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 +# Module Runtime +BuildRequires: perl(Carp) +BuildRequires: perl(constant) +BuildRequires: perl(Devel::LexAlias) >= 0.05 +BuildRequires: perl(Exporter) +BuildRequires: perl(overload) BuildRequires: perl(Perl::Tidy) BuildRequires: perl(Scalar::Util) -BuildRequires: perl(Sub::Exporter) +BuildRequires: perl(strict) +BuildRequires: perl(Try::Tiny) +# Test Suite +BuildRequires: perl(B) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Temp) +BuildRequires: perl(PadWalker) BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Test::Output) BuildRequires: perl(Test::Requires) -BuildRequires: perl(Try::Tiny) +BuildRequires: perl(warnings) +# Runtime +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(Devel::LexAlias) >= 0.05 Requires: perl(Perl::Tidy) -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) - -%{?perl_default_filter} %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's easy to miss -compilation errors, since eval catches them and sticks them in $@ instead. - -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. +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} %build -%{__perl} Makefile.PL INSTALLDIRS=vendor +perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} - find %{buildroot} -type f -name .packlist -exec rm -f {} \; -find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \; - -%{_fixperms} %{buildroot}/* +%{_fixperms} %{buildroot} %check make test %files -%doc Changes LICENSE README -%{perl_vendorlib}/* -%{_mandir}/man3/* +%license LICENSE +%doc Changes README +%{perl_vendorlib}/Eval/ +%{_mandir}/man3/Eval::Closure.3* %changelog +* Wed Nov 12 2014 Paul Howarth - 0.11-1 +- Update to 0.11 + - Support lexical subs on 5.18+ + - Fix pod links + - Add "alias => 1" option for making closure variables actually alias the + closed over variables (so the variable referenced in the environment + hashref will actually be updated by changes made in the closure) +- Classify buildreqs by usage +- Use %%license +- Make %%files list more explicit +- Update %%description +- Don't need to remove empty directories from the buildroot + * Fri Aug 29 2014 Jitka Plesnikova - 0.08-8 - Perl 5.20 rebuild diff --git a/sources b/sources index 7cbdd5b..019c8e0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c2af8abc363fc9a039731be9ecf2985c Eval-Closure-0.08.tar.gz +2172fed13527589d6b4fda2d9f2de2bc Eval-Closure-0.11.tar.gz