# # spec file for package perl-Data-OptList # # Copyright (c) 2023 SUSE LLC # # 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/ # %define cpan_name Data-OptList Name: perl-Data-OptList Version: 0.114 Release: 1.3 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Parse and validate simple name/value option pairs URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/R/RJ/RJBS/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(ExtUtils::MakeMaker) >= 6.78 BuildRequires: perl(Params::Util) BuildRequires: perl(Sub::Install) >= 0.921 BuildRequires: perl(Test::More) >= 0.96 Requires: perl(Params::Util) Requires: perl(Sub::Install) >= 0.921 %{perl_requires} %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 => { ... }, ]; Just look at all those undefs! Don't worry, we can get rid of those: $values = [ map { $_ => undef } qw(foo bar baz), xyz => { ... }, ]; Aaaauuugh! We've saved a little typing, but now it requires thought to read, and thinking is even worse than typing... and it's got a bug! It looked right, didn't it? Well, the 'xyz => { ... }' gets consumed by the map, and we don't get the data we wanted. 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 %autosetup -n %{cpan_name}-%{version} %build perl Makefile.PL INSTALLDIRS=vendor %make_build %check make test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %doc Changes README %license LICENSE %changelog * Sun May 7 2023 Tina Müller - updated to 0.114 see /usr/share/doc/packages/perl-Data-OptList/Changes 0.114 2023-05-06 17:25:36-04:00 America/New_York - Data::OptList now requires perl v5.12.0 - tests no longer add "-T" to shebang, so do not invoke taint mode * Mon Jan 2 2023 Tina Müller - updated to 0.113 see /usr/share/doc/packages/perl-Data-OptList/Changes 0.113 2022-12-31 21:07:47-05:00 America/New_York - update author contact info * Sun Jun 27 2021 Tina Müller - updated to 0.112 see /usr/share/doc/packages/perl-Data-OptList/Changes 0.112 2021-06-26 11:01:31-04:00 America/New_York - no changes since last trial release (0.111) 0.111 2021-06-20 20:55:10-04:00 America/New_York (TRIAL RELEASE) - update author contact info - add perl version support to docs - replace a "goto" deep in the guts with a sub call, for speed (thanks, Olivier Mengué and Graham Knop) * Tue Mar 29 2016 coolo@suse.com - updated to 0.110 see /usr/share/doc/packages/perl-Data-OptList/Changes 0.110 2016-03-24 21:20:54-04:00 America/New_York - major optimization to mkopt (thanks, Olivier Mengué) * Wed Dec 18 2013 coolo@suse.com - updated to 0.109 update bugtracker and repo links * Tue Jul 16 2013 coolo@suse.com - updated to 0.108 repackage, new bug tracker * Fri Mar 16 2012 lars@linux-schulserver.de - remove old_test_more.patch and use sed statement instead (less likely to break with every package update) * Wed Feb 29 2012 ro@suse.de - add old_test_more patch to build with sle11 * Sat Nov 19 2011 coolo@suse.com - update to 0.107 mkopt now prefers named parameters; docs updated added the name_test parameter to mkopt * Tue Nov 30 2010 coolo@novell.com - switch to perl_requires macro * Sun Apr 11 2010 chris@computersalat.de - update to 0.106 * correct version style mismatch for Sub::Install (thanks, brian d foy) - 0.105 2010-01-14 * fix a typo in documenation (thanks, Florian Ragwitz) - removed .packlist, perllocal.pod files > noarch package - cleanup spec o fix HEADER o update License, Url, Source o fix deps - perl-macros deps - perl(Sub::Install) >= 0.921 o update description o macro usage * Sun Jun 21 2009 chris@computersalat.de - initial package 0.104