develooper Front page | perl.perl5.porters | Postings from January 2003

Re: MakeMaker problems with relocation

Michael G Schwern
January 1, 2003 14:11
Re: MakeMaker problems with relocation
Message ID:
On Wed, Jan 01, 2003 at 01:22:07PM -0700, Rob Brown wrote:
> Installing /tmp/fake-root/usr/lib/site_perl/5.6.0/Mail/
> Installing /tmp/fake-root/usr/lib/site_perl/5.6.0/Mail/
> Installing /tmp/fake-root/usr/lib/site_perl/5.6.0/Mail/
> Installing /tmp/fake-root/usr/lib/site_perl/5.6.0/Mail/
> [...]
> --- snap ---
> Notice "/perl5/" directory is totally gone!  It
> should probably be as follows:
> Installing /tmp/fake-root/usr/lib/perl5/site_perl/5.6.0/Mail/
> So that is too borked to use.  This very strange
> behavior occurs on the old 5.45 version whenever
> any args are passed on the "perl Makefile.PL"
> line for some reason.

Yes, prior to 5.91_01, PREFIX is broken.  Allow me to repeat: If you do
"perl Makefile.PL PREFIX=foo" prior to 5.91_01 you will get all sorts of
interesting bugs and "features" and I cannot guarantee where things might
wind up getting installed.  Sometimes the PREFIX is even completely ignored!

The particular feature you've run into above is probably MakeMaker's old
logic to attempt to shape the installation path to better match your prefix.
Essentially, it checks to see if $PREFIX/lib/perl5/ exists, and if it does
it will use that.  Otherwise it will use $PREFIX/lib/.  As you have
illustrated, this causes more problems than it fixes.

That's all been thrown out.  The new logic is much simpler and does not try
to second-guess.

With this in mind, you probably want to do something like this:

     require ExtUtils::MakeMaker;
     if( $ExtUtils::MakeMaker::VERSION <= 5.45 ) {
     	 perl Makefile.PL
	 make install PREFIX=$RPM_TMP_ROOT/usr
     elsif( $ExtUtils::MakeMaker::VERSION >= 6.06 ) {
     	 perl Makefile.PL
	 make install DESTDIR=$RPM_TMP_ROOT
     else {
     	 unsupported version of MakeMaker, please upgrade.

> Someone should tell Jarkko to grab the new MakeMaker
> 6.06 for the 5.8.0 distro.  Unless Michael Schwern
> has more stuff he wants to add before cooking it into
> the core.  (Actually, is Hugo taking over for this
> now?)  Then it should be pretty easy to persuade RH
> to use the new MakeMaker.

6.06 is not ready to be rolled into Perl yet.  The Unix parts are ok, but
the Win32, VMS and MacPerl bits are borked.  This likely doesn't matter to
Redhat and they should be safe using the 6.06 alpha in their devel version

> Nope, since perl's @INC order is still broken, ("core"
> coming BEFORE "site" and "vendor" instead of AFTER),
> I've added a --shadow-pure option to force the module
> installation into installarchlib which comes before
> installprivlib and even all the site and vendor
> directories.  This only works with modules that are
> pure perl and don't have anything installed within
> installarchlib by default.

While this hack may work, its a hack.  You're installing the files in the
wrong place (pure Perl stuff into the architecture specific directories)
which will likely just cause more problems down the road.


Michael G. Schwern   <>
Perl Quality Assurance      <>         Kwalitee Is Job One
I need a SHOWER a BURGER and some ROBOTS, STAT!
	-- Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About