One of the major bugs I'm aiming to fix in MakeMaker before 5.8 is the
behavior of PREFIX and LIB.  In a nutshell, if you set the PREFIX for
a module installation you are currently *not* guaranteed that all the
files will be installed under that PREFIX.

Here is a full description of the problem.
http:[EMAIL PROTECTED]/msg00157.html

This is a fundemental bug in the algorithm that MakeMaker uses.  MM
tries to make your local man and lib directories mirror the structure
of the system's.  So if you've got man pages in /usr/man it will put
them into PREFIX/man.  If you've got libraries in
/usr/local/lib/perl5/ it will put them into PREFIX/lib/perl5.

The problem comes from assumptions about what your perl installation
looks like.  Without going into too much detail (see the URL above)
MakeMaker has assumptions about what your man and lib directories look
like ($Config{prefix}/man or $Config{prefix}/lib/perl5/man, for
example) and if they don't match that it gets confused and doesn't
apply the PREFIX at all!

This trips up on obscure, little used operating systems like Debian. :)
(Debian applies special patches to make it work).


So here's how I'm reshaping the algorithm.  I believe the basic idea
of your local directory structure mirroring the system's structure to
be sound.  So...

    First, it looks for existing directories in the usual spots.
    PREFIX/man or PREFIX/lib/perl5/man for example.  If they exist,
    it will use them.  This is a concession to backward compatibilty.
    (I think it does this currently anyway, but for different reasons)

    If that doesn't work, it will simply take each relevent %Config
    variable (for example, $Config{installman3dir}) and simply do:
    s{$Config{prefix}}{\$\(PREFIX\)};  So /usr/share/man/man3 becomes
    $(PREFIX)/share/man/man3.

    If for some wacky reason you've got things configured to be
    outside your prefix (/var/man/man3, for example) it will fallback
    to a hardcoded structure of our choosing.  Currently I'm likely
    to use:

        $(PREFIX)/lib/perl5/
        $(PREFIX)/bin/
        $(PREFIX)/man/

This at least ensures that if you say PREFIX you're *guaranteed* that
everything will wind up under that prefix.


Opinions?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Tasty, yet morally ambiguous.

Reply via email to