package Module::Install::Catalyst;
use strict;
-use base 'Module::Install::Base';
+
+our @ISA;
+require Module::Install::Base;
+@ISA = qw/Module::Install::Base/;
+
use File::Find;
use FindBin;
use File::Copy::Recursive 'rcopy';
our $ENGINE = 'CGI';
our $CORE = 0;
our $MULTIARCH = 0;
+our $SCRIPT;
our $USAGE;
=head1 NAME
push @files, $name;
}
closedir CATDIR;
- my @path = split '::', $self->name;
+ my @path = split '-', $self->name;
for my $orig (@files) {
my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig );
rcopy( $orig, $path );
sub catalyst_par_core {
my ( $self, $core ) = @_;
- $core ? ( $CORE = $core ) : $core++;
+ $core ? ( $CORE = $core ) : $CORE++;
}
=head2 catalyst_par_classes(@clases)
sub catalyst_par_multiarch {
my ( $self, $multiarch ) = @_;
- $multiarch ? ( $MULTIARCH = $multiarch ) : $multiarch++;
+ $multiarch ? ( $MULTIARCH = $multiarch ) : $MULTIARCH++;
+}
+
+=head2 catalyst_par_script($script)
+
+=cut
+
+sub catalyst_par_script {
+ my ( $self, $script ) = @_;
+ $SCRIPT = $script;
}
=head2 catalyst_par_usage($usage)
myapp $name\_cgi.pl
EOF
+ my $script = $Module::Install::Catalyst::SCRIPT;
my $tmp_file = IO::File->new("> $par_pl ");
print $tmp_file <<"EOF";
if ( \$ENV{PAR_PROGNAME} ) {
my \$zip = \$PAR::LibCache{\$ENV{PAR_PROGNAME}}
|| Archive::Zip->new(__FILE__);
- if (\@ARGV == 0 ) {
+ my \$script = '$script';
+ \$ARGV[0] ||= \$script if \$script;
+ if ( ( \@ARGV == 0 ) || ( \$ARGV[0] eq '-h' ) || ( \$ARGV[0] eq '-help' )) {
my \@members = \$zip->membersMatching('.*script/.*\.pl');
my \$list = " Available scripts:\\n";
for my \$member ( \@members ) {