Files
perl-PERLANCAR-Module-List/perl-PERLANCAR-Module-List.spec

126 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.004004
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 a fork of Module::List. It's exactly like Module::List,
except for the following differences:
* * lower startup overhead (with some caveats)
It strips the usage of Exporter (so you cannot import 'list_modules()' and
need to invoke it using fully qualified name), 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