diff --git a/templates/perl-XML-SAX/INSTALL b/templates/perl-XML-SAX/INSTALL new file mode 100644 index 00000000000..692f9314356 --- /dev/null +++ b/templates/perl-XML-SAX/INSTALL @@ -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 diff --git a/templates/perl-XML-SAX/REMOVE b/templates/perl-XML-SAX/REMOVE new file mode 100644 index 00000000000..f9537030d80 --- /dev/null +++ b/templates/perl-XML-SAX/REMOVE @@ -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 diff --git a/templates/perl-XML-SAX/install.diff b/templates/perl-XML-SAX/install.diff new file mode 100644 index 00000000000..7e13c806929 --- /dev/null +++ b/templates/perl-XML-SAX/install.diff @@ -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; +-} +- diff --git a/templates/perl-XML-SAX/template b/templates/perl-XML-SAX/template new file mode 100644 index 00000000000..67fbb995f65 --- /dev/null +++ b/templates/perl-XML-SAX/template @@ -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 " +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