in reply to CPAN to install Applications

We use Module::Build, with a small bit of code it handles templates, style sheets, or anything else we think of. It handles executables natively (as does MakeMaker).

This combined with our own CPAN::Mini leads to clean deployment on many boxes.

Phil

Replies are listed 'Best First'.
Re^2: CPAN to install Applications
by Herkum (Parson) on Mar 10, 2006 at 17:10 UTC

    Where would declare your code for calling the executable?

    I can write a script to install the templates to a location but I cannot found in the documentation where you set a script to that is run during the ./Build install process.

      There are two types of things to install: executables and other things. For executables simply add a scripts key to your hash:
      use Module::Build; my $build = Module::Build->new( module_name => 'YourName', # ... script_files => [ qw( your scripts here ) ], #... ); $build->create_build_script;
      To do other things takes a bit more work:
      my $subclass = Module::Build->subclass( class => 'My::Builder', code => &_custom_code(), ); my $build = $subclass->new( module_name => 'YourName', script_files => [ qw( same as above ) ], #... ); $build->create_build_script; sub _custom_code { return <<'EO_CODE'; sub ACTION_install { # do whatever you want at the end of install } EO_CODE }
      Note that shelling out to other scripts is probably not ideal (but is legal). Rather, we code all the file copying, etc in the Build.PL using pure Perl.

      Phil