diff --git a/.gitignore b/.gitignore index e69de29..53c92da 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,25 @@ +XML-XPath-1.13.tar.gz +/XML-XPath-1.19.tar.gz +/XML-XPath-1.20.tar.gz +/XML-XPath-1.21.tar.gz +/XML-XPath-1.22.tar.gz +/XML-XPath-1.24.tar.gz +/XML-XPath-1.25.tar.gz +/XML-XPath-1.26.tar.gz +/XML-XPath-1.28.tar.gz +/XML-XPath-1.29.tar.gz +/XML-XPath-1.30.tar.gz +/XML-XPath-1.31.tar.gz +/XML-XPath-1.32.tar.gz +/XML-XPath-1.33.tar.gz +/XML-XPath-1.34.tar.gz +/XML-XPath-1.35.tar.gz +/XML-XPath-1.36.tar.gz +/XML-XPath-1.37.tar.gz +/XML-XPath-1.38.tar.gz +/XML-XPath-1.39.tar.gz +/XML-XPath-1.40.tar.gz +/XML-XPath-1.41.tar.gz +/XML-XPath-1.42.tar.gz +/XML-XPath-1.43.tar.gz +/XML-XPath-1.44.tar.gz diff --git a/.rpmlint b/.rpmlint new file mode 100644 index 0000000..4d4b9b8 --- /dev/null +++ b/.rpmlint @@ -0,0 +1,2 @@ +from Config import * +addFilter("spelling-error .* evaluator"); diff --git a/perl-XML-XPath.spec b/perl-XML-XPath.spec new file mode 100644 index 0000000..b055a7b --- /dev/null +++ b/perl-XML-XPath.spec @@ -0,0 +1,284 @@ +Name: perl-XML-XPath +Version: 1.44 +Release: 7%{?dist} +Summary: XPath parser and evaluator for Perl +# XML/XPath.pm, XML/XPath/PerlSAX.pm, REAME: GPL+ or Artistic +# Others: Artistic 2.0 +License: Artistic 2.0 and (GPL+ or Artistic) +URL: https://metacpan.org/release/XML-XPath +Source0: https://cpan.metacpan.org/authors/id/M/MA/MANWAR/XML-XPath-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: coreutils +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Run-time +BuildRequires: perl(Carp) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(Exporter) +BuildRequires: perl(IO::File) +BuildRequires: perl(overload) +BuildRequires: perl(POSIX) +BuildRequires: perl(Scalar::Util) +BuildRequires: perl(vars) +BuildRequires: perl(XML::Parser) >= 2.23 +# Tests +BuildRequires: perl(lib) +BuildRequires: perl(open) +BuildRequires: perl(Path::Tiny) >= 0.076 +BuildRequires: perl(Test) +BuildRequires: perl(Test::More) +BuildRequires: perl(utf8) +# Optional tests +BuildRequires: perl(CPAN::Meta) +BuildRequires: perl(Test::CPAN::Meta) +BuildRequires: perl(Test::CPAN::Meta::JSON) + +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(POSIX) +Requires: perl(warnings) +Requires: perl(XML::Parser) >= 2.23 + +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(XML::Parser\\)$ + +%description +This module aims to comply exactly to the XPath specification at +http://www.w3.org/TR/xpath and yet allow extensions to be added in the +form of functions. Modules such as XSLT and XPointer may need to do +this as they support functionality beyond XPath. + +%prep +%setup -q -n XML-XPath-%{version} + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=$RPM_BUILD_ROOT +%{_fixperms} $RPM_BUILD_ROOT/* + +mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/ +cat >> $RPM_BUILD_ROOT/%{_mandir}/man1/xpath.1 << EOF +.so man3/XML::XPath.3pm +EOF + +%check +make test + +%files +%license LICENSE +%doc Changes README TODO +%{_bindir}/xpath +%{perl_vendorlib}/XML +%{_mandir}/man1/xpath* +%{_mandir}/man3/*.3* + +%changelog +* Tue Jul 28 2020 Fedora Release Engineering - 1.44-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jun 23 2020 Jitka Plesnikova - 1.44-6 +- Perl 5.32 rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 1.44-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.44-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 31 2019 Jitka Plesnikova - 1.44-3 +- Perl 5.30 rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 1.44-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Oct 15 2018 Jitka Plesnikova - 1.44-1 +- 1.44 bump + +* Thu Oct 11 2018 Jitka Plesnikova - 1.43-1 +- 1.43 bump + +* Fri Jul 13 2018 Fedora Release Engineering - 1.42-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 29 2018 Jitka Plesnikova - 1.42-3 +- Perl 5.28 rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 1.42-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Jul 31 2017 Jitka Plesnikova - 1.42-1 +- 1.42 bump + +* Fri Jul 28 2017 Petr Pisar - 1.41-1 +- 1.41 bump + +* Thu Jul 27 2017 Fedora Release Engineering - 1.40-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jun 06 2017 Jitka Plesnikova - 1.40-3 +- Perl 5.26 rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.40-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Nov 14 2016 Jitka Plesnikova - 1.40-1 +- 1.40 bump + +* Wed Nov 09 2016 Jitka Plesnikova - 1.39-1 +- 1.39 bump + +* Mon Oct 31 2016 Jitka Plesnikova - 1.38-1 +- 1.38 bump + +* Thu Jun 02 2016 Jitka Plesnikova - 1.37-1 +- 1.37 bump + +* Mon May 16 2016 Jitka Plesnikova - 1.36-2 +- Perl 5.24 rebuild + +* Thu Apr 14 2016 Jitka Plesnikova - 1.36-1 +- 1.36 bump + +* Mon Apr 11 2016 Petr Pisar - 1.35-1 +- 1.35 bump + +* Fri Apr 08 2016 Jitka Plesnikova - 1.34-2 +- Add BR perl(CPAN::Meta) (BZ#1325123) + +* Wed Mar 09 2016 Jitka Plesnikova - 1.34-1 +- 1.34 bump + +* Mon Mar 07 2016 Jitka Plesnikova - 1.33-1 +- 1.33 bump + +* Wed Feb 24 2016 Jitka Plesnikova - 1.32-1 +- 1.32 bump + +* Mon Feb 22 2016 Jitka Plesnikova - 1.31-1 +- 1.31 bump + +* Mon Feb 08 2016 Jitka Plesnikova - 1.30-1 +- 1.30 bump + +* Thu Feb 04 2016 Jitka Plesnikova - 1.29-1 +- 1.29 bump + +* Mon Feb 01 2016 Jitka Plesnikova - 1.28-1 +- 1.28 bump + +* Tue Jan 26 2016 Jitka Plesnikova - 1.26-1 +- 1.26 bump + +* Thu Jan 21 2016 Jitka Plesnikova - 1.25-1 +- 1.25 bump + +* Wed Jan 20 2016 Jitka Plesnikova - 1.24-1 +- 1.24 bump + +* Wed Jan 13 2016 Jitka Plesnikova - 1.22-1 +- 1.22 bump + +* Tue Jan 12 2016 Petr Pisar - 1.21-1 +- 1.21 bump + +* Mon Jan 11 2016 Jitka Plesnikova - 1.20-1 +- 1.20 bump + +* Fri Jan 08 2016 Jitka Plesnikova - 1.19-1 +- 1.19 bump + +* Thu Jun 18 2015 Fedora Release Engineering - 1.13-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 06 2015 Jitka Plesnikova - 1.13-27 +- Perl 5.22 rebuild + +* Thu Aug 28 2014 Jitka Plesnikova - 1.13-26 +- Perl 5.20 rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.13-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 1.13-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 24 2013 Petr Pisar - 1.13-23 +- Perl 5.18 rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.13-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Oct 16 2012 Marcela Mašláňová - 1.13-21 +- revert the patch. It breaks backward compatibility for some apps. +- the xpath has still man page installed. + +* Fri Aug 24 2012 Jitka Plesnikova - 1.13-20 +- Specify all dependencies. + +* Fri Jul 20 2012 Fedora Release Engineering - 1.13-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jun 15 2012 Petr Pisar - 1.13-18 +- Perl 5.16 rebuild + +* Fri Mar 16 2012 Marcela Mašláňová - 1.13-17 +- 680418 - missing man page for xpath +- applied debian patch, which added POD into xpath code, but also fix debian bug(#185292) + +* Fri Jan 13 2012 Fedora Release Engineering - 1.13-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Jul 20 2011 Petr Sabata - 1.13-15 +- Perl mass rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 1.13-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 23 2010 Marcela Maslanova - 1.13-13 +- 661697 rebuild for fixing problems with vendorach/lib + +* Fri May 07 2010 Marcela Maslanova - 1.13-12 +- Mass rebuild with perl-5.12.0 + +* Thu Dec 10 2009 Marcela Maslanova - 1.13-11 +- 541668 fix requires for review + +* Mon Dec 7 2009 Stepan Kasal - 1.13-10 +- rebuild against perl 5.10.1 + +* Sun Jul 26 2009 Fedora Release Engineering - 1.13-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 1.13-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Jun 2 2008 Marcela Maslanova - 1.13-7 +- rebuild and remove ||: from check part + +* Wed Feb 27 2008 Tom "spot" Callaway - 1.13-6 +- Rebuild for perl 5.10 (again) + +* Thu Jan 24 2008 Tom "spot" Callaway 1.13-5 +- rebuild for new perl + +* Wed Oct 17 2007 Tom "spot" Callaway 1.13-4.1 +- correct license tag +- add BR: perl(ExtUtils::MakeMaker) + +* Thu Aug 31 2006 Chris Weyl 1.13-4 +- bump for mass rebuild + +* Wed Apr 6 2005 Michael Schwendt +- rebuilt + +* Sun Jul 11 2004 Ville Skyttä - 0:1.13-2 +- Bring up to date with current fedora.us Perl spec template. + +* Sun Oct 12 2003 Ville Skyttä - 0:1.13-0.fdr.1 +- First build. diff --git a/sources b/sources new file mode 100644 index 0000000..7ba825d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (XML-XPath-1.44.tar.gz) = 9314523baa55b48b8e684fbf9cc53006ef39829e2bcbd61a432508a96946c50384dff7eba47bd9f54aadc67c12fae6c1219104b017063d23ec3ee350a67eb12e diff --git a/xpath.man.patch b/xpath.man.patch new file mode 100644 index 0000000..349f7fd --- /dev/null +++ b/xpath.man.patch @@ -0,0 +1,259 @@ +Author: Ardo van Rangelrooij +Description: + * examples/xpath: patched by Fabien Ninoles + (thanks Fabien!) + * examples/xpath: fixed erroneous handling of filenames containing a '-' + (closes: Bug#185292) + * examples/xpath: fixed various small typos in the POD + (closes: Bug#180508) + +diff -up XML-XPath-1.13/examples/xpath.old XML-XPath-1.13/examples/xpath +--- XML-XPath-1.13/examples/xpath.old 2001-02-14 13:43:33.000000000 +0100 ++++ XML-XPath-1.13/examples/xpath 2012-03-16 17:31:58.812485837 +0100 +@@ -1,74 +1,113 @@ + #!/usr/bin/perl -w ++ ++eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}' ++ if 0; # not running under some shell + use strict; + + $| = 1; + +-unless (@ARGV >= 1) { +- print STDERR qq(Usage: +-$0 [filename] query +- +- If no filename is given, supply XML on STDIN. +-); +- exit; +-} +- + use XML::XPath; + +-my $xpath; +- ++my @paths; + my $pipeline; ++my $SUFFIX = "\n"; ++my $PREFIX = ""; ++my $quiet = 0; ++ ++PARSE: while ((@ARGV >= 1) && ($ARGV[0] =~ /^-./ )) { ++ OPTIONS: { ++ if ($ARGV[0] eq "-e") { ++ shift; ++ push @paths, shift; ++ last OPTIONS; ++ } ++ if ($ARGV[0] eq "-p") { ++ shift; ++ $PREFIX = shift; ++ last OPTIONS; ++ } ++ if ($ARGV[0] eq "-s") { ++ shift; ++ $SUFFIX = shift; ++ last OPTIONS; ++ } ++ if ($ARGV[0] eq "-q") { ++ $quiet = 1; ++ shift; ++ last OPTIONS; ++ } ++ print STDERR "Unknown option ignore: ", shift; ++ } ++} ++ ++unless (@paths >= 1) { ++ print STDERR qq(Usage: ++$0 [options] -e query [-e query...] [filename...] ++ ++ If no filenams are given, supply XML on STDIN. ++ You must provide at least one query. Each supplementary ++ query is done in order, the previous query giving the ++ context of the next one. ++ ++ Options: ++ ++ -q quiet. Only output the resulting PATH ++ -s suffix use suffix instead of linefeed. ++ -p postfix use prefix instead of nothing. ++); + +-if ($ARGV[0] eq '-p') { +- # pipeline mode +- $pipeline = 1; +- shift @ARGV; +-} +-if (@ARGV >= 2) { +- $xpath = XML::XPath->new(filename => shift(@ARGV)); +-} +-else { +- $xpath = XML::XPath->new(ioref => \*STDIN); +-} +- +-my $nodes = $xpath->find(shift @ARGV); +- +-unless ($nodes->isa('XML::XPath::NodeSet')) { +-NOTNODES: +- print STDERR "Query didn't return a nodeset. Value: "; +- print $nodes->value, "\n"; + exit; + } + +-if ($pipeline) { +- $nodes = find_more($nodes); +- goto NOTNODES unless $nodes->isa('XML::XPath::NodeSet'); +-} +- +-if ($nodes->size) { +- print STDERR "Found ", $nodes->size, " nodes:\n"; +- foreach my $node ($nodes->get_nodelist) { +- print STDERR "-- NODE --\n"; +- print $node->toString; +- } +-} +-else { +- print STDERR "No nodes found"; +-} +- +-print STDERR "\n"; ++do ++{ ++ my $xpath; ++ my @curpaths = @paths; ++ my $filename; ++ if (@ARGV >= 1) { ++ $filename = shift @ARGV; ++ $xpath = XML::XPath->new(filename => $filename); ++ } ++ else { ++ $filename = 'stdin'; ++ $xpath = XML::XPath->new(ioref => \*STDIN); ++ } ++ my $nodes = $xpath->find(shift @curpaths); ++ ++ if ($nodes->isa('XML::XPath::NodeSet')) { ++ while (@curpaths >= 1) { ++ $nodes = find_more($xpath, shift @curpaths, $nodes); ++ last unless $nodes->isa('XML::XPath::NodeSet'); ++ } ++ } ++ ++ if ($nodes->isa('XML::XPath::NodeSet')) { ++ if ($nodes->size) { ++ print STDERR "Found ", $nodes->size, " nodes in $filename:\n" unless $quiet; ++ foreach my $node ($nodes->get_nodelist) { ++ print STDERR "-- NODE --\n" unless $quiet; ++ print $PREFIX, $node->toString, $SUFFIX; ++ } ++ } ++ else { ++ print STDERR "No nodes found in $filename\n" unless $quiet; ++ } ++ } ++ else { ++ print STDERR "Query didn't return a nodeset. Value: "; ++ print $nodes->value, "\n"; ++ } ++} until (@ARGV < 1); + + exit; + + sub find_more { ++ my $xpath = shift; ++ my $find = shift; + my ($nodes) = @_; +- if (!@ARGV) { +- return $nodes; +- } + + my $newnodes = XML::XPath::NodeSet->new; + +- my $find = shift @ARGV; +- + foreach my $node ($nodes->get_nodelist) { + my $new = $xpath->find($find, $node); + if ($new->isa('XML::XPath::NodeSet')) { +@@ -79,5 +118,80 @@ sub find_more { + } + } + +- return find_more($newnodes); ++ return $newnodes; + } ++ ++__END__ ++=head1 NAME ++ ++xpath - a script to query XPath statements in XML documents. ++ ++=head1 SYNOPSIS ++ ++B ++ ++=head1 DESCRIPTION ++ ++B uses the L perl module to make XPath queries ++to any XML document. The L module aims to comply exactly ++to the XPath specification at C and yet ++allows extensions to be added in the form of functions. ++ ++The script takes any number of XPath pointers and tries to apply them ++to each XML document given on the command line. If no file arguments ++are given, the query is done using C as an XML document. ++ ++When multiple queries exist, the result of the last query is used as ++context for the next query and only the result of the last one is output. ++The context of the first query is always the root of the current document. ++ ++=head1 OPTIONS ++ ++=head2 B<-q> ++ ++Be quiet. Output only errors (and no separator) on stderr. ++ ++=head2 B<-s suffix> ++ ++Place C at the end of each entry. Default is a linefeed. ++ ++=head2 B<-p prefix> ++ ++Place C preceding each entry. Default is nothing. ++ ++=head1 BUGS ++ ++The author of this man page is not very fluant in english. Please, ++send him (L) any corrections concerning this text. ++ ++See also L. ++ ++=head1 SEE ALSO ++ ++L. ++=head1 HISTORY ++ ++This module is copyright 2000 Fastnet Software Ltd. This is free ++software, and as such comes with NO WARRANTY. No dates are used in this ++module. You may distribute this module under the terms of either the ++Gnu GPL, or under specific licencing from Fastnet Software Ltd. ++Special free licencing consideration will be given to similarly free ++software. Please don't flame me for this licence - I've put a lot of ++hours into this code, and if someone uses my software in their product ++I expect them to have the courtesy to contact me first. ++ ++Full support for this module is available from Fastnet Software Ltd on ++a pay per incident basis. Alternatively subscribe to the Perl-XML ++mailing list by mailing lyris@activestate.com with the text: ++ ++ SUBSCRIBE Perl-XML ++ ++in the body of the message. There are lots of friendly people on the ++list, including myself, and we'll be glad to get you started. ++ ++Matt Sergeant, matt@sergeant.org ++ ++This man page was added as well as some serious modifications to the script ++by Fabien Ninoles for the Debian Project. ++ ++=cut