Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Automate CPAN install of Bundle::MySQL

by jlawrenc (Scribe)
on Sep 17, 2000 at 01:08 UTC ( [id://32839]=CUFP: print w/replies, xml ) Need Help??

You want to have a hands-off installation of a trickier-than-normal perl module such as MySQL. Here's how you can script the process.
When it comes time to actually build your MySQL module you need to do a few things.

  • Install DBI
  • Download Msql-MySQL module
  • Run "perl Makefile.PL" and answer questions
    or "perl Makefile.PL --options --options"
  • make
  • make test
  • make install
Fortunately the CPAN install command does most of this for you. You could actually just start a CPAN shell and type "install Bundle::Mysql". Wait and answer a few questions. My issue was the answer a few questions part. I'd like to go and have coffee to return with a fully built module. :)

Here's how (broken across lines to hopefully make more readable):

perl -MCPAN -e 'install Bundle::DBI; CPAN::Shell->o("conf","makepl_arg", "--mysql-install --nomsql-install --nomsql1-install --noprompt --mysql-incdir=/opt/include/mysql --mysql-libdir=/opt/lib/mysql"); install Mysql;' >/opt/src/config/logs/mysql-perlmod
A bit of a narrative:
  • perl -MCPAN -e
    Starts perl with CPAN module and will execute what's in quotes
  • 'install Bundle::DBI;
    The first perl statement. Should hopefully install all of the modules that makes DBI go in general.
  • CPAN::Shell->o("conf","makepl_arg",
    This took a bit of digging. This is the same as typing "o conf makepl_args..." at the cpan shell prompt which is to specify the arguments that we're gonna call "perl Makefile.PL" with.
  • "--mysql-install --nomsql-install --nomsql1-install --noprompt --mysql-incdir=/opt/include/mysql --mysql-libdir=/opt/lib/mysql");
    If you were to go to the msql-mysql module source directory and type "perl Makefile.PL" you'd eventually arrive at something like this. Of course your mileage will vary with the options that I've placed here.
  • install Mysql;' >/opt/src/config/logs/mysql-perlmod
    Last perl statement that will download, build, test, and install Mysql module. (plus log somewhere so we can see any problems after we've returned from coffee)

Replies are listed 'Best First'.
Re: Automate CPAN install of Bundle::MySQL
by Anonymous Monk on Oct 23, 2007 at 22:56 UTC
    The problem with this example is that as soon as you call "install", the makepl_args gets erased.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://32839]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-04-18 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found