This works for me in a linux/bsd environment:
I have a vendor directory which holds all the tar.gz's from cpan, and a makefile
Makefile:
PWD = $(shell pwd) CACHE_DIR ?= cache PERL = $(shell which perl) BUILD_INCS = -I $(PWD)/$(CACHE_DIR)/lib/perl5 INSTALL_TARGET ?= $(PWD)/$(CACHE_DIR) MAKEFILE_PL_ARGS = INSTALL_BASE=$(INSTALL_TARGET) PERL="$(PERL) $(BUIL +D_INCS)" TGZFILES = $(wildcard *.tar.gz) DEPENDS_ORDER2 = $(shell cat install_order) $(TGZFILES) # remove duplicates DEPENDS_ORDER = $(shell perl -e '@b=grep{!$$s{$$_}++} @ARGV;print "@b" +' $(DEPENDS_ORDER2)) # this gets a list of all the directories that the .tar.gz files unpac +k into UNPACK_DIRS = $(shell for t in $(DEPENDS_ORDER);do for f in `tar tzf $ +$t`;do R="$$R $$f/";break;done;done;echo $$R) BLIBS = $(patsubst %/,%/blib,$(UNPACK_DIRS)) # we want to link to gmake here, unless it is not available GMAKE = $(firstword $(shell which gmake) $(shell which $(MAKE)) ) PATH = $(PWD)/bin:$(shell echo $$PATH) .PHONY: all clean install $(TGZFILES) all: @ echo ------------------------------------------- @ echo "TGZFILES: $(TGZFILES)" @ echo ------------------------------------------- @ echo "DEPENDS_ORDER: $(DEPENDS_ORDER)" @ echo ------------------------------------------- @ echo "UNPACK_DIRS: $(UNPACK_DIRS)" @ echo ------------------------------------------- @ echo "BLIBS: $(BLIBS)" @ echo ------------------------------------------- @ echo "BUILD_INCS: $(BUILD_INCS)" @ echo ------------------------------------------- $(UNPACK_DIRS): @ echo unpacking $@ @ echo -n " " tar xfz $(@).tar.gz @ for patch_file in patches/*.$(@).tar.gz.*.patch; do \ if [ ! -e $$patch_file ]; then \ echo " No patches found for $(@).tar.gz"; \ continue; \ fi; \ echo " Running patch $$patch_file: "; \ patch -p1 < $$patch_file; \ done; @ echo " Making makefile $@ in $@"; @ cd $@ && TipTop=1 PERL_MM_USE_DEFAULT=1 perl $(BUILD_INCS) Makef +ile.PL $(MAKEFILE_PL_ARGS) >> build.log; @ echo " Making blib $@ in $@"; @ $(MAKE) -C $@ all >>build.log # ARCH=1 is to override BSDPAN (hateful software) @ echo " Installing $(@) into $(INSTALL_TARGET)" @ $(MAKE) -C $@ pure_install ARCH=1 >> build.log # force the use of gmake by putting it first in the path ENV: rm -rf bin/make ln -sf $(GMAKE) bin/make $(CACHE_DIR): ENV $(UNPACK_DIRS) install: $(CACHE_DIR) @ echo "Copying $(CACHE_DIR) to $(TARGET)"; mkdir -p $(TARGET)/ cp -Rf $(CACHE_DIR)/lib/perl5/* $(TARGET)/ @ touch $(CACHE_DIR) clean: rm -rf $(UNPACK_DIRS) rm -rf $(CACHE_DIR) rm -f ./build.log
I can pretty much just add modules to the vendor directory and it picks it up.

Some modules depend on others so there is an 'install_order' file that lists the order those modules should be installed.

I also have a patches directory in case I need to patch the cpan modules before they get built.

I call this from my main makefile like this:
$(MAKE) -C $(VENDOR_DIR) install TARGET=$(LOCAL_BUILD_TARGET)/lib/

In reply to Re: Installing a group of .tar.gz format perl modules by thinc
in thread Installing a group of .tar.gz format perl modules by duncs

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.