File perl-Moose-Autobox.spec of Package perl-Moose-Autobox
#
# spec file for package perl-Moose-Autobox
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: perl-Moose-Autobox
Version: 0.11
Release: 0
%define cpan_name Moose-Autobox
Summary: Autoboxed wrappers for Native Perl datatypes
License: GPL-1.0+ or Artistic-1.0
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Moose-Autobox/
Source: http://www.cpan.org/authors/id/R/RJ/RJBS/Moose-Autobox-%{version}.tar.gz
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Moose) >= 0.42
BuildRequires: perl(Perl6::Junction) >= 1.40000
BuildRequires: perl(Test::Exception) >= 0.21
BuildRequires: perl(autobox) >= 2.23
Requires: perl(autobox) >= 2.23
Requires: perl(Moose) >= 0.42
Requires: perl(Perl6::Junction) >= 1.40000
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%{perl_requires}
%description
Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH & CODE for
use with the autobox manpage. It does this using a hierarchy of roles in a
manner similar to what Perl 6 _might_ do. This module, like the Class::MOP
manpage and the Moose manpage, was inspired by my work on the Perl 6 Object
Space, and the 'core types' implemented there.
A quick word about autobox
The the autobox manpage module provides the ability for calling
'methods' on normal Perl values like Scalars, Arrays, Hashes and Code
references. This gives the illusion that Perl's types are first-class
objects. However, this is only an illusion, albeit a very nice one. I
created this module because the autobox manpage itself does not
actually provide an implementation for the Perl types but instead only
provides the 'hooks' for others to add implementation too.
Is this for real? or just play?
Several people are using this module in serious applications and it
seems to be quite stable. The underlying technologies of the autobox
manpage and the Moose::Role manpage are also considered stable. There
is some performance hit, but as I am fond of saying, nothing in life is
free. If you have any questions regarding this module, either email me,
or stop by #moose on irc.perl.org and ask around.
Adding additional methods
*Moose::Autobox* asks the autobox manpage to use the
*Moose::Autobox::** namespace prefix so as to avoid stepping on the
toes of other the autobox manpage modules. This means that if you want
to add methods to a particular perl type (i.e. - monkeypatch), then you
must do this:
sub Moose::Autobox::SCALAR::bar { 42 }
instead of this:
sub SCALAR::bar { 42 }
as you would with vanilla autobox.
%prep
%setup -q -n %{cpan_name}-%{version}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
%check
%{__make} test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%clean
%{__rm} -rf %{buildroot}
%files -f %{name}.files
%defattr(644,root,root,755)
%doc Changes README
%changelog