]>
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 | |
0bf75ff4 | 8 | Summary: Module::Pluggable::Ordered - call module plugins in a specified order |
1c41d035 | 9 | Summary(pl.UTF-8): Module::Pluggable::Ordered - wywoływanie modułów-wtyczek w zadanej kolejności |
a9b299f9 | 10 | Name: perl-Module-Pluggable-Ordered |
7dc4f0c3 | 11 | Version: 1.5 |
12 | Release: 1 | |
a9b299f9 | 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 | |
7dc4f0c3 | 17 | # Source0-md5: a9a33859fa3ff61a845035d44a2f73e8 |
a9b299f9 | 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 | |
e2882196 | 22 | BuildRequires: perl-UNIVERSAL-require |
a9b299f9 | 23 | %endif |
3dbb8fee | 24 | Requires: perl-dirs >= 1.0-5 |
a9b299f9 | 25 | BuildArch: noarch |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
0bf75ff4 | 29 | This module behaves exactly the same as Module::Pluggable, supporting |
30 | all of its options, but also mixes in the call_plugins method to your | |
31 | class. call_plugins acts a little like Class::Trigger; it takes the | |
a9b299f9 | 32 | name of a method, and some parameters. Let's say we call it like so: |
33 | ||
3dbb8fee | 34 | __PACKAGE__->call_plugins("my_method", @something); |
a9b299f9 | 35 | |
01cf0f46 | 36 | call_plugins looks at the plugin modules found using Module::Pluggable |
0bf75ff4 | 37 | for ones which provide my_method_order. It sorts the modules |
a9b299f9 | 38 | numerically based on the result of this method, and then calls |
0bf75ff4 | 39 | $my_method(@something) on them in order. This produces an effect a |
01cf0f46 JB |
40 | little like the System V init process, where files can specify where |
41 | in the init sequence they want to be called. | |
a9b299f9 | 42 | |
268b83e5 JR |
43 | %description -l pl.UTF-8 |
44 | Ten moduł zachowuje się dokładnie tak samo jak Module::Pluggable, | |
45 | obsługując wszystkie jego opcje, ale dodatkowo włącza do klasy metodę | |
46 | call_plugins. call_plugins zachowuje się jak Class::Trigger; przyjmuje | |
47 | nazwę metody i parametry. W przypadku wywołania powiedzmy: | |
01cf0f46 | 48 | |
3dbb8fee | 49 | __PACKAGE__->call_plugins("my_method", @something); |
01cf0f46 | 50 | |
268b83e5 JR |
51 | call_plugins przeszukuje moduły wtyczek znalezione przy użyciu |
52 | Module::Pluggable pod kątem tych, które dostarczają my_method_order. | |
53 | Sortuje moduły liczbowo w oparciu o wynik tej metody i wywołuje po | |
54 | kolei na nich $my_method(@something). Daje to efekt podobny trochę do | |
55 | procesu inicjalizacji Systemu V, gdzie pliki mogą określić sekwencję | |
56 | startową, w jakiej mają być wywoływane. | |
a9b299f9 | 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 | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %{__make} install \ | |
72 | DESTDIR=$RPM_BUILD_ROOT | |
73 | ||
74 | %clean | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc Changes | |
80 | %{perl_vendorlib}/Module/Pluggable/*.pm | |
81 | %{_mandir}/man3/* |