3 %bcond_without tests # do not perform "make test"
6 Summary: autobox - call methods on native types
7 Summary(pl.UTF-8): autobox - wywoływanie metod na rodzimych typach
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
15 # Source0-md5: 9426e71114884f096f71f2e7002310cf
16 URL: http://search.cpan.org/dist/autobox/
17 BuildRequires: perl-devel >= 1:5.8.0
18 BuildRequires: rpm-perlprov >= 4.1-13
20 BuildRequires: perl-Scope-Guard >= 0.03
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
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
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.
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.
43 As with regular objects, autoboxed values are passed as the first
44 argument of the specified method. Consequently, given a vanilla use
47 # %description -l pl.UTF-8
51 %setup -q -n %{pdir}-%{version}
54 %{__perl} Makefile.PL \
58 OPTIMIZE="%{rpmcflags}"
60 %{?with_tests:%{__make} test}
63 rm -rf $RPM_BUILD_ROOT
65 %{__make} pure_install \
66 DESTDIR=$RPM_BUILD_ROOT
69 rm -rf $RPM_BUILD_ROOT
72 %defattr(644,root,root,755)
74 %{perl_vendorarch}/autobox.pm
75 %dir %{perl_vendorarch}/autobox
76 %{perl_vendorarch}/autobox/*.pm
77 %dir %{perl_vendorarch}/auto/autobox
78 %attr(755,root,root) %{perl_vendorarch}/auto/autobox//*.so