Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Installing templates or other static files with ExtUtils::MakeMaker

by tmaly (Monk)
on Mar 17, 2014 at 15:41 UTC ( [id://1078617]=perlquestion: print w/replies, xml ) Need Help??

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

Monks


Is there an example or way to include template toolkit templates in a module distribution and install them in a specific location?


I only have access to ExtUtils::MakeMaker in the environment I am working in, so I would not be able to use Module::Install


I came across this post, but it does not use ExtUtils::MakeMaker Makefile.PL and data files


Best regards
-Ty

  • Comment on Installing templates or other static files with ExtUtils::MakeMaker

Replies are listed 'Best First'.
Re: Installing templates or other static files with ExtUtils::MakeMaker
by djerius (Beadle) on Mar 17, 2014 at 18:28 UTC
    I only have access to ExtUtils::MakeMaker in the environment I am working in, so I would not be able to use Module::Install

    By this, may I assume that you are not allowed to install modules from CPAN in your development environment? (I ask because the relevant parts of Module::Install required for installation are bundled with the distribution. The only dependency when deployed is ExtUtils::MakeMaker).

    If this assumption is correct, one approach would be to add a new target to your Makefile.PL; see the end of the Overriding MakeMaker Methods section in ExtUtils::MakeMaker. You might use the code in Module::Install::Share as a starting point, as that's the approach it takes.

      I considered overriding the makemaker methods, but I was hoping for a cleaner approach if one existed.

      I will take a look at the code for Module::Install::Share


      Thank you

Re: Installing templates or other static files with ExtUtils::MakeMaker
by Anonymous Monk on Mar 18, 2014 at 07:21 UTC

    I only have access to ExtUtils::MakeMaker in the environment I am working in, so I would not be able to use Module::Install

    cool, then copy/paste what File::ShareDir::Install does

      No need to copy and paste it. Just use it. It's a small, self-contained, pure Perl module with no non-core dependencies, so you could just bundle it in the distributed tarball as inc/File/ShareDir/Install.pm, and load it like:

      use lib "inc"; use File::ShareDir::Install;
      use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1078617]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-24 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found