http://www.perlmonks.org?node_id=930539

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

hi monks
i am planning to write a perl script to automatically install perl from source on ubuntu 11.04. while configuring i want to give values(not defaults) at some place. i dont know which file i should edit or how shold i give input there.
please help me
other suggestions regarding this task are aslo welcomed

Replies are listed 'Best First'.
Re: automating perl installation
by ikegami (Patriarch) on Oct 10, 2011 at 06:58 UTC

    Some common options can be provided as parameters to Configure (e.g. thread support). See INSTALL. INSTALL also mentions:

    =head2 Site-wide Policy settings After Configure runs, it stores a number of common site-wide "policy" answers (such as installation directories) in the Policy.sh file. If you want to build perl on another system using the same policy defaults, simply copy the Policy.sh file to the new system's perl build directory, and Configure will use it. This will work even if Policy.sh was generated for another version of Perl, or on a system with a different architecture and/or operating system. However, in such cases, you should review the contents of the file before using it: for example, your new target may not keep its man pages in the same place as the system on which the file was generated. Alternatively, if you wish to change some or all of those policy answers, you should rm -f Policy.sh to ensure that Configure doesn't re-use them. Further information is in the Policy_sh.SH file itself. If the generated Policy.sh file is unsuitable, you may freely edit it to contain any valid shell commands. It will be run just after the platform-specific hints files.

    Does that help?

      but i want to change defaults at following 4 places
      Installation prefix to use?(~name OK)/usr/local /usr
      Set Directories to use for library searches ? /usr/local/lib /lib /usr/lib
      what libraries to use ? none -lnsl -ldl -lm -lcrypt -lutil -lc
      Build a shared libperl.so(y/n)n y

      policy.sh is showing only installation prefix.

        After running Configure, it says

        If you compile perl5 on a different machine or from a different object directory, copy the Policy.sh file from this object directory to the new one before you run Configure -- this will help you with most of the policy defaults.

        Sounds like you can run Configure once and copy Policy.sh around.

Re: automating perl installation
by pvaldes (Chaplain) on Oct 26, 2011 at 16:42 UTC
    i am planning to write a perl script to automatically install perl from source on ubuntu 11.04

    You can save the effort, apt-src do exactly this for you. In fact perl is installed at the same time that Ubuntu

    After the README.gz file you can positively run configure with extra options (i.e:  ./Configure -des -Dprefix=$HOME/localperl)

    "If you run into any trouble whatsoever or you need to install a customized version of Perl, you should read the detailed instructions in the "INSTALL" file that came with this distribution."