2019-04-03 06:54:17 +00:00
|
|
|
#
|
|
|
|
# spec file for package perl-Getopt-Long-Complete
|
|
|
|
#
|
2025-04-14 20:37:18 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2019-04-03 06:54:17 +00:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-02-20 11:33:36 +00:00
|
|
|
%define cpan_name Getopt-Long-Complete
|
2019-04-03 06:54:17 +00:00
|
|
|
Name: perl-Getopt-Long-Complete
|
2025-04-14 20:37:18 +00:00
|
|
|
Version: 0.318.0
|
2019-04-03 06:54:17 +00:00
|
|
|
Release: 0
|
2025-04-14 20:37:18 +00:00
|
|
|
# 0.318 -> normalize -> 0.318.0
|
|
|
|
%define cpan_version 0.318
|
2019-04-03 06:54:17 +00:00
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2022-02-20 11:33:36 +00:00
|
|
|
Summary: Drop-in replacement for Getopt::Long, with shell tab completion
|
2020-10-29 09:02:46 +00:00
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
2024-08-10 20:50:57 +00:00
|
|
|
Source0: https://cpan.metacpan.org/authors/id/P/PE/PERLANCAR/%{cpan_name}-%{cpan_version}.tar.gz
|
2020-10-29 09:02:46 +00:00
|
|
|
Source1: cpanspec.yml
|
2025-08-12 18:14:21 +02:00
|
|
|
Source100: README.md
|
2019-04-03 06:54:17 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
2020-10-29 09:02:46 +00:00
|
|
|
BuildRequires: perl(Complete::Bash) >= 0.333
|
2019-04-03 06:54:17 +00:00
|
|
|
BuildRequires: perl(Complete::Fish)
|
2023-06-01 15:20:38 +00:00
|
|
|
BuildRequires: perl(Complete::Getopt::Long) >= 0.481
|
2019-04-03 06:54:17 +00:00
|
|
|
BuildRequires: perl(Complete::Tcsh)
|
|
|
|
BuildRequires: perl(Complete::Zsh)
|
2020-10-29 09:02:46 +00:00
|
|
|
BuildRequires: perl(Getopt::Long) >= 2.50
|
|
|
|
BuildRequires: perl(Test::More) >= 0.98
|
|
|
|
Requires: perl(Complete::Bash) >= 0.333
|
2019-04-03 06:54:17 +00:00
|
|
|
Requires: perl(Complete::Fish)
|
2023-06-01 15:20:38 +00:00
|
|
|
Requires: perl(Complete::Getopt::Long) >= 0.481
|
2019-04-03 06:54:17 +00:00
|
|
|
Requires: perl(Complete::Tcsh)
|
|
|
|
Requires: perl(Complete::Zsh)
|
2020-10-29 09:02:46 +00:00
|
|
|
Requires: perl(Getopt::Long) >= 2.50
|
2024-08-10 20:50:57 +00:00
|
|
|
Provides: perl(Getopt::Long::Complete) = %{version}
|
|
|
|
%undefine __perllib_provides
|
2019-04-03 06:54:17 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
|
|
|
This module provides a quick and easy way to add shell tab completion
|
|
|
|
feature to your scripts, including scripts already written using the
|
|
|
|
venerable Getopt::Long module. Currently bash and tcsh are directly
|
|
|
|
supported; fish and zsh are also supported via shcompgen.
|
|
|
|
|
|
|
|
This module is basically just a thin wrapper for Getopt::Long. Its
|
|
|
|
'GetOptions' function just checks for COMP_LINE/COMP_POINT environment
|
|
|
|
variable (in the case of bash) or COMMAND_LINE (in the case of tcsh) before
|
|
|
|
passing its arguments to 'Getopt::Long''s 'GetOptions'. If those
|
|
|
|
environment variable(s) are defined, completion reply will be printed to
|
|
|
|
STDOUT and then the program will exit. Otherwise, Getopt::Long's GetOptions
|
|
|
|
is called.
|
|
|
|
|
|
|
|
To keep completion quick, you should do 'GetOptions()' or
|
|
|
|
'GetOptionsWithCompletion()' as early as possible in your script.
|
|
|
|
Preferably before loading lots of other Perl modules.
|
|
|
|
|
|
|
|
To activate tab completion in bash, put your script somewhere in 'PATH' and
|
|
|
|
execute this in the shell or put it into your bash startup file (e.g.
|
|
|
|
'/etc/bash.bashrc' or '~/.bashrc'). Replace 'delete-user' with the actual
|
|
|
|
script name:
|
|
|
|
|
|
|
|
complete -C delete-user delete-user
|
|
|
|
|
|
|
|
For tcsh:
|
|
|
|
|
|
|
|
complete delete-user 'p/*/`delete-user`/'
|
|
|
|
|
|
|
|
For other shells (but actually for bash too) you can use shcompgen.
|
|
|
|
|
|
|
|
%prep
|
2025-04-14 20:37:18 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version} -p1
|
2023-06-01 15:20:38 +00:00
|
|
|
|
|
|
|
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
|
2019-04-03 06:54:17 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
2022-02-20 11:33:36 +00:00
|
|
|
%make_build
|
2019-04-03 06:54:17 +00:00
|
|
|
|
|
|
|
%check
|
|
|
|
make test
|
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%doc Changes README
|
|
|
|
%license LICENSE
|
|
|
|
|
|
|
|
%changelog
|