http://qs321.pair.com?node_id=291950


in reply to non-CPAN module distributions

For the basic modularization stuff, I'm working on something similar.

Unfortunately ExtUtils::MakeMaker only really works when you have everything under a single module directory. I ended up making a top level prefix that matched my work name, and putting everything under that. The downside being that I had to change all the package lines, all the use lines, and everywhere that referenced that code. A few regex one-liners did the trick, but it was still a pain.

This solved many of the problems you listed. The source to my module is in CVS, and I can just do a cvs update. When you want to install, perl Makefile.PL LIB=/install/path works great, and only updates changed files.

You can also make a distribution tarball (make dist) to install on multiple machines, or just do cvs update and build on each machine - It only installs newer files.

That said, I'll be watching this thread for any alternate solutions. There is a MAKEFILE_PL option in MakeMaker for which the docs read "put other directories with Makefile.PL files in here". I'm thinking that might be used for a suite of modules with a master Makefile.PL. I'm not sure though.

Hope this helps.
~Jon

A few links that might help:
http://www.cpan.org/misc/cpan-faq.html#How_make_bundle http://search.cpan.org/author/MSCHWERN/ExtUtils-MakeMaker-6.17/lib/ExtUtils/MakeMaker/Tutorial.pod

Replies are listed 'Best First'.
Re: Re: non-CPAN module distributions
by perrin (Chancellor) on Sep 16, 2003 at 22:05 UTC
    You don't need to put them all in one directory, just make sure you don't use the ridiculous structure that h2xs creates. Schwern has talked about modifying h2xs at some point so that it will no longer do this. With a sane directory structure, you can check things out directly from CVS and use them right away without running make (assuming they are not XS modules), even if they are multiple directories deep. The structure shown in that tutorial you linked to is correct, and you'll note that it is different from what h2xs generates.
      Really? I've been having trouble with that. Any help you can provide would be appreciated.

      What do I set NAME to? If I set NAME to 'MyCorp', then it only installs modules in lib/MyCorp/, and totally ignores lib/OtherUtils/.

      I have a structure like:

      t/tests.t lib/MyCorp/Mod1.pm lib/MyCorp/Submodules/Mod2.pm lib/OtherUtil/Mod3.pm Makefile.PL bin/helperscript.pl
      The problem is, Mod1.pm and Mod2.pm get installed OK, but Mod3 is ignored. NAME in Makefile.PL is set to 'MyCorp'.

      Do I need multiple makefiles for this? aka:

      Makefile.PL (master) MyCorp/Makefile.PL MyCorp/lib/MyCorp/Mod1.pm OtherUtil/Makefile.PL OtherUtil/lib/OtherUtil/Mod3.pm

      The only way it works for me now, is if I put everything under MyCorp/.

      Thanks, ~Jon

        I don't think the NAME setting affects what gets installed at all. What happens when you set it to OtherUtil? There are definitely distributions on CPAN that have multiple module namespaces and they don't appear to be doing anything special in their Makefile.PL to accomplish this. Maybe you could post your Makefile.PL here?