File perl-MooseX-GlobRef.spec of Package perl-MooseX-GlobRef

# spec file for package perl-MooseX-GlobRef
# 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

Name:           perl-MooseX-GlobRef
Version:        0.0701
Release:        0
%define cpan_name MooseX-GlobRef
Summary:        Store a Moose object in glob reference
License:        GPL-1.0+ or Artistic-1.0
Group:          Development/Libraries/Perl
Source:         %{cpan_name}-%{version}.tar.gz
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Module::Build)
BuildRequires:  perl(Moose) >= 0.94
BuildRequires:  perl(Test::Assert)
BuildRequires:  perl(Test::Unit::Lite) >= 0.12
Requires:       perl(Moose) >= 0.94

This module allows to store Moose object in glob reference of file handle.
The class attributes will be stored in hash slot associated with glob
reference. It allows to create a Moose version of the IO::Handle manpage.

The attributes can be accessed directly with following expression:

  my $hashref = \%{*$self};
  print $hashref->{key};

or shorter:

  print *$self->{key};

but the standard accessors should be used instead:

  print $self->key;

%setup -q -n %{cpan_name}-%{version}

%{__perl} Build.PL installdirs=vendor
./Build build flags=%{?_smp_mflags}

./Build test

./Build install destdir=%{buildroot} create_packlist=0

%{__rm} -rf %{buildroot}

%files -f %{name}.files
%doc Changes eg Incompatibilities LICENSE README xt