EU:MM and custom installation path

Discussion in 'Perl Misc' started by Teo, Oct 26, 2007.

  1. Teo

    Teo Guest

    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::plugin' => 0;
    requires 'Nagios::plugin::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
     
    Teo, Oct 26, 2007
    #1
    1. Advertising

  2. Teo

    Ben Morrow Guest

    Quoth Teo <>:
    >
    > 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::plugin' => 0;
    > requires 'Nagios::plugin::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
     
    Ben Morrow, Oct 26, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moid
    Replies:
    0
    Views:
    327
  2. Luis Esteban Valencia Muñoz
    Replies:
    0
    Views:
    506
    Luis Esteban Valencia Muñoz
    May 23, 2005
  3. Russ
    Replies:
    3
    Views:
    378
    Gabriel Genellina
    Feb 21, 2007
  4. Javier Collado
    Replies:
    5
    Views:
    322
    Lawrence D'Oliveiro
    Jul 2, 2009
  5. Arno Broeders
    Replies:
    1
    Views:
    140
Loading...

Share This Page