Files
perl-Getopt-Mixed/perl-Getopt-Mixed.spec
2025-08-12 18:14:22 +02:00

89 lines
3.1 KiB
RPMSpec

#
# spec file for package perl-Getopt-Mixed
#
# Copyright (c) 2024 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 Getopt-Mixed
Name: perl-Getopt-Mixed
Version: 1.120.0
Release: 0
# 1.12 -> normalize -> 1.120.0
%define cpan_version 1.12
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: [OBSOLETE] getopt processing with both long and short options
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/C/CJ/CJM/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
Provides: perl(Getopt::Mixed) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
*This module is obsolete.*
This package was my response to the standard modules Getopt::Std and
Getopt::Long. Std doesn't support long options, and Long didn't support
short options. I wanted both, since long options are easier to remember and
short options are faster to type.
However, years ago Getopt::Long was changed to support short options as
well, and it has the huge advantage of being part of the standard Perl
distribution. So, Getopt::Mixed is now effectively obsolete. I don't intend
to make any more changes, but I'm leaving it available for people who have
code that already uses it. For new modules, I recommend using Getopt::Long
like this:
use Getopt::Long 2.17; # Released with Perl 5.005
Getopt::Long::Configure(qw(bundling no_getopt_compat));
GetOptions(...option-descriptions...);
This package was intended to be the "Getopt-to-end-all-Getop's". It
combines (I hope) flexibility and simplicity. It supports both short
options (introduced by '-') and long options (introduced by '--'). Short
options which do not take an argument can be grouped together. Short
options which do take an argument must be the last option in their group,
because everything following the option will be considered to be its
argument.
There are two methods for using Getopt::Mixed: the simple method and the
flexible method. Both methods use the same format for option descriptions.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
%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 examples README
%license LICENSE
%changelog