It seems that MakeMaker (and CPAN in general) are not geared for anything except binaries and libraries installation.

I think that it really is a shame, because it would not be very hard to extend them so that they would have more features of general application installation programs (rpm, etc.).

The result of this is that CPAN discourages anyone from using it for programs that are even remotely complex (e.g., programs that have template files, configuration files, data files, etc.).

All that said, I *do* use E:MM in the very way that I'm saying you can't (and probably shouldn't), because I don't want to distribute my program via rpm, etc. Here is what I do for Business::Shipping...

my %my_globals = ( SUPPORT_FILES_DIR => '/var/perl/Business-Shipping' ); WriteMakefile( CONFIGURE => \&extra_WriteMakefile_options, ); # # Override the standard "install" target, so that it calls "support_fi +les_install" # sub MY::install { package MY; my $inherited = shift->SUPER::install(@_); my $new; for ( split( "\n", $inherited ) ) { if ( /^install :: / ) { $_ .= " support_files_install"; } $new .= "$_\n"; } return $new; } sub MY::postamble { return qq{ support_files_install : \@echo "Installing support files (database, configuration, etc.) t +o $my_globals{SUPPORT_FILES_DIR}" \@\$(MKPATH) $my_globals{SUPPORT_FILES_DIR}/data \@\$(MKPATH) $my_globals{SUPPORT_FILES_DIR}/config \@\$(CP) --recursive --force data/* $my_globals{SUPPORT_FILES_DI +R}/data/ \@\$(CP) --recursive --force config/* $my_globals{SUPPORT_FILES_DI +R}/config/ }; } sub extra_WriteMakefile_options { $my_globals{SUPPORT_FILES_DIR} = prompt( "\n" . " --- Business::Shipping support files directory --- +\n" . "\n" . "Business::Shipping has various support files for configu +ration, database, etc.\n" . "(The path to these files can be overridden later on a pe +r-user basis.)\n" . "I need to know the path to the \'system\' level, or \'de +fault\' files.\n" . "On many systems, this directory will only be accessible +by root.\n" . "\n" . "Business::Shipping default support files directory:", $my_globals{SUPPORT_FILES_DIR}, ); $my_globals{SUPPORT_FILES_DIR} =~ s:[\\/]\s*$::; $my_globals{SUPPORT_FILES_DIR} =~ s:^\s*::; my %X; #$X{ EXTRA_CONFIG_OPTION } = "value"; return \%X; }

I don't know if that helps you at all. It shows that you *can* do some stuff with E:MM, in a hacked sort of way (but you're probably not supposed to). I heard that you can do the above using Module::Build in a less-hacked sort of way.

-Dan


In reply to Re: Installing lots of things in different places with MakeMaker by danb
in thread Installing lots of things in different places with MakeMaker by ehdonhon

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.