]>
Commit | Line | Data |
---|---|---|
11ae5139 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
5 | %define pdir Class | |
6 | %define pnam Load | |
11ae5139 JB |
7 | Summary: Class::Load - a working (require "Class::Name") and more |
8 | Summary(pl.UTF-8): Class::Load - działające (require "Klasa::Nazwa") i inne | |
9 | Name: perl-Class-Load | |
975135e3 | 10 | Version: 0.25 |
11ae5139 JB |
11 | Release: 1 |
12 | # same as perl | |
13 | License: GPL v1+ or Artistic | |
14 | Group: Development/Languages/Perl | |
79c824dc | 15 | Source0: http://www.cpan.org/modules/by-module/Class/%{pdir}-%{pnam}-%{version}.tar.gz |
975135e3 | 16 | # Source0-md5: e4c831c08df592ce8dfee0c7cfc12fd7 |
11ae5139 | 17 | URL: http://search.cpan.org/dist/Class-Load/ |
96ab70a5 | 18 | BuildRequires: perl-ExtUtils-MakeMaker >= 6.30 |
11ae5139 JB |
19 | BuildRequires: perl-devel >= 1:5.8.0 |
20 | BuildRequires: rpm-perlprov >= 4.1-13 | |
21 | %if %{with tests} | |
fb17f18c | 22 | BuildRequires: perl-Data-OptList |
96ab70a5 JB |
23 | BuildRequires: perl-Module-Implementation >= 0.04 |
24 | BuildRequires: perl-Module-Runtime >= 0.012 | |
25 | BuildRequires: perl-Package-Stash >= 0.14 | |
fb17f18c | 26 | BuildRequires: perl-Scalar-List-Utils |
11ae5139 | 27 | BuildRequires: perl-Test-Fatal |
96ab70a5 JB |
28 | BuildRequires: perl-Test-Requires |
29 | BuildRequires: perl-Test-Simple >= 0.88 | |
30 | BuildRequires: perl-Try-Tiny | |
21fca0b3 | 31 | BuildRequires: perl-version |
11ae5139 JB |
32 | %endif |
33 | BuildArch: noarch | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | require EXPR only accepts Class/Name.pm style module names, not | |
38 | Class::Name. How frustrating! For that, we provide load_class | |
39 | 'Class::Name'. | |
40 | ||
41 | It's often useful to test whether a module can be loaded, instead of | |
42 | throwing an error when it's not available. For that, we provide | |
43 | try_load_class 'Class::Name'. | |
44 | ||
45 | Finally, sometimes we need to know whether a particular class has been | |
46 | loaded. Asking %%INC is an option, but that will miss inner packages | |
47 | and any class for which the filename does not correspond to the | |
48 | package name. For that, we provide is_class_loaded 'Class::Name'. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | require EXPR przyjmuje tylko nazwy modułów w stylu Klasa/Nazwa.pm, a | |
52 | nie Klasa::Nazwa - jest to frustrujące. Dlatego moduł ten udostępnia | |
53 | funkcję load_class 'Klasa::Nazwa'. | |
54 | ||
55 | Często przydaje się sprawdzić, czy moduł może być załadowany, zamiast | |
56 | rzucania błędu, kiedy jest niedostępny. Dlatego modułu ten udostępnia | |
57 | funkcję try_load_class 'Klasa::Nazwa'. | |
58 | ||
59 | W końcu - czasem trzeba sprawdzić, czy dana klasa została załadowana. | |
60 | Sprawdzanie %%INC jest jakąś opcją, ale pominie pakiety i klasy, dla | |
61 | których nazwa pliku nie zgadza się z nazwą pakietu. Dlatego moduł ten | |
62 | udostępnia funkcję is_class_loaded 'Klasa::Nazwa'. | |
63 | ||
64 | %prep | |
65 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
66 | ||
67 | %build | |
68 | %{__perl} Makefile.PL \ | |
69 | INSTALLDIRS=vendor | |
70 | %{__make} | |
71 | ||
72 | %{?with_tests:%{__make} test} | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %{__make} pure_install \ | |
78 | DESTDIR=$RPM_BUILD_ROOT | |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %files | |
84 | %defattr(644,root,root,755) | |
fb17f18c | 85 | %doc Changes README |
11ae5139 | 86 | %{perl_vendorlib}/Class/Load.pm |
dba777b1 | 87 | %{perl_vendorlib}/Class/Load |
11ae5139 | 88 | %{_mandir}/man3/Class::Load.3pm* |