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
|
|
|
#
|
2019-08-26 13:47:47 +02:00
|
|
|
# Copyright (c) 2019 SUSE LINUX 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.
|
|
|
|
|
2019-08-26 13:47:47 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-04-03 17:27:59 +02:00
|
|
|
#
|
|
|
|
|
2011-07-19 15:14:39 +02:00
|
|
|
|
2010-02-09 12:02:06 +01:00
|
|
|
Name: perl-namespace-autoclean
|
2019-08-26 13:47:47 +02:00
|
|
|
Version: 0.29
|
2013-11-25 10:16:14 +01:00
|
|
|
Release: 0
|
2011-04-03 17:27:59 +02:00
|
|
|
%define cpan_name namespace-autoclean
|
|
|
|
Summary: Keep imports out of your namespace
|
2019-08-26 13:47:47 +02:00
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2010-02-09 12:02:06 +01:00
|
|
|
Group: Development/Libraries/Perl
|
2019-08-26 13:47:47 +02:00
|
|
|
Url: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz
|
2015-06-09 09:46:35 +02:00
|
|
|
Source1: cpanspec.yml
|
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
|
2013-11-25 10:16:14 +01:00
|
|
|
BuildRequires: perl(B::Hooks::EndOfScope) >= 0.12
|
2014-07-19 14:13:37 +02:00
|
|
|
BuildRequires: perl(Sub::Identify)
|
2015-02-06 14:49:54 +01:00
|
|
|
BuildRequires: perl(Test::More) >= 0.88
|
2019-08-26 13:47:47 +02:00
|
|
|
BuildRequires: perl(Test::Needs)
|
2013-11-25 10:16:14 +01:00
|
|
|
BuildRequires: perl(namespace::clean) >= 0.20
|
|
|
|
Requires: perl(B::Hooks::EndOfScope) >= 0.12
|
2014-07-19 14:13:37 +02:00
|
|
|
Requires: perl(Sub::Identify)
|
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
|
2015-02-06 14:49:54 +01:00
|
|
|
method.
|
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
|
2019-08-26 13:47:47 +02:00
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
make %{?_smp_mflags}
|
2010-02-09 12:02:06 +01:00
|
|
|
|
|
|
|
%check
|
2019-08-26 13:47:47 +02:00
|
|
|
make test
|
2011-04-03 17:27:59 +02:00
|
|
|
|
|
|
|
%install
|
2015-09-10 14:50:30 +02:00
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2011-04-03 17:27:59 +02:00
|
|
|
%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)
|
2019-08-26 13:47:47 +02:00
|
|
|
%doc Changes CONTRIBUTING README
|
|
|
|
%license LICENCE
|
2010-02-09 12:02:06 +01:00
|
|
|
|
|
|
|
%changelog
|