Files
perl-PERLANCAR-Module-List/perl-PERLANCAR-Module-List.spec
Lars Vogdt fea68aad88 Accepting request 745156 from devel:languages:perl:autoupdate
- updated to 0.004005
   see /usr/share/doc/packages/perl-PERLANCAR-Module-List/Changes
  0.004005  2019-09-12  Released-By: PERLANCAR; Urgency: medium
  
  	  - [doc] Mention Module::List::Tiny, Module::List::Wildcard.
  
  	  - Add import() to be able to be imported like Module:List &
  	    Module::List::Tiny.

OBS-URL: https://build.opensuse.org/request/show/745156
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-PERLANCAR-Module-List?expand=0&rev=4
2019-11-04 20:56:56 +00:00

127 lines
3.6 KiB
RPMSpec

#
# spec file for package perl-PERLANCAR-Module-List
#
# 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-PERLANCAR-Module-List
Version: 0.004005
Release: 0
%define cpan_name PERLANCAR-Module-List
Summary: Fork of Module::List
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/P/PE/PERLANCAR/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(File::Slurper)
BuildRequires: perl(Test::More) >= 0.98
Recommends: perl(String::Wildcard::Bash) >= 0.040
%{perl_requires}
%description
This module is my personal experimental fork of Module::List; the
experiment has also produced other forks like Module::List::Tiny,
Module::List::Wildcard. It's like Module::List, except for the following
differences:
* * lower startup overhead (with some caveats)
It avoids using Exporter and implements its own import(). It avoids
IO::Dir, Carp, File::Spec, with the goal of saving a few milliseconds (a
casual test on my PC results in 11ms vs 39ms).
Path separator is hard-coded as '/'.
* * Recognize 'all' option
If set to true and 'return_path' is also set to true, will return all found
paths for each module instead of just the first found one. The values of
result will be an arrayref containing all found paths.
* * Recognize 'wildcard' option
This boolean option can be set to true to recognize wildcard pattern in
prefix. Wildcard patterns such as jokers ('?', '*', '**'), classes
('[a-z]'), as well as braces ('{One,Two}') are supported. '**' implies
recursive listing.
Examples:
list_modules("Module::P*", {wildcard=>1, list_modules=>1});
results in something like:
{
"Module::Patch" => undef,
"Module::Path" => undef,
"Module::Pluggable" => undef,
}
while:
list_modules("Module::P**", {wildcard=>1, list_modules=>1});
results in something like:
{
"Module::Patch" => undef,
"Module::Path" => undef,
"Module::Path::More" => undef,
"Module::Pluggable" => undef,
"Module::Pluggable::Object" => undef,
}
while:
list_modules("Module::**le", {wildcard=>1, list_modules=>1});
results in something like:
{
"Module::Depakable" => undef,
"Module::Install::Admin::Bundle" => undef,
"Module::Install::Admin::Makefile" => undef,
"Module::Install::Bundle" => undef,
"Module::Install::Makefile" => undef,
"Module::Pluggable" => undef,
}
%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
%license LICENSE
%changelog