perl-XML-SAX: New package.

This is a dependency of docbook2X which is required to generate manpages
for nftables.
This commit is contained in:
Stefan Schantl 2014-04-20 13:02:07 +02:00
parent a58cb9c885
commit 078ce55698
3 changed files with 138 additions and 0 deletions

View File

@ -0,0 +1,14 @@
#!/bin/sh
VERSION=$1
tar -xzvf XML-SAX-$VERSION.tar.gz
# xmltest.xml could not be distributed due to copyright
rm XML-SAX-$VERSION/testfiles/xmltest.xml
rm XML-SAX-$VERSION/t/16large.t
sed -i -e '/testfiles\/xmltest.xml/ d' XML-SAX-$VERSION/MANIFEST
sed -i -e '/t\/16large.t/ d' XML-SAX-$VERSION/MANIFEST
tar -czvf XML-SAX-$VERSION-nopatents.tar.gz XML-SAX-$VERSION

View File

@ -0,0 +1,42 @@
diff --git a/SAX/PurePerl.pm b/SAX/PurePerl.pm
--- a/SAX/PurePerl.pm 2006-04-24 01:20:09.000000000 +0200
+++ b/SAX/PurePerl.pm 2012-08-09 12:47:48.736728516 +0200
@@ -595,22 +595,23 @@ sub Comment {
my $data = $reader->data(4);
if ($data =~ /^<!--/) {
- $reader->move_along(4);
+ $reader->move_along(4); # skip comment start
+ $data = $reader->data;
+ while ($data !~ m!-->!) {
+ my $n = $reader->read_more;
+ $self->parser_error("End of data seen while looking for close comment marker", $reader)
+ unless $n;
+ $data = $reader->data;
+ }
+
my $comment_str = '';
- while (1) {
- my $data = $reader->data;
- $self->parser_error("End of data seen while looking for close comment marker", $reader)
- unless length($data);
- if ($data =~ /^(.*?)-->/s) {
- $comment_str .= $1;
- $self->parser_error("Invalid comment (dash)", $reader) if $comment_str =~ /-$/;
- $reader->move_along(length($1) + 3);
- last;
- }
- else {
- $comment_str .= $data;
- $reader->move_along(length($data));
- }
+ if ($data =~ /^(.*?)-->/s) {
+ $comment_str = $1;
+ $self->parser_error("Invalid comment (dash)", $reader) if $comment_str =~ /-$/;
+ $reader->move_along(length($1) + 3);
+ }
+ else {
+ return 0;
}
$self->comment({ Data => $comment_str });

View File

@ -0,0 +1,82 @@
###############################################################################
# IPFire.org - An Open Source Firewall Solution #
# Copyright (C) - IPFire Development Team <info@ipfire.org> #
###############################################################################
name = perl-XML-SAX
version = 0.99
release = 1
arch = noarch
thisapp = XML-SAX-%{version}
groups = Development/Libraries
url = http://search.cpan.org/dist/XML-SAX/
license = GPLv2+
summary = SAX parser access API for Perl.
description
Perl programs can use the SGMLSpm module to help convert SGML, HTML or XML
documents into new formats.
end
# Original source
# http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-%%{version}.tar.gz
#
# XML-SAX contains patented code that we cannot ship. Therefore we use
# a script to remove the patented code before shipping it.
#
# Download the upstream tarball and run the following script in the
# tarball's directory like this:
# ./generate-tarball.sh %%{version}
#
# Finally we have to store the new tarball on one of our source server.
sources = %{thisapp}-nopatents.tar.gz
build
requires
perl(base)
perl(Carp)
perl(constant)
perl(Encode)
perl(Exporter)
perl(ExtUtils::MakeMaker)
perl(Fatal)
perl(File::Path)
perl(File::Spec)
perl(File::Temp)
perl(IO::File)
perl(Test)
perl(XML::NamespaceSupport)
perl(XML::SAX::Base)
end
build
perl Makefile.PL INSTALLDIRS=vendor
make %{PARALLELISMFLAGS}
end
test
make test
end
install
make pure_install DESTDIR=%{BUILDROOT}
touch %{BUILDROOT}%{perl_vendorlib}/XML/SAX/ParserDetails.ini
end
end
packages
package %{name}
configfiles
%{perl_vendorlib}/XML/SAX/ParserDetails.ini
end
#Filter string for very weird dependencies.
filter_requires
XML::SAX::PurePerl
end
end
end