File perl-WWW-Mechanize-Pluggable.spec of Package perl-WWW-Mechanize-Pluggable
#
# spec file for package perl-WWW-Mechanize-Pluggable
#
# 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 WWW-Mechanize-Pluggable
Name: perl-WWW-Mechanize-Pluggable
Version: 1.140.0
Release: 0
# 1.14 -> normalize -> 1.140.0
%define cpan_version 1.14
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: WWW::Mechanize that's custmomizable via plugins
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/M/MC/MCMAHON/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Data::Dump::Streamer)
BuildRequires: perl(HTML::Form) >= 1.038
BuildRequires: perl(HTML::HeadParser)
BuildRequires: perl(HTML::TokeParser) >= 2.28
BuildRequires: perl(HTTP::Cookies)
BuildRequires: perl(HTTP::Daemon)
BuildRequires: perl(HTTP::Request) >= 1.3
BuildRequires: perl(HTTP::Status)
BuildRequires: perl(LWP) >= 6
BuildRequires: perl(LWP::UserAgent) >= 2.024
BuildRequires: perl(Module::Pluggable)
BuildRequires: perl(Test::Exception) >= 0.2
BuildRequires: perl(URI) >= 1.25
BuildRequires: perl(URI::URL)
BuildRequires: perl(URI::file)
BuildRequires: perl(WWW::Mechanize) >= 1.66
Requires: perl(Data::Dump::Streamer)
Requires: perl(HTML::Form) >= 1.038
Requires: perl(HTML::HeadParser)
Requires: perl(HTML::TokeParser) >= 2.28
Requires: perl(HTTP::Cookies)
Requires: perl(HTTP::Daemon)
Requires: perl(HTTP::Request) >= 1.3
Requires: perl(HTTP::Status)
Requires: perl(LWP) >= 6
Requires: perl(LWP::UserAgent) >= 2.024
Requires: perl(Module::Pluggable)
Requires: perl(Test::Exception) >= 0.2
Requires: perl(URI) >= 1.25
Requires: perl(URI::URL)
Requires: perl(URI::file)
Requires: perl(WWW::Mechanize) >= 1.66
Provides: perl(WWW::Mechanize::Pluggable) = %{version}
Provides: perl(WWW::Mechanize::Plugin::HelloWorld)
%undefine __perllib_provides
%{perl_requires}
%description
This module provides all of the same functionality of 'WWW::Mechanize', but
adds support for _plugins_ using 'Module::Pluggable'; this means that any
module named 'WWW::Mechanize::Plugin::_whatever..._' will be found and
loaded when 'WWW::Mechanize::Pluggable' is loaded.
Big deal, you say. Well, it _becomes_ a big deal in conjunction with
'WWW::Mechanize::Pluggable''s other feature: _plugin hooks_. When plugins
are loaded, their 'import()' methods can call 'WWW::Mechanize::Pluggable''s
'prehook' and 'posthook' methods. These methods add callbacks to the plugin
code in 'WWW::Mechanize::Pluggable''s methods. These callbacks can act
before a method or after it, and have to option of short-circuiting the
call to the 'WWW::Mechanize::Pluggable' method altogether.
These methods receive whatever parameters the 'WWW::Mechanize::Pluggable'
methods received, plus a reference to the actvive 'Mech' object.
All other extensions to 'WWW::Mechanize::Pluggable' are handled by the
plugins.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%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 README Todo
%license LICENSE
%changelog