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

79 lines
2.6 KiB
RPMSpec

#
# spec file for package perl-CGI-Struct
#
# 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-Struct
Name: perl-CGI-Struct
Version: 1.210.0
Release: 0
# 1.21 -> normalize -> 1.210.0
%define cpan_version 1.21
License: BSD-3-Clause
Summary: Build structures from CGI data
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/F/FU/FULLERMD/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Test::Deep)
Provides: perl(CGI::Struct) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
CGI::Struct lets you transform CGI data keys that _look like_ perl data
structures into _actual_ perl data structures.
CGI::Struct makes no attempt to actually _read in_ the variables from the
request. You should be using CGI or some equivalent for that. CGI::Struct
expects to be handed a reference to a hash containing all the keys/values
you care about. The common way is to use something like 'CGI->Vars' or (as
the author does) 'Plack::Request->parameters->mixed'.
Whatever you use should give you a hash mapping the request variable names
(keys) to the values sent in by the users (values). Any of the major CGIish
modules will have such a method; consult the documentation for yours if you
don't know it offhand.
Of course, this isn't necessarily tied strictly to CGI; you _could_ use it
to build data structures from any other source with similar syntax. All
CGI::Struct does is take one hash (reference) and turn it into another hash
(reference). However, it's aimed at CGI uses, so it may or may not work for
something else.
%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
%license LICENSE
%changelog