diff --git a/XML-Parser-2.46.tar.gz b/XML-Parser-2.46.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..a4e4189ea0d565069c763e5c00a3b1df9d24a0bc Binary files /dev/null and b/XML-Parser-2.46.tar.gz differ diff --git a/perl-XML-Parser.spec b/perl-XML-Parser.spec new file mode 100644 index 0000000000000000000000000000000000000000..118446221f9612a1f26b71f69764d9d72cd312b7 --- /dev/null +++ b/perl-XML-Parser.spec @@ -0,0 +1,99 @@ +%define anolis_release 1 +Name: perl-XML-Parser +Version: 2.46 +Release: %{anolis_release}%{?dist} +Summary: Perl module for parsing XML documents + +License: GPL-1.0-or-later OR Artistic-1.0-Perl +Url: https://metacpan.org/release/XML-Parser +Source0: https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-%{version}.tar.gz + +# Build +BuildRequires: coreutils +BuildRequires: expat-devel +BuildRequires: findutils +BuildRequires: gcc +BuildRequires: glibc-common +BuildRequires: make +BuildRequires: perl-devel +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(Config) +BuildRequires: perl(Devel::CheckLib) +BuildRequires: perl(English) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(lib) +# Runtime +BuildRequires: perl(Carp) +BuildRequires: perl(FileHandle) +BuildRequires: perl(File::Spec) +BuildRequires: perl(if) +BuildRequires: perl(IO::File) +BuildRequires: perl(IO::Handle) +# LWPExternEnt.pl script is loaded by Parser.pm +BuildRequires: perl(LWP::UserAgent) +BuildRequires: perl(overload) +BuildRequires: perl(strict) +BuildRequires: perl(URI) +BuildRequires: perl(URI::file) +BuildRequires: perl(XSLoader) +# Tests +BuildRequires: perl(if) +BuildRequires: perl(Test) +BuildRequires: perl(Test::More) +BuildRequires: perl(warnings) +Requires: perl(IO::File) +Requires: perl(IO::Handle) + + +%{?perl_default_filter} +%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}perl\\(XML::Parser\\)$ + +%description +This module provides ways to parse XML documents. It is built on top +of XML::Parser::Expat, which is a lower level interface to James +Clark's expat library. Each call to one of the parsing methods creates +a new instance of XML::Parser::Expat which is then used to parse the +document. Expat options may be provided when the XML::Parser object is +created. These options are then passed on to the Expat object on each +parse call. They can also be given as extra arguments to the parse +methods, in which case they override options given at XML::Parser +creation time. + +%prep +%setup -q -n XML-Parser-%{version} +chmod 644 samples/{canonical,xml*} +perl -MConfig -pi -e 's|^#!/usr/local/bin/perl\b|$Config{startperl}|' samples/{canonical,xml*} + +# Remove bundled library +rm -r inc +perl -i -ne 'print $_ unless m{^inc/}' MANIFEST + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" +%{make_build} + +%install +%{make_install} +find $RPM_BUILD_ROOT -type f -name '*.bs' -a -size 0 -delete +%{_fixperms} $RPM_BUILD_ROOT/* + +for file in samples/REC-xml-19980210.xml; do + iconv -f iso-8859-1 -t utf-8 < "$file" > "${file}_" + mv -f "${file}_" "$file" + perl -i -pe "s/encoding='ISO-8859-1'/encoding='UTF-8'/" "$file" +done + +%check +make test + +%files +%doc README Changes samples/ +%{perl_vendorarch}/XML/ +%{perl_vendorarch}/auto/XML/ +%{_mandir}/man3/*.3* + + +%changelog +* Thu Feb 02 2023 Chunmei Xu - 2.46-1 +- init from upstream