Search code examples
perlactiveperlrelocation

What is ActivePerl doing when it "relocates" files during installation?


Given some unix program which I've compiled, what might I need to do to relocate it to a different directory and have it continue running correctly.

I'm thinking of Perl, but would be interested in other systems like Apache which also seem to fail when this is done. To motivate the question, being able to perform this sort of relocation would be very useful when bundling other systems as part of a product install.

For what it's worth, ActivePerl's install process seems to contain some magic which performs the relocation during the install..

Installing ActivePerl...
Copying files to /opt/ActivePerl-5.8...done
Relocating...done (164 files relocated)
Generating HTML documentation...done
Syncing perl PPM database with .packlists...done 

ActivePerl has been successfully installed at /opt/ActivePerl-5.8.

Can anyone enlighten me as to what's happening behind that 'Relocating...' line?


Solution

  • When you compile perl, it expects certain files at certain locations. You can see some of those paths with perl -V. For ActivePerl, when you want to move the entire installation, you have to update where perl expects to find things and where its various helper programs expect to find perl. See the documentation for ActiveState's reloc_perl, and maybe look at the source if you have it.

    What ActivePerl does has no general bearing on what you would do with other programs. It depends on what they each do and expect.