Update of /cvsroot/perl-xml/xml-simple
In directory sc8-pr-cvs1:/tmp/cvs-serv31720
Modified Files:
Makefile.PL
Log Message:
- complete rewrite in the hope of getting CPAN.pm to see XML::SAX as a prerequisite if no parser installed
Index: Makefile.PL
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/Makefile.PL,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile.PL 8 Dec 2002 04:06:30 -0000 1.5
+++ Makefile.PL 9 Sep 2003 09:37:15 -0000 1.6
@@ -2,73 +2,41 @@
use ExtUtils::MakeMaker;
-my $parser_count = 0;
-my $fatal = 0;
-
-print "Checking for required modules ...\n";
-
-eval { require XML::SAX };
-if($@) {
- print "XML::SAX is not installed\n";
-}
-else {
- print "XML::SAX is installed ... good\n";
- $parser_count++;
-
- eval { require XML::NamespaceSupport };
- if($@) {
- print "XML::NamespaceSupport is not installed ... this is required only for generating XML with namespace declarations\n";
- }
- else {
- if($XML::NamespaceSupport::VERSION < 1.04) {
- print "You must upgrade XML::NamespaceSupport to version 1.04 or better\n";
- $fatal++;
- }
- else {
- print "XML::NamespaceSupport is installed ... good\n";
- }
- }
+my $make_params = {
+ 'NAME' => 'XML::Simple',
+ 'VERSION_FROM' => 'lib/XML/Simple.pm',
+ 'DISTNAME' => 'XML-Simple',
+ 'PREREQ_PM' => {
+ Test::Simple => 0.41,
+ },
+ 'dist' => { COMPRESS => 'gzip --best', SUFFIX => 'gz' },
+ ($] >= 5.005 ? (
+ 'AUTHOR' => 'Grant McLean <gr...@cp...>',
+ 'ABSTRACT_FROM' => 'lib/XML/Simple.pm',
+ ) : () )
+};
-}
+print "Checking installed modules ...\n";
-eval { require XML::Parser };
-if($@) {
- print "XML::Parser is not installed\n";
+if ( eval { require XML::SAX } && ! $@ ) {
+ print "XML::SAX is installed, it will be used by the test suite\n";
+ $make_params->{PREREQ_PM}->{'XML::SAX'} = 0;
+ $make_params->{PREREQ_PM}->{'XML::NamespaceSupport'} = 1.04;
}
+elsif ( eval { require XML::Parser } && ! $@ ) {
+ print "XML::Parser is installed, it will be used by the test suite\n";
+ $make_params->{PREREQ_PM}->{'XML::Parser'} = 0;
+}
else {
- print "XML::Parser is installed ... good\n";
- $parser_count++;
+ print "You don't have either XML::SAX or XML::Parser installed!\n";
+ $make_params->{PREREQ_PM}->{'XML::SAX'} = 0;
+ $make_params->{PREREQ_PM}->{'XML::NamespaceSupport'} = 1.04;
}
eval { require Storable };
if($@) {
print "Storable is not installed ... caching functions will not be available\n";
}
-else {
- print "Storable is installed ... good\n";
-}
-
-
-unless($parser_count) {
- print "You must install either XML::SAX or XML::Parser before XML::Simple\n";
- $fatal++;
-}
-if($fatal) {
- print "You must correct the above problems before XML::Simple can be installed\n";
- exit(1);
-}
-WriteMakefile(
- 'NAME' => 'XML::Simple',
- 'VERSION_FROM' => 'lib/XML/Simple.pm',
- 'DISTNAME' => 'XML-Simple',
- 'PREREQ_PM' => {
- Test::Simple => 0.41,
- },
- 'dist' => { COMPRESS => 'gzip --best', SUFFIX => 'gz' },
- ($] >= 5.005 ? (
- 'AUTHOR' => 'Grant McLean <gr...@cp...>',
- 'ABSTRACT_FROM' => 'lib/XML/Simple.pm',
- ) : () )
-);
+WriteMakefile(%$make_params);
|