linxdev has asked for the wisdom of the Perl Monks concerning the following question:

I'm just started using perlbrew and I want to use it to deploy a perl upgrade.

Typically on systems I install perl and all modules to /opt/perl/ I'm interested in using perlbrew to do all the compiling, module install, and testing in home and then move that to /opt/perl

If there a documented method to do this?

Chris

Replies are listed 'Best First'.
Re: perlbrew copy to system
by Anonymous Monk on Dec 04, 2014 at 01:42 UTC

      I am switching machines. I'm building a small Linux environment that is loaded onto a x86 device. It is compatible with the development environment. I copy /opt/perl to ~/devel/device_root and then use mksquashfs to create an image that is loaded into ram at boot.

      Here is how I build perl today. I'm typing this from my head so it may not be exact.

      PERL_INSTALL=/tmp/perl.`uuidgen` ./Configure -Dprefix=/opt/perl make -f Makefile install.perl DESTDIR=${PERL_INSTALL} # Now to install modules I need /opt/perl sudo ln -sf ${PERL_INSTALL}/opt/perl /opt/perl

      I have at least 5 directories of perl modules

      for i in `cat modules.list` do PERL_BIN=/opt/perl/bin/perl (cd $i && make -f OURMakefile install) || exit 1 done

      Now I copy everything to the devel root

      cp -dpvR ${PERL_INSTALL}/opt/perl ~/devel/root/opt

      My idea is to use perlbrew so that I can use CPAN to download, build, and install modules instead of mean going into each directory. I also want to get rid of the sudo dependency. I thought If I use perlbrew to build perl and modules into ~/perlbrew/ I could simply copy the dist to ~/devel/root/. The problem is that the binary and files will be pointing to /home/cfowler/perlbrew/... and I do not want to create those symlinks on the device.

      Chris
        So use relocatable inc along with Portable.pm and an installer? Just like strawberryperl or citrusperl or activperl do?
Re: perlbrew copy to system
by lenjaffe (Initiate) on Dec 04, 2014 at 23:40 UTC
    Why not do the build in /opt? No dev box?
      I could do the build in /opt/ I do that now by placing perl in /opt/perl. I'm looking at moving to ARM. The issue I see is that building CPAN modules is not possible via cross-compiling. Compiling under ARM for ARM sucks because it is just not fast enough. For that I think I may have to deploy a x86 dev box and ARM dev box. cross-compile on the PC then ssh over to the ARM machine for the CPAN module build segment.