]> git.pld-linux.org Git - packages/perl-Context-Preserve.git/blob - perl-Context-Preserve.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/perl-Context-Preserve.git] / perl-Context-Preserve.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4 #
5 %define         pdir    Context
6 %define         pnam    Preserve
7 Summary:        Context::Preserve - run code after a subroutine call, preserving the context the subroutine would have seen if it were the last statement in the caller
8 #Summary(pl.UTF-8):     
9 Name:           perl-Context-Preserve
10 Version:        0.01
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/J/JR/JROCKWAY/Context-Preserve-0.01.tar.gz
16 # Source0-md5:  e28c24d9e85d3f7de1c7b9a545ba991a
17 URL:            http://search.cpan.org/dist/Context-Preserve/
18 BuildRequires:  perl-devel >= 1:5.8.0
19 BuildRequires:  rpm-perlprov >= 4.1-13
20 %if %{with tests}
21 BuildRequires:  perl-Test-Exception
22 BuildRequires:  perl-Test-use-ok
23 %endif
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 Sometimes you need to call a function, get the results, act on the
29 results, then return the result of the function.  This is painful
30 because of contexts; the original function can behave different if
31 it's called in void, scalar, or list context.  You can ignore the
32 various cases and just pick one, but that's fragile.  To do things
33 right, you need to see which case you're being called in, and then
34 call the function in that context.  This results in 3 code paths,
35 which is a pain to type in (and maintain).
36
37 This module automates the process.  You provide a coderef that is the
38 "original function", and another coderef to run after the original
39 runs.  You can modify the return value (aliased to @_) here, and do
40 whatever else you need to do.  wantarray is correct inside both
41 coderefs; in "after", though, the return value is ignored and the
42 value wantarray returns is related to the context that the original
43 function was called in.
44
45 # %description -l pl.UTF-8
46 # TODO
47
48 %prep
49 %setup -q -n %{pdir}-%{pnam}-%{version}
50
51 %build
52 %{__perl} Makefile.PL \
53         INSTALLDIRS=vendor
54 %{__make}
55
56 %{?with_tests:%{__make} test}
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60
61 %{__make} pure_install \
62         DESTDIR=$RPM_BUILD_ROOT
63
64 %clean
65 rm -rf $RPM_BUILD_ROOT
66
67 %files
68 %defattr(644,root,root,755)
69 %doc Changes README
70 %dir %{perl_vendorlib}/Context
71 %{perl_vendorlib}/Context/Preserve.pm
72 %{_mandir}/man3/*
This page took 0.075597 seconds and 4 git commands to generate.