Files
perl-Data-Dumper/perl-Data-Dumper.spec
2025-08-12 18:13:01 +02:00

91 lines
3.4 KiB
RPMSpec

#
# spec file for package perl-Data-Dumper
#
# 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 Data-Dumper
Name: perl-Data-Dumper
Version: 2.183
Release: 0
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Stringified perl data structures, suitable for both printing and eval
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/N/NW/NWCLARK/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildRequires: perl
BuildRequires: perl-macros
%{perl_requires}
%description
Given a list of scalars or reference variables, writes out their contents
in perl syntax. The references can also be objects. The content of each
variable is output in a single Perl statement. Handles self-referential
structures correctly.
The return value can be 'eval'ed to get back an identical copy of the
original reference structure. (Please do consider the security implications
of eval'ing code from untrusted sources!)
Any references that are the same as one of those passed in will be named
'$VAR'_n_ (where _n_ is a numeric suffix), and other duplicate references
to substructures within '$VAR'_n_ will be appropriately labeled using arrow
notation. You can specify names for individual values to be dumped if you
use the 'Dump()' method, or you can change the default '$VAR' prefix to
something else. See '$Data::Dumper::Varname' and '$Data::Dumper::Terse'
below.
The default output of self-referential structures can be 'eval'ed, but the
nested references to '$VAR'_n_ will be undefined, since a recursive
structure cannot be constructed using one Perl statement. You should set
the 'Purity' flag to 1 to get additional statements that will correctly
fill in these references. Moreover, if 'eval'ed when strictures are in
effect, you need to ensure that any variables it accesses are previously
declared.
In the extended usage form, the references to be dumped can be given
user-specified names. If a name begins with a '*', the output will describe
the dereferenced type of the supplied reference for hashes and arrays, and
coderefs. Output of names will be avoided where possible if the 'Terse'
flag is set.
In many cases, methods that are used to set the internal state of the
object will return the object itself, so method calls can be conveniently
chained together.
Several styles of output are possible, all controlled by setting the
'Indent' flag. See Configuration Variables or Methods below for details.
%prep
%autosetup -n %{cpan_name}-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes Todo
%changelog