]> git.pld-linux.org Git - SPECS.git/blob - perl-Hook-WrapSub.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / perl-Hook-WrapSub.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4 #
5 %define         pdir    Hook
6 %define         pnam    WrapSub
7 Summary:        Hook::WrapSub - wrap subs with pre- and post-call hooks
8 Summary(pl.UTF-8):      Hook::WrapSub - obudowanie procedur w wywołania przed i po wywołaniu
9 Name:           perl-Hook-WrapSub
10 Version:        0.03
11 Release:        2
12 # same as perl
13 License:        GPL v1+ or Artistic
14 Group:          Development/Languages/Perl
15 Source0:        http://www.cpan.org/modules/by-module/Hook/%{pdir}-%{pnam}-%{version}.tar.gz
16 # Source0-md5:  7a5e42aca06d6ba06dcbd5e2cb5769bf
17 URL:            http://search.cpan.org/dist/Hook-WrapSub/
18 BuildRequires:  perl-devel >= 1:5.8.0
19 BuildRequires:  rpm-perlprov >= 4.1-13
20 BuildArch:      noarch
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         _noautoreq      perl(splice)
24
25 %description
26 This function enables intercepting a call to any named function;
27 handlers may be added both before and after the call to the
28 intercepted function.
29
30 For example:
31
32   wrap_subs \&before, 'some_func', \&after;
33
34 In this case, whenever the sub named 'some_func' is called, the
35 &before sub is called first, and the &after sub is called afterwards.
36 These are both optional. If you only want to intercept the call
37 beforehand:
38
39   wrap_subs \&before, 'some_func';
40
41 %description -l pl.UTF-8
42 Ta funkcja umożliwia przechwytywanie wywołania dowolnej nazwanej
43 funkcji; można dodać procedury obsługi zarówno przed jak i po
44 wywołaniu przechwytywanej funkcji.
45
46 Na przykład:
47
48   wrap_subs \&przed, 'jakas_funkcja', \&po
49
50 W tym przypadku, kiedy wywoływana jest 'jakas_funkcja', najpierw
51 wywoływana jest procedura &przed, a procedura &po jest wywoływana po
52 powrocie. Obie są opcjonalne. Aby przechwycić tylko punkt przed
53 wywołaniem można użyć:
54
55   wrap_subs \&przed, 'jakas_funkcja';
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} 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
79 %dir %{perl_vendorlib}/Hook
80 %{perl_vendorlib}/Hook/*.pm
81 %{_mandir}/man3/*
This page took 0.320579 seconds and 3 git commands to generate.