# # spec file for package perl-Exporter-Lite # # Copyright (c) 2016 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 http://bugs.opensuse.org/ # Name: perl-Exporter-Lite Version: 0.08 Release: 1.11 %define cpan_name Exporter-Lite Summary: Lightweight Exporting of Functions and Variables License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Exporter-Lite/ Source0: http://www.cpan.org/authors/id/N/NE/NEILB/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros %{perl_requires} %description Exporter::Lite is an alternative to Exporter, intended to provide a lightweight subset of the most commonly-used functionality. It supports 'import()', '@EXPORT' and '@EXPORT_OK' and not a whole lot else. Unlike Exporter, it is not necessary to inherit from Exporter::Lite; Ie you don't need to write: @ISA = qw(Exporter::Lite); Exporter::Lite simply exports its import() function into your namespace. This might be called a "mix-in" or a "role". Setting up a module to export its variables and functions is simple: package My::Module; use Exporter::Lite; our @EXPORT = qw($Foo bar); Functions and variables listed in the '@EXPORT' package variable are automatically exported if you use the module and don't explicitly list any imports. Now, when you 'use My::Module', '$Foo' and 'bar()' will show up. Optional exports are listed in the '@EXPORT_OK' package variable: package My::Module; use Exporter::Lite; our @EXPORT_OK = qw($Foo bar); When My::Module is used, '$Foo' and 'bar()' will _not_ show up, unless you explicitly ask for them: use My::Module qw($Foo bar); Note that when you specify one or more functions or variables to import, then you must also explicitly list any of the default symbols you want to use. So if you have an exporting module: package Games; our @EXPORT = qw/ pacman defender /; our @EXPORT_OK = qw/ galaga centipede /; Then if you want to use both 'pacman' and 'galaga', then you'd write: use Games qw/ pacman galaga /; %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 README %changelog * Wed Jan 20 2016 coolo@suse.com - updated to 0.08 see /usr/share/doc/packages/perl-Exporter-Lite/Changes 0.08 2016-01-13 - Fixed typo in name of Constant::Export::Lazy in SEE ALSO. MANWAR++ - Simplified Makefile.PL * Wed Nov 11 2015 coolo@suse.com - updated to 0.07 see /usr/share/doc/packages/perl-Exporter-Lite/Changes 0.07 2015-10-09 - Updated github repo URL after changing my github username * Tue Apr 14 2015 coolo@suse.com - updated to 0.06 see /usr/share/doc/packages/perl-Exporter-Lite/Changes * Thu Jul 14 2011 coolo@novell.com - updated to 0.02 * Tue Nov 30 2010 coolo@novell.com - switch to perl_requires macro * Mon Nov 29 2010 coolo@novell.com - remove /var/adm/perl-modules * Mon Nov 29 2010 coolo@novell.com - called spec2changelog * Tue Jun 20 2006 jfunk@funktronics.ca - Build under build service * Fri Nov 11 2005 jfunk@funktronics.ca - Build for SL10 * Thu May 12 2005 jfunk@funktronics.ca - Build for SL93 * Fri Nov 19 2004 jfunk@funktronics.ca - Build for SL92 * Tue May 11 2004 jfunk@funktronics.ca - Initial release