Makefile.PL: installing multiple scripts and binaries

Given Makefile.PL , how can I install two binary files and two scripts in four different places?

To be more precise, the directory structure is as follows:

  • Library / my _package / main.pl
  • bin / daemon / daemon.pl (*)
  • bin / plugin / plugin.pl (*)
  • scripts / conf / conf.sh (*)
  • scripts / init / initd.sh (*)
  • Makefile.PL

Files marked with (*) must be installed in the following ways:

  • /usr/sbin/daemon.pl
  • /var/qmail/smtpplugins/plugin.pl
  • /usr/local/conf.sh
  • /etc/init.d/initd.sh

and the contents of my Makefile.PL

 use ExtUtils::MakeMaker; WriteMakefile( NAME => "my_package", VERSION_FROM => "lib/my_package/main.pl" ); 

What will I say perl through Makefile.PL to install these four files in the appropriate directories?

+4
source share
2 answers

If you switch to Module::Build , you can just use install_path .

0
source

Two ideas from the ExtUtils::MakeMaker :

Use the PL_FILES parameter. To PL_FILES => {'bin/install.PL' => 'an-arg'} documentation: PL_FILES => {'bin/install.PL' => 'an-arg'} will run bin/foobar.PL as perl bin/installPL an-arg

Or MakeMaker adds a new target to the generated makefile using the postamble function.

Or, yes, Module::Install or Dist::Zilla (perhaps another Perl module to do this since the last time I looked, a living little language that it is).

+1
source

All Articles