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