recommends => {
'Catalyst::Engine::Apache' => '1.00',
FCGI => 0,
- 'FCGI::ProcManager' => 0
+ 'FCGI::ProcManager' => 0,
+ PAR => 0
},
create_makefile_pl => 'passthrough',
create_readme => 1,
qq/ Install "FCGI::ProcManager" for multiprocess FastCGI external support.\n/
if ($@);
}
+eval "use PAR ()";
+print qq/ Install "PAR" for PAR packaging support.\n/ if $@;
print <<"EOF";
This file documents the revision history for Perl extension Catalyst.
+5.57
+ - Added PAR support
+
5.56 2005-11-16 10:33:00
- Fixed FastCGI engine to not clobber the global %ENV on each
request. (Sam Vilain)
require Module::Pluggable::Fast;
# Helper script generation
-our $CATALYST_SCRIPT_GEN = 12;
+our $CATALYST_SCRIPT_GEN = 13;
__PACKAGE__->mk_classdata($_)
for qw/components arguments dispatcher engine log dispatcher_class
__PACKAGE__->request_class('Catalyst::Request');
__PACKAGE__->response_class('Catalyst::Response');
-our $VERSION = '5.56';
+our $VERSION = '5.57';
sub import {
my ( $class, @arguments ) = @_;
$self->_mk_apptest;
$self->_mk_images;
$self->_mk_favicon;
+ $self->_mk_package;
}
$self->_mk_cgi;
$self->_mk_fastcgi;
}
+sub _mk_package {
+ my $self = shift;
+ my $script = $self->{script};
+ my $appprefix = $self->{appprefix};
+ $self->render_file( 'package', "$script\/$appprefix\_package.pl" );
+ chmod 0700, "$script/$appprefix\_package.pl";
+}
+
=head1 HELPERS
Helpers are classes that provide two methods.
=head1 AUTHOR
-Sebastian Riedel, C<sri\@oook.de>
+Sebastian Riedel, C<sri@oook.de>
+
+=head1 COPYRIGHT
+
+Copyright 2004 Sebastian Riedel. All rights reserved.
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+__package__
+[% startperl %] -w
+
+use strict;
+use Getopt::Long;
+use Pod::Usage;
+use Catalyst::PAR;
+
+my $help = 0;
+
+GetOptions( 'help|?' => \$help );
+
+pod2usage(1) if $help;
+
+my $par = Catalyst::PAR->new->package( {
+ par => $ARGV[0] || '[% appprefix %].par',
+ engine => $ARGV[1],
+ class => '[% name %]'
+} );
+
+1;
+
+=head1 NAME
+
+[% appprefix %]_package.pl - Package a Catalyst application
+
+=head1 SYNOPSIS
+
+[% appprefix %]_package.pl [par] [engine]
+
+ Options:
+ -help display this help and exits
+
+ Examples:
+ [% appprefix %]_package.pl [% appprefix %].par FastCGI
+ [% appprefix %]_package.pl foo_linux_i386_apache2.par Apache2
+
+ See also:
+ perldoc Catalyst::Manual
+ perldoc Catalyst::Manual::Intro
+ perldoc pp
+
+=head1 DESCRIPTION
+
+Package a Catalyst application with L<PAR>.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri@oook.de>
=head1 COPYRIGHT
--- /dev/null
+package Catalyst::PAR;
+
+use strict;
+use base 'Class::Accessor::Fast';
+use FindBin;
+use IO::File;
+use File::Spec;
+require Catalyst;
+
+=head1 NAME
+
+Catalyst::PAR - Package Catalyst Applications
+
+=head1 SYNOPSIS
+
+See L<Catalyst>
+
+=head1 DESCRIPTION
+
+Package Catalyst Applications.
+
+=head1 METHODS
+
+=over 4
+
+=item $self->package( $par, $engine )
+
+=cut
+
+sub package {
+ my ( $self, $options ) = @_;
+
+ my $par = $options->{par} || 'application.par';
+ my $engine = $options->{engine} || 'CGI';
+
+ # Check for PAR
+ eval "use PAR ()";
+ die "Please install PAR" if $@;
+ eval "use PAR::Packer ()";
+ die "Please install PAR::Packer" if $@;
+ eval "use App::Packer::PAR ()";
+ die "Please install App::Packer::PAR" if $@;
+ eval "use Module::ScanDeps ()";
+ die "Please install Module::ScanDeps" if $@;
+
+ my $par_test = File::Spec->catfile( $FindBin::Bin, '..', 'par_test.pl' );
+ unlink $par_test;
+
+ my $class = $options->{class};
+ my $tmp_file = IO::File->new("> $par_test");
+ print $tmp_file <<"EOF";
+BEGIN { \$ENV{CATALYST_ENGINE} = '$engine' };
+use FindBin;
+use lib 'lib';
+use $class;
+EOF
+ $tmp_file->close;
+
+# my $main = File::Spec->catfile( $FindBin::Bin, 'main.pl' );
+# unlink $main;
+
+# my $version = $Catalyst::VERSION;
+# my $main_file = IO::File->new("> $main");
+# print $main_file <<"EOF";
+#print "$class on Catalyst $version.\\n";
+#EOF
+# $main_file->close;
+
+ chdir File::Spec->catdir( $FindBin::Bin, '..' );
+ my %opt = ( 'x' => 1, 'n' => 0, 'o' => $par, 'a' => ['.'] );
+ App::Packer::PAR->new(
+ frontend => 'Module::ScanDeps',
+ backend => 'PAR::Packer',
+ frontopts => \%opt,
+ backopts => \%opt,
+ args => [ 'par_test.pl' ],
+ )->go;
+
+ unlink $par_test;
+# unlink $main;
+}
+
+=back
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri@oook.de>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
+1;