3 %bcond_without tests # do not perform "make test"
5 %include /usr/lib/rpm/macros.perl
7 Summary: autobox - call methods on native types
8 Summary(pl.UTF-8): autobox - wywoływanie metod na rodzimych typach
13 License: GPL v1+ or Artistic
14 Group: Development/Languages/Perl
15 Source0: http://search.cpan.org/CPAN/authors/id/C/CH/CHOCOLATE/autobox-%{version}.tar.gz
16 # Source0-md5: 2399312bfffbf91e8fdce306f0357e86
17 URL: http://search.cpan.org/dist/autobox/
18 BuildRequires: perl-devel >= 1:5.8.0
19 BuildRequires: rpm-perlprov >= 4.1-13
21 BuildRequires: perl-Scope-Guard >= 0.03
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 The autobox pragma allows methods to be called on integers, floats,
27 strings, arrays, hashes, and code references in exactly the same
28 manner as blessed references.
30 The autoboxing is transparent: boxed values are not blessed into their
31 (user-defined) implementation class (unless the method elects to
32 bestow such a blessing) - they simply use its methods as though they
35 The classes (packages) into which the native types are boxed are fully
36 configurable. By default, a method invoked on a non-object is assumed
37 to be defined in a class whose name corresponds to the ref() type of
38 that value - or SCALAR if the value is a non-reference.
40 This mapping can be overriden by passing key/value pairs to the use
41 autobox statement, in which the keys represent native types, and the
42 values their associated classes.
44 As with regular objects, autoboxed values are passed as the first
45 argument of the specified method. Consequently, given a vanilla use
48 # %description -l pl.UTF-8
52 %setup -q -n %{pdir}-%{version}
55 %{__perl} Makefile.PL \
59 OPTIMIZE="%{rpmcflags}"
61 %{?with_tests:%{__make} test}
64 rm -rf $RPM_BUILD_ROOT
66 %{__make} pure_install \
67 DESTDIR=$RPM_BUILD_ROOT
70 rm -rf $RPM_BUILD_ROOT
73 %defattr(644,root,root,755)
75 %{perl_vendorarch}/autobox.pm
76 %dir %{perl_vendorarch}/autobox
77 %{perl_vendorarch}/autobox/*.pm
78 %dir %{perl_vendorarch}/auto/autobox
79 %{perl_vendorarch}/auto/autobox//*.bs
80 %attr(755,root,root) %{perl_vendorarch}/auto/autobox//*.so