2011-04-03 17:27:59 +02:00
|
|
|
#
|
2011-07-19 15:14:39 +02:00
|
|
|
# spec file for package perl-namespace-autoclean
|
2011-04-03 17:27:59 +02:00
|
|
|
#
|
2011-07-19 15:14:39 +02:00
|
|
|
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-04-03 17:27:59 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2011-07-19 15:14:39 +02:00
|
|
|
|
|
|
|
|
2010-02-09 12:02:06 +01:00
|
|
|
Name: perl-namespace-autoclean
|
2011-11-17 13:38:12 +01:00
|
|
|
Version: 0.13
|
2011-04-03 17:27:59 +02:00
|
|
|
Release: 1
|
2011-12-06 18:44:51 +01:00
|
|
|
License: GPL-1.0+ or Artistic-1.0
|
2011-04-03 17:27:59 +02:00
|
|
|
%define cpan_name namespace-autoclean
|
|
|
|
Summary: Keep imports out of your namespace
|
|
|
|
Url: http://search.cpan.org/dist/namespace-autoclean/
|
2010-02-09 12:02:06 +01:00
|
|
|
Group: Development/Libraries/Perl
|
2011-11-17 13:42:48 +01:00
|
|
|
Source: http://www.cpan.org/authors/id/B/BO/BOBTFISH/%{cpan_name}-%{version}.tar.gz
|
2010-02-09 12:02:06 +01:00
|
|
|
BuildArch: noarch
|
2011-04-03 17:27:59 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-02-09 12:02:06 +01:00
|
|
|
BuildRequires: perl
|
2010-12-03 15:43:59 +01:00
|
|
|
BuildRequires: perl-macros
|
2011-04-03 17:27:59 +02:00
|
|
|
BuildRequires: perl(B::Hooks::EndOfScope)
|
2010-02-09 12:02:06 +01:00
|
|
|
BuildRequires: perl(Class::MOP) >= 0.80
|
2011-04-03 17:27:59 +02:00
|
|
|
BuildRequires: perl(Moose::Role)
|
|
|
|
BuildRequires: perl(namespace::clean) >= 0.20
|
|
|
|
BuildRequires: perl(Sub::Name)
|
2011-11-17 13:42:48 +01:00
|
|
|
#BuildRequires: perl(namespace::autoclean)
|
2011-04-03 17:27:59 +02:00
|
|
|
Requires: perl(B::Hooks::EndOfScope)
|
2010-02-09 12:02:06 +01:00
|
|
|
Requires: perl(Class::MOP) >= 0.80
|
2011-04-03 17:27:59 +02:00
|
|
|
Requires: perl(namespace::clean) >= 0.20
|
|
|
|
%{perl_requires}
|
2010-02-09 12:02:06 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
When you import a function into a Perl package, it will naturally also be
|
|
|
|
available as a method.
|
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
The 'namespace::autoclean' pragma will remove all imported symbols at the
|
|
|
|
end of the current package's compile cycle. Functions called in the package
|
|
|
|
itself will still be bound by their name, but they won't show up as methods
|
|
|
|
on your class or instances.
|
2010-02-09 12:02:06 +01:00
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
This module is very similar to namespace::clean, except it will clean all
|
|
|
|
imported functions, no matter if you imported them before or after you
|
|
|
|
'use'd the pragma. It will also not touch anything that looks like a
|
|
|
|
method, according to 'Class::MOP::Class::get_method_list'.
|
2010-02-09 12:02:06 +01:00
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
If you're writing an exporter and you want to clean up after yourself (and
|
|
|
|
your peers), you can use the '-cleanee' switch to specify what package to
|
|
|
|
clean:
|
|
|
|
|
|
|
|
package My::MooseX::namespace::autoclean;
|
|
|
|
use strict;
|
2010-02-09 12:02:06 +01:00
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
use namespace::autoclean (); # no cleanup, just load
|
2010-02-09 12:02:06 +01:00
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
sub import {
|
|
|
|
namespace::autoclean->import(
|
|
|
|
-cleanee => scalar(caller),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
2010-02-09 12:02:06 +01:00
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
%build
|
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%{__make} %{?_smp_mflags}
|
2010-02-09 12:02:06 +01:00
|
|
|
|
|
|
|
%check
|
2011-04-03 17:27:59 +02:00
|
|
|
%{__make} test
|
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
2010-02-09 12:02:06 +01:00
|
|
|
|
2011-04-03 17:27:59 +02:00
|
|
|
%files -f %{name}.files
|
2011-11-17 13:42:48 +01:00
|
|
|
%defattr(-,root,root,755)
|
2011-04-03 17:27:59 +02:00
|
|
|
%doc Changes LICENSE README
|
2010-02-09 12:02:06 +01:00
|
|
|
|
|
|
|
%changelog
|