Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Installation script

by andreychek (Parson)
on Jun 08, 2001 at 17:18 UTC ( #86892=note: print w/replies, xml ) Need Help??

in reply to Installation script

As much criticism as it often gets, I personally have found the
Slash code to be a good example, particularly in this area.

Slashcode has to download required modules, create directories,
modify permissions, creates DB tables, and I believe it may even change a config script somewhere,
but don't quote me on that.

In the root directory of the distribution, they have a typical
Makefile that you might see in say, a C program. It begins copying some
files into place, modifying permissions, and that sort of thing.
But then it recurses through all the Perl directories, and runs the Makefile.PL
files in those directories, which each use ExtUtils::MakeMaker.

I don't remember how slash does it, but MakeMaker is often what is used to
create dependencies for your application. If it doesn't do what
you need, you can also use the CPAN module and just do something like:
use CPAN; my @required_modules = qw(CGI XML::Parser HTML::Template); foreach my $module ( @required_modules ) { print "Checking for $module"; eval "require $module"; if($@) { print "failed\n"; print "$module does not seem to be present! I'll install it now +.\n"; CPAN::Shell->install($module); } }
You can just put those lines in your Makefile.PL. HTH

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://86892]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2018-04-22 09:52 GMT
Find Nodes?
    Voting Booth?