Files
perl-CGI-PSGI/perl-CGI-PSGI.spec
2025-08-12 18:12:17 +02:00

80 lines
2.7 KiB
RPMSpec

#
# spec file for package perl-CGI-PSGI
#
# 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 CGI-PSGI
Name: perl-CGI-PSGI
Version: 0.150.0
Release: 0
# 0.15 -> normalize -> 0.150.0
%define cpan_version 0.15
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Adapt CGI.pm to the PSGI protocol
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(CGI) >= 3.33
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
BuildRequires: perl(Test::More) >= 0.88
Requires: perl(CGI) >= 3.33
Provides: perl(CGI::PSGI) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module is for web application framework developers who currently uses
CGI to handle query parameters, and would like for the frameworks to comply
with the PSGI protocol.
Only slight modifications should be required if the framework is already
collecting the body content to print to STDOUT at one place (rather using
the print-as-you-go approach).
On the other hand, if you are an "end user" of CGI.pm and have a CGI script
that you want to run under PSGI web servers, this module might not be what
you want. Take a look at CGI::Emulate::PSGI instead.
Your application, typically the web application framework adapter should
update the code to do 'CGI::PSGI->new($env)' instead of 'CGI->new' to
create a new CGI object. (This is similar to how CGI::Fast object is
initialized in a FastCGI environment.)
%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_USE_UNSAFE_INC=1 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
%changelog