]>
Commit | Line | Data |
---|---|---|
a9b299f9 | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
5 | %include /usr/lib/rpm/macros.perl | |
6 | %define pdir Module | |
7 | %define pnam Pluggable-Ordered | |
8 | Summary: Module::Pluggable::Ordered - Call module plugins in a specified order | |
9 | #Summary(pl): | |
10 | Name: perl-Module-Pluggable-Ordered | |
11 | Version: 1.4 | |
12 | Release: 1 | |
13 | # same as perl | |
14 | License: GPL v1+ or Artistic | |
15 | Group: Development/Languages/Perl | |
16 | Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz | |
17 | # Source0-md5: a63e0c325b9690680d7ee6ac34e178d0 | |
18 | BuildRequires: perl-devel >= 1:5.8.0 | |
19 | BuildRequires: rpm-perlprov >= 4.1-13 | |
20 | %if %{with tests} | |
21 | BuildRequires: perl-Module-Pluggable >= 1.9 | |
22 | BuildRequires: perl-UNIVERSAL-exports | |
23 | %endif | |
24 | BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | This module behaves exactly the same as C<Module::Pluggable>, supporting | |
29 | all of its options, but also mixes in the C<call_plugins> method to your | |
30 | class. C<call_plugins> acts a little like C<Class::Trigger>; it takes the | |
31 | name of a method, and some parameters. Let's say we call it like so: | |
32 | ||
33 | __PACKAGE__->call_plugins("my_method", @something); | |
34 | ||
35 | C<call_plugins> looks at the plugin modules found using C<Module::Pluggable> | |
36 | for ones which provide C<my_method_order>. It sorts the modules | |
37 | numerically based on the result of this method, and then calls | |
38 | C<$_-E<gt>my_method(@something)> on them in order. This produces an | |
39 | effect a little like the System V init process, where files can specify | |
40 | where in the init sequence they want to be called. | |
41 | ||
42 | # %description -l pl | |
43 | # TODO | |
44 | ||
45 | %prep | |
46 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
47 | ||
48 | %build | |
49 | %{__perl} Makefile.PL \ | |
50 | INSTALLDIRS=vendor | |
51 | %{__make} | |
52 | ||
53 | %{?with_tests:%{__make} test} | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
58 | %{__make} install \ | |
59 | DESTDIR=$RPM_BUILD_ROOT | |
60 | ||
61 | %clean | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %files | |
65 | %defattr(644,root,root,755) | |
66 | %doc Changes | |
67 | %{perl_vendorlib}/Module/Pluggable/*.pm | |
68 | %{_mandir}/man3/* |