d0e3cfcf9e
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Data-OptList?expand=0&rev=00c2d49ced9b623bb41df6de186ff0a5
108 lines
3.0 KiB
RPMSpec
108 lines
3.0 KiB
RPMSpec
#
|
|
# spec file for package perl-Data-OptList
|
|
#
|
|
# Copyright (c) 2011 SUSE LINUX Products 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/
|
|
#
|
|
|
|
# norootforbuild
|
|
|
|
|
|
Name: perl-Data-OptList
|
|
%define cpan_name Data-OptList
|
|
Summary: Parse and validate simple name/value option pairs
|
|
Version: 0.107
|
|
Release: 4
|
|
License: Artistic-1.0
|
|
Group: Development/Libraries/Perl
|
|
Url: http://search.cpan.org/dist/Data-OptList
|
|
Source: http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Data-OptList-%{version}.tar.gz
|
|
BuildArch: noarch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
%{perl_requires}
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(List::Util) >= 0.00
|
|
# other not perl || perl-base
|
|
BuildRequires: perl(Sub::Install) >= 0.921
|
|
BuildRequires: perl(Params::Util) >= 0.14
|
|
#
|
|
Requires: perl(List::Util) >= 0.00
|
|
# other not perl || perl-base
|
|
Requires: perl(Sub::Install) >= 0.921
|
|
Requires: perl(Params::Util) >= 0.14
|
|
|
|
%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.
|
|
|
|
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.
|
|
|
|
Author: Ricardo SIGNES, <rjbs@cpan.org>
|
|
|
|
|
|
%prep
|
|
%setup -q -n %{cpan_name}-%{version}
|
|
|
|
%build
|
|
%{__perl} Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall"
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
%check
|
|
%{__make} test
|
|
|
|
%install
|
|
%perl_make_install
|
|
# do not perl_process_packlist (noarch)
|
|
# remove .packlist file
|
|
%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
|
|
# remove perllocal.pod file
|
|
%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
|
|
%perl_gen_filelist
|
|
|
|
%clean
|
|
%{__rm} -rf $RPM_BUILD_ROOT
|
|
|
|
%files -f %{name}.files
|
|
# normally you only need to check for doc files
|
|
%defattr(-,root,root)
|
|
%doc Changes LICENSE README
|
|
|
|
%changelog
|