# # spec file for package perl-Data-OptList # # Copyright (c) 2016 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 http://bugs.opensuse.org/ # Name: perl-Data-OptList Version: 0.110 Release: 36.15 %define cpan_name Data-OptList Summary: Parse and Validate Simple Name/Value Option Pairs License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Data-OptList/ Source0: http://www.cpan.org/authors/id/R/RJ/RJBS/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros 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 %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 LICENSE README %changelog * 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