# # spec file for package perl-XML-TreeBuilder # # 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-TreeBuilder Name: perl-XML-TreeBuilder Version: 5.400.0 Release: 0 # 5.4 -> normalize -> 5.400.0 %define cpan_version 5.4 License: Artistic-1.0 OR GPL-1.0-or-later Summary: XML elements with the same interface as HTML::Element URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/J/JF/JFEARN/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(HTML::Element) >= 4.1 BuildRequires: perl(HTML::Tagset) >= 3.02 BuildRequires: perl(Module::Build) BuildRequires: perl(XML::Catalog) >= 1.20.0 BuildRequires: perl(XML::Parser) Requires: perl(HTML::Element) >= 4.1 Requires: perl(HTML::Tagset) >= 3.02 Requires: perl(XML::Catalog) >= 1.20.0 Requires: perl(XML::Parser) Provides: perl(XML::Element) = %{version} Provides: perl(XML::TreeBuilder) = %{version} %undefine __perllib_provides %{perl_requires} %description This module uses XML::Parser to make XML document trees constructed of XML::Element objects (and XML::Element is a subclass of HTML::Element adapted for XML). XML::TreeBuilder is meant particularly for people who are used to the HTML::TreeBuilder / HTML::Element interface to document trees, and who don't want to learn some other document interface like XML::Twig or XML::DOM. The way to use this class is to: 1. start a new (empty) XML::TreeBuilder object. 2. set any of the "store" options you want. 3. then parse the document from a source by calling '$x->parsefile(...)' or '$x->parse(...)' (See XML::Parser docs for the options that these two methods take) 4. do whatever you need to do with the syntax tree, presumably involving traversing it looking for some bit of information in it, 5. and finally, when you're done with the tree, call $tree->delete to erase the contents of the tree from memory. This kind of thing usually isn't necessary with most Perl objects, but it's necessary for TreeBuilder objects. See HTML::Element for a more verbose explanation of why this is the case. %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 Build.PL --installdirs=vendor ./Build build --flags=%{?_smp_mflags} %check ./Build test %install ./Build install --destdir=%{buildroot} --create_packlist=0 %perl_gen_filelist %files -f %{name}.files %doc Changes README %changelog