File perl-AutoLoader.spec of Package perl-AutoLoader

# spec file for package perl-AutoLoader
# Copyright (c) 2015 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

Name:           perl-AutoLoader
Version:        5.74
Release:        0
%define cpan_name AutoLoader
Summary:        load subroutines only on demand
License:        Artistic-1.0 or GPL-1.0+
Group:          Development/Libraries/Perl
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  perl
BuildRequires:  perl-macros

The *AutoLoader* module works with the *AutoSplit* module and the '__END__'
token to defer the loading of some subroutines until they are used rather
than loading them all at once.

To use *AutoLoader*, the author of a module has to place the definitions of
subroutines to be autoloaded after an '__END__' token. (See the perldata
manpage.) The *AutoSplit* module can then be run manually to extract the
definitions into individual files _auto/funcname.al_.

*AutoLoader* implements an AUTOLOAD subroutine. When an undefined
subroutine in is called in a client module of *AutoLoader*, *AutoLoader*'s
AUTOLOAD subroutine attempts to locate the subroutine in a file with a name
related to the location of the file from which the client module was read.
As an example, if _POSIX.pm_ is located in _/usr/local/lib/perl5/POSIX.pm_,
*AutoLoader* will look for perl subroutines *POSIX* in
_/usr/local/lib/perl5/auto/POSIX/*.al_, where the '.al' file has the same
name as the subroutine, sans package. If such a file exists, AUTOLOAD will
read and evaluate it, thus (presumably) defining the needed subroutine.
AUTOLOAD will then 'goto' the newly defined subroutine.

Once this process completes for a given function, it is defined, so future
calls to the subroutine will bypass the AUTOLOAD mechanism.

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

%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}

%{__make} test


%files -f %{name}.files
%doc Artistic Changes Copying README

openSUSE Build Service is sponsored by