# # spec file for package perl-namespace-autoclean # # Copyright (c) 2019 SUSE LINUX 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 https://bugs.opensuse.org/ # Name: perl-namespace-autoclean Version: 0.29 Release: 1.3 %define cpan_name namespace-autoclean Summary: Keep imports out of your namespace License: Artistic-1.0 OR GPL-1.0-or-later Group: Development/Libraries/Perl Url: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(B::Hooks::EndOfScope) >= 0.12 BuildRequires: perl(Sub::Identify) BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Test::Needs) BuildRequires: perl(namespace::clean) >= 0.20 Requires: perl(B::Hooks::EndOfScope) >= 0.12 Requires: perl(Sub::Identify) Requires: perl(namespace::clean) >= 0.20 %{perl_requires} %description When you import a function into a Perl package, it will naturally also be available as a method. 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. 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. 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; use namespace::autoclean (); # no cleanup, just load sub import { namespace::autoclean->import( -cleanee => scalar(caller), ); } %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 %files -f %{name}.files %defattr(-,root,root,755) %doc Changes CONTRIBUTING README %license LICENCE %changelog * Sun Aug 25 2019 Stephan Kulow - updated to 0.29 see /usr/share/doc/packages/perl-namespace-autoclean/Changes 0.29 2019-08-24 17:07:22Z - switch from Test::Requires to Test::Needs - report on the installed versions of more optional modules * Fri Oct 16 2015 coolo@suse.com - updated to 0.28 see /usr/share/doc/packages/perl-namespace-autoclean/Changes 0.28 2015-10-13 01:25:26Z - skip failing tests with old Moo or when Sub::Util is broken (RT#107643) * Thu Sep 10 2015 coolo@suse.com - updated to 0.27 see /usr/share/doc/packages/perl-namespace-autoclean/Changes 0.27 2015-09-09 02:29:20Z - package with only ExtUtils::MakeMaker to ease installation on perl 5.6 * Sun Jun 7 2015 coolo@suse.com - updated to 0.26 see /usr/share/doc/packages/perl-namespace-autoclean/Changes 0.26 2015-06-07 02:53:17Z - mark all Mouse tests as TODO below perl 5.010, to enable installation despite apparent instability issues (see RT#101825) 0.25 2015-06-03 01:09:06Z - load Moo::Role earlier in a test, to make a potential misconfiguration more visible * Fri Feb 6 2015 coolo@suse.com - updated to 0.24 - re-release to fix problematic $VERSION declaration (RT#101095) 0.23 2014-12-27 04:07:03Z - be more lenient in optional Mouse tests to handle edge cases in older and pure perl versions 0.22 2014-11-04 06:19:54Z - fix an erroneous change in 0.21 0.21 2014-11-04 05:24:36Z - drop testing of MooseX::MarkAsMethods, now that Moose 2.1400 has better overload handling 0.20 2014-09-06 23:04:12Z - Moose earlier than 2.0300 had a broken ->does method, which called methods on a class's meta when it might not be initialized (RT#98424) * Sat Jul 19 2014 rpm@scorpio-it.net - update to 0.19 - more comprehensive testing with Moo/Mouse/Moose - fixed cleaning of constants - 0.18 2014-06-14 20:12:59Z - better method detection for Mouse (github #4, Graham Knop) - 0.17 2014-06-10 20:13:14Z - Add -except to import options. This allows you to explicitly not clean a sub. (Dave Rolsky) - 0.16 2014-05-27 04:50:22Z (TRIAL RELEASE) - Changed the code to no longer _require_ Class::MOP. If your class is not a Moose class then we don't load Class::MOP. This was particularly problematic for Moo classes. Using namespace::autoclean with a Moo class "upgraded" it to be a Moose class. - Using this module just broke overloading in a class. Reported by Chris Weyl. (RT#50938) * Sun Feb 9 2014 coolo@suse.com - updated to 0.15 - update configure_requires checking in Makefile.PL, add CONTRIBUTING file * Mon Nov 25 2013 coolo@suse.com - updated to 0.14 * bump dependency on B::Hooks::EndOfScope, to get the separation of pure-perl and XS components (RT#89245) * repository migrated to the github moose organization * Thu Nov 17 2011 coolo@suse.com - update to 0.13 * Fix issue in dist.ini which was causing links to be incorrectly generated. * Re-package to remove BEGIN { $VERSION hackery by using a newer Dist-Zilla. * Sun Apr 3 2011 coolo@novell.com - updated to 0.12 * Bump namespace::clean dep to 0.20 to pull in the bugfix for Package::Stash::XS 0.19 * Sat Jan 22 2011 coolo@novell.com - update to 0.11 * Improve distribution metadata. * Fix documentation typo ( Andrew Rodland). * Wed Dec 1 2010 coolo@novell.com - switch to perl_requires macro * Wed Oct 13 2010 coolo@novell.com - fix test suite