in reply to Install "other files" with Makefile.pl

In Makefile.PL use File::ShareDir::Install, in your module/program use File::ShareDir to locate the default config file, File::HomeDir for user config overrides ...

If you want a ExtUtils::MakeMaker generated file to install something in /etc, you have to write a "postamble" (in make syntax)

FWIW, I haven't seen any CPAN modules that write in /etc, and AFAIK, that is best left to administrators

  • Comment on Re: Install "other files" with Makefile.pl

Replies are listed 'Best First'.
Re^2: Install "other files" with Makefile.pl
by grewil (Novice) on May 11, 2011 at 11:54 UTC

    Thank you both for your suggestions. I have tried to look into the options presented, but as they involve somewhat complicated changes, I will need to spend a good deal of time on this to understand it and do it correctly.

    I actually have not only the config file, but also a directory of data files that I would like to have installed along with the modules. I am hoping to find a way to do that too, and perhaps I can by following your advice above.

    Naively, I hoped I could somehow write a piece of Makefile somewhere, with just this in it, and get it executed by some general install-hook:

    install: cp -r data/ $PREFIX/share/my-data