Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > EU:MM and custom installation path

Reply
Thread Tools

EU:MM and custom installation path

 
 
Teo
Guest
Posts: n/a
 
      10-26-2007
Hi,

am using ExtUtils::MakeMaker for the distribution of a Perl script.
The Perl script (not a module a standalone script) is a plugin for a
software tool (Nagios) and has to be installed in a particular
location (e.g., /usr/lib/nagios/plugins/contrib) instead of the
canonical /usr/local/bin on a Unix platform.

This is how one of my many test Makefile.PL looks like:

# Load the Module::Install bundled in ./inc/
use inc::Module::Install;

################################################## ############################
# Define metadata (we read it from the binary)
name 'check_dir';
all_from 'check_dir';

################################################## ############################
# Specific dependencies
requires 'Carp' => 0;
requires 'English' => 0;
requires 'File::stat' => 0;
requires 'Getopt::Long' => 0;
requires 'Nagios:lugin' => 0;
requires 'Nagios:lugin::Threshold' => 0;
requires 'Pod::Usage' => 0;
requires 'version' => 0;

install_script 'check_dir';

WriteMakefile(
INSTALLDIRS => 'site',
INSTALLSITEBIN => '/usr/lib/nagios/plugins/contrib',
INSTALLSCRIPT => '/usr/lib/nagios/plugins/contrib',
);

I tried many combinations of INSTALLDIR values and INSTALL* variables
but I was never able to install the script in a place different from /
usr/local/bin.

Any hint?

Many thanks,

Matteo

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      10-26-2007

Quoth Teo <(E-Mail Removed)>:
>
> am using ExtUtils::MakeMaker for the distribution of a Perl script.


No, you're using Module::Install. The distinction is important.

> The Perl script (not a module a standalone script) is a plugin for a
> software tool (Nagios) and has to be installed in a particular
> location (e.g., /usr/lib/nagios/plugins/contrib) instead of the
> canonical /usr/local/bin on a Unix platform.
>
> This is how one of my many test Makefile.PL looks like:
>
> # Load the Module::Install bundled in ./inc/
> use inc::Module::Install;
>
> ################################################## ############################
> # Define metadata (we read it from the binary)
> name 'check_dir';
> all_from 'check_dir';
>
> ################################################## ############################
> # Specific dependencies
> requires 'Carp' => 0;
> requires 'English' => 0;
> requires 'File::stat' => 0;
> requires 'Getopt::Long' => 0;
> requires 'Nagios:lugin' => 0;
> requires 'Nagios:lugin::Threshold' => 0;
> requires 'Pod::Usage' => 0;
> requires 'version' => 0;
>
> install_script 'check_dir';
>
> WriteMakefile(
> INSTALLDIRS => 'site',
> INSTALLSITEBIN => '/usr/lib/nagios/plugins/contrib',
> INSTALLSCRIPT => '/usr/lib/nagios/plugins/contrib',
> );
>
> I tried many combinations of INSTALLDIR values and INSTALL* variables
> but I was never able to install the script in a place different from /
> usr/local/bin.
>
> Any hint?


The following works for me (in that it installs the script in the
correct place).

use inc::Module::Install;

name 'check_dir';
all_from 'check_dir';

install_script 'check_dir';

WriteMakefile(
INSTALLDIRS => 'site',
INSTALLSITESCRIPT => '/home/mauzo/foo',
);

auto_install;

Note that both 'auto_install' is required, or you don't get any
dependancies.

Ben

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making code run in both source tree and installation path Javier Collado Python 5 07-02-2009 05:53 AM
setup.py installation and module search path Russ Python 3 02-21-2007 06:22 AM
Custom Installation Project? Ask For Sql settings and execute script. and change web.config? Luis Esteban Valencia Muņoz ASP .Net 0 05-23-2005 09:43 PM
repost managed group: SSL and certification path installation from asp.net Arno Broeders ASP .Net Security 1 01-07-2004 02:35 AM



Advertisments