3 %bcond_without tests # do not perform "make test"
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
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
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 %define _noautoreq perl(splice)
26 This function enables intercepting a call to any named function;
27 handlers may be added both before and after the call to the
32 wrap_subs \&before, 'some_func', \&after;
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
39 wrap_subs \&before, 'some_func';
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.
48 wrap_subs \&przed, 'jakas_funkcja', \&po
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ć:
55 wrap_subs \&przed, 'jakas_funkcja';
58 %setup -q -n %{pdir}-%{pnam}-%{version}
61 %{__perl} Makefile.PL \
65 %{?with_tests:%{__make} test}
68 rm -rf $RPM_BUILD_ROOT
71 DESTDIR=$RPM_BUILD_ROOT
74 rm -rf $RPM_BUILD_ROOT
77 %defattr(644,root,root,755)
79 %dir %{perl_vendorlib}/Hook
80 %{perl_vendorlib}/Hook/*.pm