I've been doing something for a while now and I'm pretty sure this is wrong. I build a distribution tree for a device. Once the tree is complete I use mkcramfs to create a tiny image and then make it part of a package that can be written to the devices flash. Both the device and my workstation are x86 so cross-compiling is not an issue. When I make build perl I do it like this
make make DESTDIR=/tmp/perl install
I now have a perl tree in /tmp/perl that has the prefix of /opt/perl. To build modules I have them in my Makefile listed in order of dependence. I have each module untarred
ln -s /tmp/perl/opt/perl ${TEMPLATEE_ROOT}/opt/perl for i in each_module (cd $i && /opt/perl/bin/perl Makefile.PL && make install) done
I simplified the code above to simply show what I'm doing. Before I squash the template I remove that link and copy /tmp/perl/opt/perl into ${TEMPLATE_ROOT}/opt/.

What is the best way to do this?

1. Copy all my modules into the perl source tree and build it as part of the perl build?

2. Use CPAN to install them from the drive? Not online since I want to maintain module versions.

The only issue I see here is where I need to specify library paths, like when building DBD::mysql, or interacting when 'perl Makefile.PL' asks me a question. I can scrip that.

I do have my own MYMakefile in each module tree that takes care of using Build or Makefile.PL when required.

I can provide my makefile if needed so you can see what I'm doing. This method I'm using is a pain and hard to maintain as the modules numbers grow.

Thanks, Chris

In reply to Building CPAN modules for new tree by linxdev

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.