]>
Commit | Line | Data |
---|---|---|
ddbcfdcc | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | # | |
ddbcfdcc | 5 | %define pdir autobox |
6 | Summary: autobox - call methods on native types | |
7 | Summary(pl.UTF-8): autobox - wywoływanie metod na rodzimych typach | |
8 | Name: perl-autobox | |
cb2c0617 | 9 | Version: 2.85 |
39f47649 | 10 | Release: 7 |
ddbcfdcc | 11 | # same as perl |
12 | License: GPL v1+ or Artistic | |
13 | Group: Development/Languages/Perl | |
14 | Source0: http://search.cpan.org/CPAN/authors/id/C/CH/CHOCOLATE/autobox-%{version}.tar.gz | |
cb2c0617 | 15 | # Source0-md5: 9426e71114884f096f71f2e7002310cf |
ddbcfdcc | 16 | URL: http://search.cpan.org/dist/autobox/ |
17 | BuildRequires: perl-devel >= 1:5.8.0 | |
18 | BuildRequires: rpm-perlprov >= 4.1-13 | |
19 | %if %{with tests} | |
20 | BuildRequires: perl-Scope-Guard >= 0.03 | |
21 | %endif | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | The autobox pragma allows methods to be called on integers, floats, | |
26 | strings, arrays, hashes, and code references in exactly the same | |
27 | manner as blessed references. | |
28 | ||
29 | The autoboxing is transparent: boxed values are not blessed into their | |
30 | (user-defined) implementation class (unless the method elects to | |
31 | bestow such a blessing) - they simply use its methods as though they | |
32 | are. | |
33 | ||
34 | The classes (packages) into which the native types are boxed are fully | |
35 | configurable. By default, a method invoked on a non-object is assumed | |
36 | to be defined in a class whose name corresponds to the ref() type of | |
37 | that value - or SCALAR if the value is a non-reference. | |
38 | ||
39 | This mapping can be overriden by passing key/value pairs to the use | |
40 | autobox statement, in which the keys represent native types, and the | |
41 | values their associated classes. | |
42 | ||
43 | As with regular objects, autoboxed values are passed as the first | |
44 | argument of the specified method. Consequently, given a vanilla use | |
45 | autobox: | |
46 | ||
47 | # %description -l pl.UTF-8 | |
48 | # TODO | |
49 | ||
50 | %prep | |
51 | %setup -q -n %{pdir}-%{version} | |
52 | ||
53 | %build | |
54 | %{__perl} Makefile.PL \ | |
55 | INSTALLDIRS=vendor | |
56 | %{__make} \ | |
57 | CC="%{__cc}" \ | |
58 | OPTIMIZE="%{rpmcflags}" | |
59 | ||
60 | %{?with_tests:%{__make} test} | |
61 | ||
62 | %install | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | ||
65 | %{__make} pure_install \ | |
66 | DESTDIR=$RPM_BUILD_ROOT | |
67 | ||
68 | %clean | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %files | |
72 | %defattr(644,root,root,755) | |
73 | %doc Changes README | |
74 | %{perl_vendorarch}/autobox.pm | |
75 | %dir %{perl_vendorarch}/autobox | |
76 | %{perl_vendorarch}/autobox/*.pm | |
77 | %dir %{perl_vendorarch}/auto/autobox | |
ddbcfdcc | 78 | %attr(755,root,root) %{perl_vendorarch}/auto/autobox//*.so |
79 | %{_mandir}/man3/* |