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.
Created attachment 85446 [details] fixes MakeMaker so PREFIX appears INSTALL variables like it used to be
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.
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.
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.
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.
DESTDIR plus the partial "make install PREFIX=foo" fix might just work.
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.
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.
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.
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.
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.