This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
usage_on_fly [2012/02/23 18:19] k2patel |
usage_on_fly [2020/08/10 02:35] (current) |
||
---|---|---|---|
Line 4: | Line 4: | ||
==== To install Modules Locally ==== | ==== To install Modules Locally ==== | ||
- | Best way to install local module is to install module "local::lib".\\ | + | |
+ | local::lib enables you to install modules into a specified directory, \\ | ||
+ | without requiring root or administrator access. See the bootstrapping technique for how to get started.\\ | ||
+ | You can create a directory per user/project/company and deploy to other servers,\\ | ||
+ | by copying the directory (as long as you are on the same operating system). | ||
+ | |||
[[http://search.cpan.org/~apeiron/local-lib/ | CPAN Local::lib ]]\\ | [[http://search.cpan.org/~apeiron/local-lib/ | CPAN Local::lib ]]\\ | ||
But you can also manually do it. | But you can also manually do it. | ||
Line 13: | Line 19: | ||
export username=ketan | export username=ketan | ||
</code> | </code> | ||
+ | |||
+ | <note warning>Still you have to modify / change "$username" manually at many places</note> | ||
**create the .cpan directories** | **create the .cpan directories** | ||
Line 35: | Line 43: | ||
o conf init | o conf init | ||
</code> | </code> | ||
- | to reconfigure CPAN, replace all \*/root/.cpan/\* with /home/$username/.cpan/* | + | <note>to reconfigure CPAN, replace all */root/.cpan/* with /home/$username/.cpan/*</note> |
- | Then edit ''/home/$username/.cpan/CPAN/MyConfig.pm'' and change the makepl_arg so that it has your PREFIX line as well: | + | change the makepl_arg so it should look like. |
- | <code oobas> | + | <code bash | /home/$username/.cpan/CPAN/MyConfig.pm> |
'makepl_arg' => q[INSTALLDIRS=site PREFIX=/home/$username/perl/], | 'makepl_arg' => q[INSTALLDIRS=site PREFIX=/home/$username/perl/], | ||
</code> | </code> | ||
Line 45: | Line 53: | ||
<code oobas> | <code oobas> | ||
- | export PERL5LIB="/home/$user/perl/share/perl/5.8.4/:/home/$user/perl/lib/perl/5.8.4/"; | + | export PERL5LIB="/home/$username/perl/share/perl/custom_lib/:/home/$username/perl/lib/perl/custom_lib/"; |
</code> | </code> | ||
and then you should be able to use CPAN to install modules. | and then you should be able to use CPAN to install modules. | ||
- | I then modified the Oddmuse script so that the new module install directory was in @INC so that Oddmuse could pick up the modules. Put the following line somewhere near the top | + | I then modified following file |
- | <code oobas> | + | <code bash | ~/.bashrc> |
- | push @INC,qw(/home/$user/perl/share/perl/5.8.4/ /home/$user/perl/lib/perl/5.8.4/); | + | export PERL_LOCAL_LIB_ROOT="/home/$username/perl"; |
+ | export PERL_MB_OPT="--install_base /home/$username/perl"; | ||
+ | export PERL_MM_OPT="INSTALL_BASE=/home/$username/perl"; | ||
+ | export PERL5LIB="/home/$username/perl/share/perl/custom_lib/:/home/$username/perl/lib/perl/custom_lib/"; | ||
+ | export PATH="/home/$username/perl/bin:$PATH"; | ||
</code> | </code> | ||
- | |||
- |