%if ! (0%{?rhel}) # Run extra test %bcond_without perl_Data_OptList_enables_extra_test # Run optional test %bcond_without perl_Data_OptList_enables_optional_test %else %bcond_with perl_Data_OptList_enables_extra_test %bcond_with perl_Data_OptList_enables_optional_test %endif Name: perl-Data-OptList Version: 0.112 Release: 2%{?org_tag}%{?dist} Summary: Parse and validate simple name/value option pairs License: GPL+ or Artistic Group: Development/Libraries URL: http://search.cpan.org/dist/Data-OptList/ Source0: http://www.cpan.org/authors/id/R/RJ/RJBS/Data-OptList-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Module Build BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-interpreter BuildRequires: perl-generators BuildRequires: perl(ExtUtils::MakeMaker) >= 6.78 # Module Runtime BuildRequires: perl(Params::Util) >= 0.14 BuildRequires: perl(List::Util) BuildRequires: perl(strict) BuildRequires: perl(Sub::Install) >= 0.921 BuildRequires: perl(warnings) # Test Suite BuildRequires: perl(File::Spec) BuildRequires: perl(Test::More) >= 0.96 %if %{with perl_Data_OptList_enables_optional_test} # Optional Tests BuildRequires: perl(CPAN::Meta) >= 2.120900 BuildRequires: perl(CPAN::Meta::Prereqs) %endif %if %{with perl_Data_OptList_enables_extra_test} # Extra Tests BuildRequires: perl(Test::Pod) >= 1.41 %endif # Dependencies Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) Requires: perl(List::Util) Requires: perl(Params::Util) >= 0.14 Requires: perl(Sub::Install) >= 0.921 %description Hashes are great for storing named data, but if you want more than one entry for a name, you have to use a list of pairs. Even then, this is really boring to write: $values = [ foo => undef, bar => undef, baz => undef, xyz => { ... }, ]; With Data::OptList, you can do this instead: $values = Data::OptList::mkopt([ qw(foo bar baz), xyz => { ... }, ]); This works by assuming that any defined scalar is a name and any reference following a name is its value. %prep %setup -q -n Data-OptList-%{version} %build %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install rm -rf %{buildroot} make pure_install PERL_INSTALL_ROOT=%{buildroot} find %{buildroot} -type f -name .packlist -exec rm -f {} \; find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \; %{_fixperms} %{buildroot}/* %check make test %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc Changes LICENSE README %{perl_vendorlib}/* %{_mandir}/man3/* %changelog * Thu Jan 23 2025 Jean-Philippe Pialasse 0.112-2.sme - import to SME11 * Tue Jun 29 2021 Gavin Carr 0.112-1 - Update to version 0.112. * Thu Jul 07 2011 Gavin Carr 0.107-1 - Update to 0.107. * Fri Feb 04 2011 Gavin Carr 0.106-1 - Specfile autogenerated by cpanspec 1.78.