2011-05-03 06:18:32 +00:00
|
|
|
#
|
2024-07-19 19:27:58 +00:00
|
|
|
# spec file for package perl-CGI-Application-Plugin-AutoRunmode
|
2011-05-03 06:18:32 +00:00
|
|
|
#
|
2024-07-19 19:27:58 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2011-05-03 06:18:32 +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.
|
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-05-03 06:18:32 +00:00
|
|
|
#
|
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
|
2011-05-03 06:18:32 +00:00
|
|
|
%define cpan_name CGI-Application-Plugin-AutoRunmode
|
2024-07-19 19:27:58 +00:00
|
|
|
Name: perl-CGI-Application-Plugin-AutoRunmode
|
|
|
|
Version: 0.180.0
|
|
|
|
Release: 0
|
|
|
|
# 0.18 -> normalize -> 0.180.0
|
|
|
|
%define cpan_version 0.18
|
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2011-05-03 06:18:32 +00:00
|
|
|
Summary: CGI::App plugin to automatically register runmodes
|
2024-07-19 19:27:58 +00:00
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
|
|
Source0: https://cpan.metacpan.org/authors/id/T/TH/THILO/%{cpan_name}-%{cpan_version}.tar.gz
|
2025-08-12 18:12:14 +02:00
|
|
|
Source100: README.md
|
2011-05-03 06:18:32 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(CGI::Application) >= 3
|
|
|
|
Requires: perl(CGI::Application) >= 3
|
2024-07-19 19:27:58 +00:00
|
|
|
Provides: perl(CGI::Application::Plugin::AutoRunmode) = %{version}
|
|
|
|
%undefine __perllib_provides
|
2011-05-03 06:18:32 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
|
|
|
This plugin for CGI::Application provides easy ways to setup run modes. You
|
|
|
|
can just write the method that implement a run mode, you do not have to
|
|
|
|
explicitly register it with CGI::App anymore.
|
|
|
|
|
|
|
|
There are two approaches:
|
|
|
|
|
|
|
|
* Declare run modes with subroutine attributes.
|
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
You can flag methods in your CGI::App subclass with the attribute "Runmode"
|
|
|
|
or "StartRunmode" (these attributes are case-insensitive)
|
2011-05-03 06:18:32 +00:00
|
|
|
|
|
|
|
* Declare that every method in a class is a run mode.
|
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
You can assign a delegate object, all whose methods will become runmodes
|
2011-05-03 06:18:32 +00:00
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
You can also mix both approaches.
|
2011-05-03 06:18:32 +00:00
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
Delegate runmodes receive two parameters: The first one is the CGI::App
|
|
|
|
instance, followed by the delegate instance or class name. This can be
|
|
|
|
useful if you have delegate objects that contain state.
|
2011-05-03 06:18:32 +00:00
|
|
|
|
2024-07-19 19:27:58 +00:00
|
|
|
It is possible to chain multiple delegates by specifying an array reference
|
|
|
|
containing the delegate instances or class names. This chain is checked
|
|
|
|
from left to right and the runmode will be delegated to the first match.
|
2011-05-03 06:18:32 +00:00
|
|
|
|
|
|
|
It both cases, the resulting runmodes will have the same name as the
|
|
|
|
subroutine that implements them. They are activated by a cgiapp_prerun hook
|
|
|
|
provided by this plugin (if you are using CGI::Application older than
|
|
|
|
version 4, hooks are not available, and you can import a cgiapp_prerun
|
|
|
|
method instead).
|
|
|
|
|
|
|
|
%prep
|
2024-07-19 19:27:58 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
2011-05-03 06:18:32 +00:00
|
|
|
|
|
|
|
%build
|
2024-07-19 19:27:58 +00:00
|
|
|
perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%make_build
|
2011-05-03 06:18:32 +00:00
|
|
|
|
|
|
|
%check
|
2024-07-19 19:27:58 +00:00
|
|
|
make test
|
2011-05-03 06:18:32 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%doc Changes README
|
|
|
|
|
|
|
|
%changelog
|