]>
Commit | Line | Data |
---|---|---|
08cb4faa | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
08cb4faa | 5 | %define pdir UNIVERSAL |
6 | %define pnam require | |
7 | Summary: UNIVERSAL::require - require() modules from a variable | |
4a16e791 | 8 | Summary(pl.UTF-8): UNIVERSAL::require - wymaganie modułów ze zmiennej |
08cb4faa | 9 | Name: perl-UNIVERSAL-require |
7056c3ee | 10 | Version: 0.19 |
b8334e6d | 11 | Release: 1 |
08cb4faa | 12 | # same as perl |
13 | License: GPL v1+ or Artistic | |
14 | Group: Development/Languages/Perl | |
394119d6 | 15 | Source0: http://www.cpan.org/modules/by-module/UNIVERSAL/%{pdir}-%{pnam}-%{version}.tar.gz |
7056c3ee | 16 | # Source0-md5: d0fbbc0eda9bcdc4c77a0f4f1a2bffec |
394119d6 | 17 | URL: http://search.cpan.org/dist/UNIVERSAL-require/ |
08cb4faa | 18 | BuildRequires: perl-devel >= 1:5.8.0 |
19 | BuildRequires: rpm-perlprov >= 4.1-13 | |
c0e6a372 | 20 | Conflicts: perl-UNIVERSAL-exports < 0.03-3 |
08cb4faa | 21 | BuildArch: noarch |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | If you've ever had to do this... | |
26 | ||
c0e6a372 | 27 | eval "require $module"; |
08cb4faa | 28 | |
29 | to get around the bareword caveats on require(), this module is for | |
c0e6a372 ER |
30 | you. It creates a universal require() class method that will work with |
31 | every Perl module and it's secure. So instead of doing some arcane | |
32 | eval() work, you can do this: | |
33 | ||
34 | $module->require; | |
08cb4faa | 35 | |
90f3e569 JR |
36 | %description -l pl.UTF-8 |
37 | Jeśli kiedykolwiek było nam potrzebne... | |
a77b170c | 38 | |
c0e6a372 | 39 | eval "require $module"; |
a77b170c | 40 | |
90f3e569 JR |
41 | do obejścia przeciwności require(), ten moduł jest dla nas. Tworzy |
42 | uniwersalną metodę klasy require() działającą z każdym modułem Perla, | |
43 | a jednocześnie bezpieczną. Czyli zamiast wykonywania jakichś tajemnych | |
44 | działań z eval(), można zrobić: | |
a77b170c | 45 | |
c0e6a372 | 46 | $module->require; |
08cb4faa | 47 | |
48 | %prep | |
49 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
50 | ||
51 | %build | |
52 | %{__perl} Makefile.PL \ | |
53 | INSTALLDIRS=vendor | |
54 | %{__make} | |
55 | ||
56 | %{?with_tests:%{__make} test} | |
57 | ||
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
61 | %{__make} install \ | |
62 | DESTDIR=$RPM_BUILD_ROOT | |
63 | ||
64 | %clean | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | ||
67 | %files | |
68 | %defattr(644,root,root,755) | |
69 | %doc Changes | |
70 | %{perl_vendorlib}/UNIVERSAL/*.pm | |
71 | %{_mandir}/man3/* |