perl-Text-ParseWords/perl-Text-ParseWords.spec

76 lines
2.6 KiB
RPMSpec
Raw Normal View History

2022-10-24 17:23:09 +08:00
%define mod_name Text-ParseWords
Name: perl-%{mod_name}
2019-09-30 11:13:27 -04:00
Version: 3.30
2022-10-24 17:23:09 +08:00
Release: 420
2019-09-30 11:13:27 -04:00
Summary: Parse text into an array of tokens or array of arrays
License: GPL+ or Artistic
2022-10-24 17:23:09 +08:00
URL: https://metacpan.org/release/%{mod_name}
Source0: https://cpan.metacpan.org/authors/id/C/CH/CHORNY/%{mod_name}-%{version}.tar.gz
2019-09-30 11:13:27 -04:00
BuildArch: noarch
BuildRequires: perl-interpreter perl-generators
BuildRequires: perl(ExtUtils::MakeMaker) perl(Test::More)
Requires: perl(Carp)
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%description
The &nested_quotewords() and &quotewords() functions accept a delimiter (which
can be a regular expression) and a list of lines and then breaks those lines up
into a list of words ignoring delimiters that appear inside quotes. &quotewords()
returns all of the tokens in a single long list, while &nested_quotewords()
returns a list of token lists corresponding to the elements of @lines.
&parse_line() does tokenizing on a single string. The &*quotewords() functions
simply call &parse_line(), so if you're only splitting one line you can call
&parse_line() directly and save a function call.
The $keep argument is a boolean flag. If true, then the tokens are split on the
specified delimiter, but all other characters (including quotes and backslashes)
are kept in the tokens. If $keep is false then the &*quotewords() functions
remove all quotes and backslashes that are not themselves backslash-escaped or
inside of single quotes (i.e., &quotewords() tries to interpret these characters
just like the Bourne shell). NB: these semantics are significantly different
from the original version of this module shipped with Perl 5.000 through 5.004.
As an additional feature, $keep may be the keyword "delimiters" which causes the
functions to preserve the delimiters in each string as tokens in the token lists,
in addition to preserving quote and backslash characters.
%package help
Summary: Doc files for %{name}
Buildarch: noarch
requires: man
%description help
The %{name}-help package contains doc files for %{name}.
%prep
2022-10-24 17:23:09 +08:00
%setup -q -n %{mod_name}-%{version}
2019-09-30 11:13:27 -04:00
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%install
make pure_install DESTDIR=%{buildroot} NO_PACKLIST=1
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
%{_fixperms} %{buildroot}
%check
make test
%files
%{perl_vendorlib}/*
%files help
%doc CHANGES README
%{_mandir}/man3/*
%changelog
2022-10-24 17:23:09 +08:00
* Mon Oct 24 2022 hongjinghao <hongjinghao@huawei.com> - 3.30-420
- add mod_name macro
2019-09-30 11:13:27 -04:00
* Tue Sep 17 2019 luhuaxin <luhuaxin@huawei.com> - 3.30-419
- Fix bug: Add buildrequire perl-generators
* Wed Sep 11 2019 luhuaxin <luhuaxin@huawei.com> - 3.30-418
- Package init