92 lines
3.2 KiB
RPMSpec
92 lines
3.2 KiB
RPMSpec
#
|
|
# spec file for package perl-Data-Denter
|
|
#
|
|
# 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-Denter
|
|
Name: perl-Data-Denter
|
|
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: An (deprecated) alternative to Data::Dumper and Storable
|
|
URL: https://metacpan.org/release/%{cpan_name}
|
|
Source0: https://cpan.metacpan.org/authors/id/I/IN/INGY/%{cpan_name}-%{cpan_version}.tar.gz
|
|
Source100: README.md
|
|
BuildArch: noarch
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(YAML)
|
|
Requires: perl(YAML)
|
|
Provides: perl(Data::Denter) = %{version}
|
|
%undefine __perllib_provides
|
|
%{perl_requires}
|
|
|
|
%description
|
|
The main problem with Data::Dumper (one of my all-time favorite modules) is
|
|
that you have to use 'eval()' to deserialize the data you've dumped. This
|
|
is great if you can trust the data you're evaling, but horrible if you
|
|
can't. A good alternative is Storable.pm. It can safely thaw your frozen
|
|
data. But if you want to read/edit the frozen data, you're out of luck,
|
|
because Storable uses a binary format. Even Data::Dumper's output can be a
|
|
little cumbersome for larger data objects.
|
|
|
|
Enter Data::Denter.
|
|
|
|
Data::Denter is yet another Perl data serializer/deserializer. It formats
|
|
nested data structures in an indented fashion. It is optimized for human
|
|
readability/editability, safe deserialization, and (eventually) speed.
|
|
|
|
NOTE: It may be optimized for Python programmers too, but please don't hold
|
|
that against me ;)
|
|
|
|
It exports 2 functions: 'Indent()' and 'Undent()' for serialization and
|
|
deserialization respectively. It also exports 'Denter()' which is an alias
|
|
to 'Indent()'. (People who use Data::Dumper will appreciate this). You can
|
|
even import 'Dumper()' (another 'Indent' alias) for easily toggling between
|
|
Data::Dumper and Data::Denter style formatting.
|
|
|
|
Data::Denter handles all of the commonly serializable Perl data types,
|
|
including: scalars, hash refs, array refs, scalar refs, ref refs, undef,
|
|
and blessed references. Other references will simply be formatted in their
|
|
string forms. It can even properly handle circular and duplicate
|
|
references.
|
|
|
|
Data::Denter has 3 different forms of quoting string values depending on
|
|
their complexity: no quotes, double quotes, and here-doc quoting. It also
|
|
has a special symbol for undefined values.
|
|
|
|
%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
|
|
|
|
%changelog
|