[sf-perl] Mason applications and Module::Build

Jonathan Swartz swartz at pobox.com
Sat Mar 6 11:08:06 PST 2010


I've heard that Catalyst web apps are designed to be easily packaged  
up in this way, you could take a look at what they've done.

You might also ask this question on the Mason user's list.

Jon

On Mar 6, 2010, at 10:32 AM, Keefer, Tim wrote:

> Hi,
>
> Does anyone know if there's already some code that supports bundling  
> HTML::Mason or other perl web applications into a CPAN distribution?  
> I've written a Module::Build subclass that works really well for me  
> and I'm wondering if it would be useful for others. I'm also looking  
> for advice about what CPAN namespace it could go under. However, I  
> don't want to go through the trouble of putting this on CPAN if  
> there's already something that does this. Below is a section of the  
> docs that should give you a better idea of what I'm talking about.
>
> I realize you guys had a meetup a few weeks ago which would have  
> been a great place to bring this up. I tried to travel up for it,  
> but I'm all the way down in the south part of the bay area and  
> couldn't make it.
>
> Cheers,
> -Tim
>
> =head1 Name
>
> {some name} - a subclass of Module::Build to perform custom installs
>
> =head1 Description
>
> Use this module instead of Module::Build (which it subclasses).  Use
> any or all of the Module::Build constructor keys as needed.
>
> =head1 Setting Up Your Application
>
> =head2 Application Layout
>
> This the typical directory structure for an application
>
>    Apps-MyApp/
>    	Build.PL
>    	Changes
>    	MANIFEST
>    	MANIFEST.SKIP
>    	INSTALL.SKIP
>    	conf/
>    		_app.conf
>    		_myapachevhost.conf
>    		app.rules
>    	html/
>    		autohandler.mpl
>    		css/
>    		img/
>    		inc/
>    			footer.html
>    			header.html
>    		index.html
>    	lib/
>    		Apps/
>                        MyApp.pm
>    			MyApp/
>    			   Foo.pm
>    	t/
>    		01use.t
>    		02myapp.t
>
> =head2 Build and Deploy
>
>    perl Build.PL
>    ./Build test     # runs the application tests
>    ./Build install  # install the application
>    ./Build dist     # build the application tarbal
>
> =over 4
>
> =head1 Setting up the application's Aeon Build.PL script
>
> =over 4
>
> =item Sample Build.PL
>
>    use strict;
>    use File::HomeDir;
>
>    my $build = {some name}->new(
>        install_base_default => ( File::HomeDir->my_home . "/ 
> releases" ),
>        get_options => {
>            env   =>  { type => '=s' },
>            rules =>  { type => '=s' },
>            install_base  => { type => '=s' },
>        },
>        apache_conf        => 'conf/myapachevhost.conf',
>        license                => 'perl',
>        module_name        => 'Apps::MyApp',
>        requires           => {
>            'perl'         => '5.8.1',
>        },
>        create_makefile_pl  => 'passthrough',
>        dist_abstract => 'Mason site for Apps Foo',
>        script_files        => [ glob('bin/*') ],
>        'recursive_test_files' => 1,
>    );
>
>    $build->create_build_script;
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm



More information about the SanFrancisco-pm mailing list