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

Dear monks,

I am preparing a module and it comes with a script that Makefile uses to build some stuff. That script can come in handy to the user. Is there a standard way to provide a script along with a module? I can't find a standard directory where I should tell Makefile to copy it upon make install.

Update: $INST_SCRIPT. Found it. Please ignore this. :-)

Replies are listed 'Best First'.
Re: distributing a script with a module
by eserte (Deacon) on Nov 21, 2007 at 23:37 UTC
    Don't deal directly with $INST_SCRIPT. Just specify the scripts to install with EXE_FILES => [...] in the Makefile.PL.
Re: distributing a script with a module
by salva (Canon) on Nov 22, 2007 at 08:54 UTC
    You have to use EXE_FILES.

    From ExtUtils::MakeMaker documentation:

    EXE_FILES

    Ref to array of executable files. The files will be copied to the INST_SCRIPT directory. Make realclean will delete them from there again.

    If your executables start with something like #!perl or #!/usr/bin/perl MakeMaker will change this to the path of the perl 'Makefile.PL' was invoked with so the programs will be sure to run properly even if perl is not in /usr/bin/perl.

    And MAN1PODS will allow you to install a man page for the script.

    For instance:

    WriteMakeFile( ... EXE_FILES => [qw(bin/foo)], MAN1PODS => {qw(bin/foo $(INST_MAN1DIR)/foo.1)} );