Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I am working on a project in perl, and in the future this 'framework' should be installed on x different servers (aix 5.1 - 5.3).
The systems have a default perl installed and I need +/- 20 extra modules.

I am now wondering on how I can get the modules installed on all these servers, without reinstalling them one by one. Most of the systems don't even have a compiler installed.

I sort of need a complete 'framework install' package => my code , my modules , the extra modules.


I've searched around with SS and found this thread Moving Perl from test to Dev

Isn't there a cleaner methode then copying the desired modules.
And the modules are somewhat trown around in the FS and I don't want to miss a file or come up with a semi working perl on the systems.
Because by compying the O/so files migth cause some problems if the systems differ a bit.

Thanks in advance,
  • Comment on installing many modules on different machines

Replies are listed 'Best First'.
Re: installing many modules on different machines
by Fletch (Bishop) on Jun 13, 2005 at 13:24 UTC

    Not a completely automated solution, but you could create your own Bundle::MyFramework module (which is basically just POD listing the modules to install) and then use CPAN install everything for you using that. It'd still compile each module separately on each machine but it'd be CPAN doing the work not you. See CPAN's docs for info on how to create a bundle.

    --
    We're looking for people in ATL

      Ok when I first started with this project I looked into CPAN installing , but since the perl version were are using on AIX is supplied by the system admins.
      It's version 5.6.0.1 ( 5.6.0 with dbi for oracle hacked into it I think).
      CPAN isn't configured on the systems so it don't even know if I will ever get it to work.
      so I am somewhat limited with the stuff they provide me with.

      but I will check it again
Re: installing many modules on different machines
by terce (Friar) on Jun 13, 2005 at 13:35 UTC
    Assuming it works on AIX (something about which I have no idea), might the simplest solution be to package your script(s) with PAR, which will package all the required codes, runtime and modules into an executable?

    Whilst the output file size can hardly be said to be small, I think it would resolve your issues with different layouts of file system on the different machines.

    There is a performance overhead as the .exe is unpacked every time it is called, but this may be acceptable for you depending on the function of your code.

    Hope this helps
Re: installing many modules on different machines
by mpeters (Chaplain) on Jun 13, 2005 at 13:39 UTC
    Krang does something very similar. It only assumes that you have perl and mysql installed and then it installs everything else in a local subdirectory. We have also ripped that design for at least 3 other projects and it's worked extremely well.

    There has been some talk of moving this install/upgrade framework outside of krang into a speparate project (matchstick) but it seems that everyone has become too busy to really get that sub project started. But I think it's an amazing idea that should be explored.

    More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier
Re: installing many modules on different machines
by thundergnat (Deacon) on Jun 13, 2005 at 15:59 UTC

    Something I have used before, (though not on aix systems, so may need adjustment,) is to use Module::ScanDeps to dump a list of the used modules to a file from the development computer, then iterate over the list, and use the CPAN module to install any unfound modules.

    use Module::ScanDeps; my $perl_script = 'whatever.pl'; my $hash_ref = scan_deps($perl_script); for (keys %$hash_ref){ print $_,"\n" if ( $$hash_ref{$_}{'file'} =~ m#/site/# and $_ =~ m +#\.pm# ); } # Only capture the name if it IS a module (.pm) and it # isn't in core, (path includes /site/). You may need # to modify the filter if your modules are in non-standard # places.

    Then take the list to the different computer and run it through this script:

    use CPAN; my @modules = # module list from the previous script for $mod (@modules){ my $obj = CPAN::Shell->expand('Module',$mod); $obj->install; }