Christian Goetze <[EMAIL PROTECTED]> writes:
>Pretty sure this must be an FAQ, but it is amazingly hard to find anything
>really descriptive.
>
>A useful tidbit was
>http://www.mail-archive.com/[EMAIL PROTECTED]/msg00779.html
>
>which is why I am sending this to this list. My problem is a little bit
>more complex.
>
>I need to do a custom perl build (mainly to support 64bit int), and make a
>binary, _relocatable_ RPM out of it, including a variety of CPAN modules,
>some of which are XS modules. In addition, that perl needs to provide
>libperl.so for embedding into our application.

The usual way to build relocatable perl is along these lines:
prefix=/tmp/LongPathnameForInstallBeforeRelocationToNewBase
./Configure ... -Dprefix=$prefix ...
ln -s /where/you/build/it $prefix
make
make install  # to path in /tmp with silly name
# make XS & install XS modules using the "installed" perl
bundle the tempory thing

Then on target
unbundle 
link unbundled thing to the path in /tmp
copy to final location 
fix-up the pathnames in the scripts and binaries.

The trick is to use a long enough pre-install name that 
binaries can be fixed by padding with zeros.
The pathname is in /tmp so that the target unpack process can use 
the perl to do the fixup.

The scheme was developed by ActiveState.
I have a nearly finished module to do the 
fixup after unbundling based in thier code (attached).

>
>Currently, I am doing a horrid process which includes installing my perl,
>then adding the CPAN modules, then packaging the RPM out of the installed
>location.

That is more-or less it. You _might_ be able to avoid 
the install if you told perl where to find its pre-installed lib
via PERL5LIB or similar.

>
>I wished I could build and temporarily install perl into my buildroot,
>then add the CPAN modules into that perl, then package it and install the
>rpm and have everything work as it should.

If the code can be installed elsewhere then you need to fix the 
compiled-in @INC values etc.

>
>I understand how I can build CPAN modules within my buildroot and package
>them, but that relies on perl being already installed. What I need is some
>way to make this work without perl being installed in its final production
>location, but at best installed into some temporary buildroot.
>
>Any tips would be wildly appreciated. At this point, I think my only
>recourse is to grep the binaries for my buildroot path and substitute that
>with the final production path, possibly in a %post hook if I need
>relocatability at installation time....

Yes.

Attachment: ExtUtils-Relocate.tar.gz
Description: GNU Zip compressed data

Reply via email to