# # spec file for package perl-XML-Spice # # 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 XML-Spice Name: perl-XML-Spice Version: 0.50.0 Release: 0 # 0.05 -> normalize -> 0.50.0 %define cpan_version 0.05 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Generating XML has never been so Perly! URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/R/RO/ROBN/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(CPAN::Meta::Requirements) >= 2.121 BuildRequires: perl(Module::Metadata) BuildRequires: perl(Test::XML) BuildRequires: perl(XML::Tidy::Tiny) Requires: perl(XML::Tidy::Tiny) Provides: perl(XML::Spice) = %{version} %undefine __perllib_provides %{perl_requires} %description XML::Spice is yet another XML generation module. It tries to take some of the pain out of generating XML by making it more like Perl. Unless you've got a really good module for producing XML for your particular use (like a module for interfacing with a specific web service), you've probably found that you end up resorting to code like this: my $xml = q{}; Of course this works great, and you can't beat it for speed, but it quickly becomes difficult to work with. Your syntax highlighting probably just displays it as a giant string. You can't easily see mismatched brackets or other bugs until your code runs and tries to parse the thing. And, once you start adding attributes and character data into the mix, it rapidly moves towards being impossible to read. Instead of this, you could use XML::Spice and write the same thing in Perl: my $xml = foo(bar(baz()), quux()); You'll can add liberal amounts of whitespace to convey structure without it making your output larger. You get Perl checking to make sure that you haven't left anything out. You can use all the power of Perl to generate and include data without having to pepper your code with interpolated strings or concatenation operators. And you get a guarantee that the XML produced is valid. %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