I don't like Perl::Install, it seems ambiguous. Example: Perl::Install::Java. Does this mean it installs Java? Perl::Install would then appear to be a base module for Perl::Install::Java.
How about Perl::Installation? It is a minor difference from Perl::Install; especially since there are so many Foo::Install modules but I do think it is a little clearer in what it is supposed to do.
As for dependencies Module::Build has calls for getting information from the user, it is called prompt().
Example from a Build.PL script I wrote, (Note: This is not a complete script).
my $code<<"END"; ## Your custom installation code goes here END; use Module::Build; my $class = Module::Build->subclass( class => 'Custom::Build', code => $code, ); my $builder = $class->new( # You need to add some of your stuff here! ) if ($builder->args('default') or $builder->args('quick-install')) { my %notes = _get_default_settings(); foreach (keys %notes) { $builder->notes( $_ => $notes{$_} ) } } else { my %notes = _get_prompt_settings(); foreach (keys %notes) { $builder->notes( $_ => $builder->prompt( $notes{$_}{message}, $notes{$_}{default} )) } } $builder->create_build_script(); exit; ################################################# sub _get_default_settings { warn "OS is $OSNAME\n"; if ($OSNAME eq 'MSWin32') { return ( config => 'c:/EEBL/tmp', cgi => 'c:/EEBL/tmp/cgi', tmpl => 'c:/EEBL/tmp/tmpl', url => '/EEBL', ) } else { return ( config => '/var/www/eebl', cgi => '/var/www/eebl/cgi', tmpl => '/var/www/eebl/tmpl', url => '/EEBL', ) }; }; ################################################# sub _get_prompt_settings { my %settings = _get_default_settings; return ( config => { message => 'Where will the config.txt file be installed?', default => $settings{config}, }, cgi => { message => 'Where will the cgi files be installed?', default => $settings{cgi}, }, tmpl => { message => 'Where will the template files be installed?', default => $settings{tmpl}, }, url => { message => 'What is the root url for the web site?', default => $settings{url}, }, ); }
Hope this gets your started.
In reply to Re: CPANization of a script for building Perl
by Herkum
in thread CPANization of a script for building Perl
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |