On Wed, 18 Dec 2002, Axel Thimm wrote:

>John, the problem lies in the nature of rpm building. Building rpm
>should not be done under /usr, but under /var/tmp/somthing-root/usr.
>In order to persuade MakeMaker to do so, one diverts PREFIX to point
>to the lattest directory. Unfortunately this has the side effect of
>having wrong paths in the perl modules, if they get them from
>MakeMaker.
>
>Usually there is a way of diverting all Make-paths with one
>argument, but MakeMaker does not (yet?) have this functionality.

Yes, with GNU autoconf for example you can say

% ./configure --prefix=/foo
% make install DESTDIR=/bar

In the MakeMaker documentation there is some stuff about 'AFS users'
and running Makefile.PL with several extra arguments like
INSTALLSITELIB and so on.  But I don't know if that is relevant.

>>>If you specify PREFIX=foo then the path foo is hardcoded into some of
>>>the executables.  What's needed is to specify a PREFIX but install
>>>somewhere else (eg PREFIX=/usr but install in
>>>/var/tmp/xmltv-root/usr).  But I don't know how to do that.  Aargh!
>
>There are three ways, all of them not really satisfactory:
>o make the package relocatable
>o call MakeMaker twice (see below)
>o call make install with a plethora of INST... redefinitions, which may be
>  different dependng on MakeMaker and perl version. :(
>
>The second workaround is to have MakeMaker run twice: Once for
>building everything with PREFIX=/usr and once just before running
>"make install" to divert the destination directory. Very dirty, but
>it works, and seems to be currently the best way.
>
>Interesting point: This problem always never occurs, because most
>perl modules have no explicit path information and are thus
>relocatable.

True.  My program has files installed in /usr/share/ (or wherever), so
it does need to have a path configured at build time and cannot just
rely on Perl's include path.

I'm cc'ing this message to the MakeMaker list to ask if there is a
recommended way to do things.  I want to build a package with
PREFIX=whatever but then when copying in the files, put them in a
temporary directory so I can create a binary package.  Any
suggestions?

-- 
Ed Avis <[EMAIL PROTECTED]>

Reply via email to