Added perl-XML-SAX-0.96 template.

--HG--
extra : convert_revision : 2c1f22ac7ada8ca0c31292203aa89e0fb96b1673
This commit is contained in:
Juan RP 2009-04-21 19:21:38 +02:00
parent 5824750120
commit 5f4c4ef370
4 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#
# This script registers the SAX parser into the registry.
#
case "${ACTION}" in
pre)
;;
post)
env LC_ALL=C perl -MXML::SAX -e \
"XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()" \
2>&1 >/dev/null
[ $? -eq 0 ] && echo "Added parser to XML::SAX registry."
;;
esac

View File

@ -0,0 +1,13 @@
#
# This script unregisters the SAX parser into the registry.
#
case "${ACTION}" in
pre)
env LC_ALL=C perl -MXML::SAX -e \
"XML::SAX->remove_parser(q(XML::SAX::PurePerl))->save_parsers()" \
2>&1 >/dev/null
[ $? -eq 0 ] && echo "Removed parser from XML::SAX registry."
;;
post)
;;
esac

View File

@ -0,0 +1,49 @@
Disable asking/registering the parser at install time, we do this
in the INSTALL/REMOVE scripts.
--- Makefile.PL.orig 2009-04-21 19:00:26.282249017 +0200
+++ Makefile.PL 2009-04-21 19:00:33.901197702 +0200
@@ -11,43 +11,3 @@ WriteMakefile(
'XML::NamespaceSupport' => 0.03,
},
);
-
-sub MY::install {
- package MY;
- my $script = shift->SUPER::install(@_);
-
- # Only modify existing ParserDetails.ini if user agrees
-
- my $write_ini_ok = 0;
-
- eval { require XML::SAX };
- if ($@) {
- $write_ini_ok = 1;
- }
- else {
- my $dir = File::Basename::dirname($INC{'XML/SAX.pm'});
- if (-e File::Spec->catfile($dir, 'SAX', 'ParserDetails.ini')) {
- $write_ini_ok =
- ExtUtils::MakeMaker::prompt(
- "Do you want XML::SAX to alter ParserDetails.ini?", "Y"
- ) =~ /^y/i;
- }
- else {
- $write_ini_ok = 1;
- }
- }
-
- if ($write_ini_ok) {
- $script =~ s/install :: (.*)$/install :: $1 install_sax_pureperl/m;
- $script .= <<"INSTALL";
-
-install_sax_pureperl :
-\t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"
-
-INSTALL
-
- }
-
- return $script;
-}
-

View File

@ -0,0 +1,16 @@
# Template build file for 'perl-XML-SAX'.
pkgname=perl-XML-SAX
version=0.96
wrksrc="XML-SAX-$version"
distfiles="${CPAN_SITE}/XML/XML-SAX-$version.tar.gz"
build_style=perl_module
short_desc="Perl interface to the SAX2 XML Parser"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=9bbef613afa42c46df008d537decc5a61df7e92d65463f3c900769f39e5c8e08
long_desc="
This module provides ways to parse XML documents. It is built on top of
XML::SAX::Expat, which is a lower level interface to James Clark's
expat library."
Add_dependency full perl
Add_dependency full perl-XML-NamespaceSupport