]> git.pld-linux.org Git - packages/perl-Eval-Closure.git/blob - perl-Eval-Closure.spec
3e8abaa9484d26d06dd3487be0a35da7486fa70e
[packages/perl-Eval-Closure.git] / perl-Eval-Closure.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4 #
5 %define         pdir    Eval
6 %define         pnam    Closure
7 Summary:        Eval::Closure - safely and cleanly create closures via string eval
8 Summary(pl.UTF-8):      Eval::Closure - bezpieczne i czyste tworzenie dopełnień poprzez eval łańcucha
9 Name:           perl-Eval-Closure
10 Version:        0.14
11 Release:        1
12 # same as perl
13 License:        GPL v1+ or Artistic
14 Group:          Development/Languages/Perl
15 Source0:        http://www.cpan.org/modules/by-authors/id/D/DO/DOY/Eval-Closure-%{version}.tar.gz
16 # Source0-md5:  ceeb1fc579ac9af981fa6b600538c285
17 URL:            http://search.cpan.org/dist/Eval-Closure/
18 BuildRequires:  perl-ExtUtils-MakeMaker >= 6.30
19 BuildRequires:  perl-devel >= 1:5.8.0
20 BuildRequires:  rpm-perlprov >= 4.1-13
21 %if %{with tests}
22 BuildRequires:  perl-Test-Fatal
23 BuildRequires:  perl-Test-Requires
24 BuildRequires:  perl-Test-Simple >= 0.88
25 %endif
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 String eval is often used for dynamic code generation. For instance,
31 Moose uses it heavily, to generate inlined versions of accessors and
32 constructors, which speeds code up at runtime by a significant amount.
33 String eval is not without its issues however - it's difficult to
34 control the scope it's used in (which determines which variables are
35 in scope inside the eval), and it's easy to miss compilation errors,
36 since eval catches them and sticks them in $@ instead.
37
38 This module attempts to solve these problems. It provides an
39 eval_closure function, which evals a string in a clean environment,
40 other than a fixed list of specified variables. Compilation errors are
41 rethrown automatically.
42
43 %description -l pl.UTF-8
44 Instrukcja eval na łańcuchu często służy do dynamicznego generowania
45 kodu. Np. Moose wykorzystuje ją intensywnie do generowania
46 wewnętrznych wersji akcesorów i konstruktorów, co znacząco przyspiesza
47 kod w trakcie działania. Użycie eval na łańcuchu nie jest jednak
48 pozbawione wad - jest trudno kontrolować zakres, w jakim jest użyte
49 (co określa, które zmienne są w tym zakresie) i łatwo przeoczyć błędy
50 kompilacji, jako że eval przechwytuje je i umieszcza w $@.
51
52 Niniejszy moduł próbuje rozwiązać te problemy. Dostarcza funkcję
53 eval_closure, która wylicza łańcuch w czystym środowisku, innym niż
54 stała lista określonych zmiennych. Błędy kompilacji są automatyczne
55 wyrzucane ponownie.
56
57 %prep
58 %setup -q -n %{pdir}-%{pnam}-%{version}
59
60 %build
61 %{__perl} Makefile.PL \
62         INSTALLDIRS=vendor
63 %{__make}
64
65 %{?with_tests:%{__make} test}
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69
70 %{__make} pure_install \
71         DESTDIR=$RPM_BUILD_ROOT
72
73 %clean
74 rm -rf $RPM_BUILD_ROOT
75
76 %files
77 %defattr(644,root,root,755)
78 %doc Changes README
79 %{perl_vendorlib}/Eval/Closure.pm
80 %{_mandir}/man3/Eval::Closure.3pm*
This page took 0.113955 seconds and 2 git commands to generate.