2010-09-22 21:38:03 +00:00
|
|
|
#
|
2019-10-27 13:51:28 +00:00
|
|
|
# spec file for package perl-Plack-Middleware-Debug
|
2010-09-22 21:38:03 +00:00
|
|
|
#
|
2024-07-27 21:46:57 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2010-09-22 21:38:03 +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.
|
|
|
|
|
2019-10-27 13:51:28 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-09-22 21:38:03 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2024-07-27 21:46:57 +00:00
|
|
|
%define cpan_name Plack-Middleware-Debug
|
2010-09-22 21:38:03 +00:00
|
|
|
Name: perl-Plack-Middleware-Debug
|
2024-07-27 21:46:57 +00:00
|
|
|
Version: 0.180.0
|
2019-10-27 13:51:28 +00:00
|
|
|
Release: 0
|
2024-07-27 21:46:57 +00:00
|
|
|
# 0.18 -> normalize -> 0.180.0
|
|
|
|
%define cpan_version 0.18
|
2019-10-27 13:51:28 +00:00
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2024-07-27 21:46:57 +00:00
|
|
|
Summary: Display information about the current request/response
|
2020-05-07 16:00:03 +00:00
|
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
2024-07-27 21:46:57 +00:00
|
|
|
Source0: https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{cpan_version}.tar.gz
|
2019-10-27 13:51:28 +00:00
|
|
|
Source1: cpanspec.yml
|
2025-08-12 18:16:32 +02:00
|
|
|
Source100: README.md
|
2010-09-22 21:38:03 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(Class::Method::Modifiers) >= 1.05
|
|
|
|
BuildRequires: perl(Data::Dump)
|
2019-10-27 13:51:28 +00:00
|
|
|
BuildRequires: perl(Data::Dumper::Concise)
|
|
|
|
BuildRequires: perl(Encode) >= 2.23
|
2010-09-22 21:38:03 +00:00
|
|
|
BuildRequires: perl(File::ShareDir) >= 1.00
|
2024-07-27 21:46:57 +00:00
|
|
|
BuildRequires: perl(Module::Build)
|
2019-10-27 13:51:28 +00:00
|
|
|
BuildRequires: perl(Module::Build::Tiny) >= 0.034
|
2010-09-22 21:38:03 +00:00
|
|
|
BuildRequires: perl(Plack)
|
2020-05-07 16:00:03 +00:00
|
|
|
BuildRequires: perl(Plack::Test)
|
2019-10-27 13:51:28 +00:00
|
|
|
BuildRequires: perl(Test::More) >= 0.70
|
|
|
|
BuildRequires: perl(Test::Requires) >= 0.08
|
2024-07-27 21:46:57 +00:00
|
|
|
BuildRequires: perl(Text::MicroTemplate) >= 0.150
|
2019-10-27 13:51:28 +00:00
|
|
|
BuildRequires: perl(parent)
|
2010-09-22 21:38:03 +00:00
|
|
|
Requires: perl(Class::Method::Modifiers) >= 1.05
|
|
|
|
Requires: perl(Data::Dump)
|
2019-10-27 13:51:28 +00:00
|
|
|
Requires: perl(Data::Dumper::Concise)
|
|
|
|
Requires: perl(Encode) >= 2.23
|
2010-09-22 21:38:03 +00:00
|
|
|
Requires: perl(File::ShareDir) >= 1.00
|
|
|
|
Requires: perl(Plack)
|
2024-07-27 21:46:57 +00:00
|
|
|
Requires: perl(Text::MicroTemplate) >= 0.150
|
2019-10-27 13:51:28 +00:00
|
|
|
Requires: perl(parent)
|
2024-07-27 21:46:57 +00:00
|
|
|
Provides: perl(Plack::Middleware::Debug) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Base) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::CatalystLog) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::DBITrace) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Environment) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Memory) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::ModuleVersions) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Panel)
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Parameters)
|
|
|
|
Provides: perl(Plack::Middleware::Debug::PerlConfig) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Response) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Session)
|
|
|
|
Provides: perl(Plack::Middleware::Debug::Timer) = %{version}
|
|
|
|
Provides: perl(Plack::Middleware::Debug::TrackObjects)
|
|
|
|
%undefine __perllib_provides
|
2019-10-27 13:51:28 +00:00
|
|
|
%{perl_requires}
|
2010-09-22 21:38:03 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
The debug middleware offers a configurable set of panels that displays
|
|
|
|
information about the current request and response. The information is
|
2019-10-27 13:51:28 +00:00
|
|
|
generated only for responses with a status of 200 ('OK') and a
|
|
|
|
'Content-Type' that contains 'text/html' or 'application/xhtml+xml' and is
|
|
|
|
embedded in the HTML that is sent back to the browser.
|
|
|
|
|
|
|
|
Note that the code is injected *directly before the closing tag*
|
|
|
|
('</body>') so if there is no such tag, the debug panel will not be
|
|
|
|
injected at all.
|
|
|
|
|
|
|
|
To enable the middleware, just use Plack::Builder as usual in your '.psgi'
|
|
|
|
file:
|
|
|
|
|
|
|
|
use Plack::Builder;
|
|
|
|
|
|
|
|
builder {
|
|
|
|
enable 'Debug', panels => [ qw(DBITrace Memory Timer) ];
|
|
|
|
$app;
|
|
|
|
};
|
|
|
|
|
|
|
|
The 'Debug' middleware takes an optional 'panels' argument whose value is
|
|
|
|
expected to be a reference to an array of panel specifications. If given,
|
|
|
|
only those panels will be enabled. If you don't pass a 'panels' argument,
|
|
|
|
the default list of panels - 'Environment', 'Response', 'Timer', 'Memory',
|
|
|
|
'Session' and 'DBITrace' - will be enabled, each with their default
|
|
|
|
settings, and automatically disabled if their target modules or middleware
|
|
|
|
components are not loaded.
|
|
|
|
|
|
|
|
Each panel specification can take one of three forms:
|
|
|
|
|
|
|
|
* A string
|
|
|
|
|
|
|
|
This is interpreted as the base name of a panel in the
|
|
|
|
'Plack::Middeware::Debug::' namespace, unless preceded by '+', in which
|
|
|
|
case it's interpreted as an absolute name similar to how Plack::Builder
|
|
|
|
handles such names, e.g. '+My::Plack::Middleware::Debug::Something'.
|
|
|
|
|
|
|
|
The panel class is loaded and a panel object is created with its default
|
|
|
|
settings.
|
|
|
|
|
|
|
|
* An array reference
|
|
|
|
|
|
|
|
If you need to pass arguments to the panel object as it is created, you may
|
|
|
|
use this form (But see below).
|
|
|
|
|
|
|
|
The first element of the array reference has to be the panel base name. The
|
|
|
|
remaining elements are key/value pairs to be passed to the panel.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
builder {
|
|
|
|
enable 'Debug', panels =>
|
|
|
|
[ qw(Environment Response Timer Memory),
|
|
|
|
[ 'DBITrace', level => 2 ]
|
|
|
|
];
|
|
|
|
$app;
|
|
|
|
};
|
|
|
|
|
|
|
|
Because each panel is a middleware component, you can write this way as
|
|
|
|
well:
|
|
|
|
|
|
|
|
builder {
|
|
|
|
enable 'Debug'; # load defaults
|
|
|
|
enable 'Debug::DBITrace', level => 2;
|
|
|
|
$app;
|
|
|
|
};
|
|
|
|
|
|
|
|
Note that the '<enable 'Debug''> line should come before other Debug panels
|
|
|
|
because of the order middleware components are executed.
|
|
|
|
|
|
|
|
* Custom middleware
|
|
|
|
|
|
|
|
You can also pass a Panel middleware component. This might be useful if you
|
|
|
|
have custom debug panels in your framework or web application.
|
2010-09-22 21:38:03 +00:00
|
|
|
|
|
|
|
%prep
|
2024-07-27 21:46:57 +00:00
|
|
|
%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
|
2010-09-22 21:38:03 +00:00
|
|
|
|
|
|
|
%build
|
2019-10-27 13:51:28 +00:00
|
|
|
perl Build.PL --installdirs=vendor
|
|
|
|
./Build build --flags=%{?_smp_mflags}
|
2010-09-22 21:38:03 +00:00
|
|
|
|
|
|
|
%check
|
2019-10-27 13:51:28 +00:00
|
|
|
./Build test
|
2010-09-22 21:38:03 +00:00
|
|
|
|
|
|
|
%install
|
2019-10-27 13:51:28 +00:00
|
|
|
./Build install --destdir=%{buildroot} --create_packlist=0
|
2010-09-22 21:38:03 +00:00
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
2019-10-27 13:51:28 +00:00
|
|
|
%doc Changes examples README
|
|
|
|
%license LICENSE
|
2010-09-22 21:38:03 +00:00
|
|
|
|
|
|
|
%changelog
|