1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
# $Id: /xmltwig/trunk/Makefile.PL 15 2007-05-28T12:15:34.346294Z mrodrigu $
# tool installation part shamelessly lifted from YAML's Makefile.PL
use ExtUtils::MakeMaker;
my @prompts=(
[ xml_pp => y => "XML pretty printer" ],
[ xml_grep => y => "XML grep - grep XML files using XML::Twig's subset of XPath" ],
[ xml_split => y => "split big XML files" ],
[ xml_merge => y => "merge back files created by xml_split" ],
[ xml_spellcheck => y => "spellcheck XML files skipping tags" ],
);
my @programs;
if( $ARGV[0] eq "-n")
{ @programs=(); }
elsif( $ARGV[0] eq "-y")
{ @programs= map { $_->[0] } @prompts; }
elsif( $ARGV[0] eq "-d")
{ @programs= map { $_->[0] if( $_->[1] eq 'y') } @prompts; }
else
{ print "run 'perl Makefile.PL -y' to install all tools,\n",
" 'perl Makefile.PL -n' to skip installation\n";
foreach my $prompt (@prompts)
{ my ($program, $default, $description) = @$prompt;
if( prompt("Do you want to install '$program' ($description)?", $default) =~ /^y/)
{ push(@programs, $program); }
}
}
WriteMakefile(
NAME => 'XML::Twig',
ABSTRACT => 'XML, The Perl Way',
AUTHOR => 'Michel Rodriguez <mirod@xmltwig.com>',
EXE_FILES => [ map {"tools/$_/$_"} @programs],
VERSION_FROM => 'Twig.pm', # finds $VERSION
PREREQ_PM => { 'XML::Parser' => '2.23' },
dist => { COMPRESS => 'gzip -9f',
SUFFIX => 'gz',
},
depend => { 'Twig.pm' => "FORCE\n\t\$(PERL) speedup Twig_pm.slow > Twig.pm\n\t\$(PERL) -i_bak -p filter_for_5.005 Twig.pm Twig/XPath.pm\n\t\$(PERL) check_optional_modules",
'FORCE' => '',
license => 'perl',
},
);
|