Bug 78053 - incompatible changes in behavior of MakeMaker; affects rpm build process
Summary: incompatible changes in behavior of MakeMaker; affects rpm build process
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chip Turner
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-18 15:41 UTC by Jeremy Portzer
Modified: 2007-04-18 16:48 UTC (History)
4 users (show)

Fixed In Version: 9.0.93
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-10-08 23:10:25 UTC
Embargoed:


Attachments (Terms of Use)
fixes MakeMaker so PREFIX appears INSTALL variables like it used to be (2.41 KB, patch)
2002-11-18 15:43 UTC, Jeremy Portzer
no flags Details | Diff

Description Jeremy Portzer 2002-11-18 15:41:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
I feel that an important part of maintaining a Red Hat Linux system is
installing everything via RPM.  The "cpan2rpm" tool
(http://perl.arix.com/cpan2rpm/ ) makes an easy RPM-ify perl modules.  However,
changes to MakeMaker in Perl 5.8.0 break cpan2rpm and any other applications
that depend on the "make PREFIX=$RPM_BUILD_ROOT install" construct.

Version-Release number of selected component (if applicable):
perl-5.8.0-55


How reproducible:
Always

Steps to Reproduce:
1.  Download cpan2rpm; modify it to use "rpmbuild" instead of "rpm" for building
RPMs  
2.  Attempt to build an RPM of a CPAN module, for example "cpan2rpm MD5"

	

Actual Results:  rpm build process fails on the make install step, because the
Makefile has changed in an incompatible manner -- the PREFIX variable is not
being overriden properly, and "make install" doesn't install to RPM_BUILD_ROOT.

Expected Results:  rpm build process should have completed successfully, as it
does on prior releases of Red Hat Linux

Additional info:

A small modification to MakeMaker could restore the previous functionality,
allowing the PREFIX to be overridden on the "make install" step of the rpm build
process.  See attached patch (modified from Mandrake Linux 9.0).   This will
make the rpm build process much simpler for perl modules, including the use of
scripts such as cpan2rpm.

Comment 1 Jeremy Portzer 2002-11-18 15:43:11 UTC
Created attachment 85446 [details]
fixes MakeMaker so PREFIX appears INSTALL variables like it used to be

Comment 2 Need Real Name 2002-11-18 16:02:46 UTC
Reference http://archive.develooper.com/makemaker@perl.org/msg00361.html as to
why this behavior was removed from MakeMaker.  For rpm based distributions, I
think this is the wrong behavior and that the previous behavior would be more
desirable.

Comment 3 Jeremy Portzer 2002-11-18 16:06:35 UTC
Sorry, version 1.79 of cpan2rpm fixes the "rpmbuild" vs. "rpm" issue.  Please
ignore my comment about this in Step 1 of Steps to Reproduce.

Comment 4 Michael G Schwern 2002-11-28 20:00:51 UTC
Its a bug in MakeMaker, not a feature.  At the time of the above post I didn't realize "make install PREFIX=foo" was important to anyone.  See:
http://archive.develooper.com/makemaker@perl.org/msg00758.html

Next version of MakeMaker released to CPAN will have at least "perl Makefile.PL PREFIX=foo;  make install PREFIX=bar" fixed but I'm still having trouble getting "perl Makefile.PL;  make install PREFIX=bar" to work.


Comment 5 Need Real Name 2002-11-29 04:22:14 UTC
How about adding DESTDIR support to MakeMaker instead?  (Reference:
http://www.gnu.org/manual/make-3.79.1/html_chapter/make_14.html#SEC119 see the
bottom of that section).  DESTDIR is normally not set by anything in the
Makefile.  It is left to be set by the user on the command line.  Since it
prepends all paths in the Makefile, if it's not set, all paths work as normal. 
If it is set, the makefile installs everything into a root defined by the
DESTDIR variable.  Since this variable isn't used for anything else, this would
accomplish the what rpm needs for installing into a buildroot directory.

Comment 6 Michael G Schwern 2002-11-29 08:27:05 UTC
DESTDIR plus the partial "make install PREFIX=foo" fix might just work.

Comment 7 Michael G Schwern 2002-12-08 11:53:38 UTC
DESTDIR has been added to MakeMaker.

Also, this works again:

    perl Makefile.PL PREFIX=foo
    make test
    make install PREFIX=bar

but this still does not:

    perl Makefile.PL
    make test
    make install PREFIX=bar

I don't think anyone will miss the latter now that there is DESTDIR.

Snapshot available from makemaker.org.  The prefix work was done between 
SNAP-2002-12-08T03-40-41-0800 and SNAP-2002-12-07T18-43-55-0800 (those are CVS
tags).  There have been major internal changes between 5.8.0's MakeMaker and the
current snapshots.

Comment 8 Michael G Schwern 2002-12-14 00:20:43 UTC
I may not have been clear above.

You should be able to extract just the PREFIX and DESTDIR fixes from the current
snapshot by examining
cvs diff -rSNAP-2002-12-07T18-43-55-0800 -rSNAP-2002-12-08T03-40-41-0800 -u
and manually apply the relevent bits to 5.8.0's MakeMaker.


Comment 9 Rob Brown 2002-12-17 04:51:27 UTC
perl Makefile.PL PREFIX=foo 
 
is now added to the spec file by the cpan2rpm utility 
( http://perl.arix.com/cpan2rpm/ ) 
when 5.91_01 <= $ExtUtils::MakeMaker::VERSION <= 6.05. 
 
Thanks for the spot Jeremy. 
 

Comment 10 Michael G Schwern 2003-03-31 02:18:16 UTC
ExtUtils::MakeMaker 6.06_03 has been released and is pretty well tested.  It has the restored PREFIX behavior and new DESTDIR features as discussed above.  6.06_04 will be following sortly with small additional fixes.  There will probably be a 6.06_05 before a final 6.06 release (whichmight end up being 6.10 just to reflect that so much as changed).To make a long story short, 6.06_03 should be safe for RH to put into development releases and there will be a stable release soon.

Comment 11 Jeremy Portzer 2003-10-08 23:10:25 UTC
ExtUtils::MakeMaker is now at 6.17 (in Severn beta/test) and has full DESTDIR
support, so this problem is solved in my view... marking resolved.


Note You need to log in before you can comment on or make changes to this bug.