source: general/prog/perl-alternatives.xml@ e305bb90

perl-modules
Last change on this file since e305bb90 was e305bb90, checked in by Ken Moffat <ken@…>, 4 years ago

New branch for testing changes to perl modules.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/perl-modules@20472 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 5.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!-- it seems at least one entity is needed -->
8 <!ENTITY perl-alternatives-dummy "42">
9]>
10 <!-- Begin perl alternatives -->
11 <sect2 id="perl-alternatives" xreflabel="Building and installing perl modules">
12
13 <title>Building and installing perl modules</title>
14
15 <indexterm zone="perl-alternatives">
16 <primary sortas="a-installing-perl-modules">Installing perl modules</primary>
17 </indexterm>
18
19 <sect3 role="package">
20 <title>The various ways of building and Installing perl modules</title>
21
22 <para>
23 Most modules use a standard install, but some use a different method. Each
24 module links to the appropriate method. You can also make an automated
25 install, using CPAN to download any modular dependencies - details at the
26 end.
27 </para>
28
29 </sect3>
30
31 <sect3 role="installation" id="new-perl-standard-install"
32 xreflabel="standard build and installation instructions">
33 <title>Standard Installation of Perl Modules</title>
34
35 <para>Install <application>Perl</application> modules by running the
36 following commands:</para>
37
38 <para>For <xref linkend="perl-data-uniqid"/>, first apply the required
39 patch with:</para>
40
41<screen><userinput>patch -Np1 -i ../Data-Uniqid-&Data-Uniqid-version;-disable_failing_test-1.patch</userinput></screen>
42
43 <para>Then, or for all other modules using the standard installation, proceed
44 with:</para>
45
46<screen><userinput>perl Makefile.PL &amp;&amp;
47make &amp;&amp;
48make test</userinput></screen>
49
50 <note>
51 <para>If the module is described as using the <emphasis>unsafe</emphasis>
52 variant of the Standard Installation, (the use of the current
53 directory in <literal>@INC</literal> was removed for security reasons
54 in <literal>perl-5.26.0</literal>)
55 you should change the perl invocation to:</para>
56
57<screen><userinput>PERL_USE_UNSAFE_INC=1 &amp;&amp;</userinput></screen>
58
59 <para>If, however, you are using the Auto Installation described below,
60 that environment variable will be set whenever the <command>cpan</command>
61 shell <command>install</command> is used.</para>
62 </note>
63
64 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
65
66<screen role="root"><userinput>make install</userinput></screen>
67
68 <note>
69 <para>When reinstalling a <application>Perl</application> module,
70 sometimes older versions of the module being reinstalled are in other
71 directories specified in <parameter>@INC</parameter>. To delete all
72 other versions of the module being reinstalled (not simply older ones)
73 set the <varname>UNINST</varname> variable:</para>
74
75<screen><userinput>make install UNINST=1</userinput></screen>
76 </note>
77
78 </sect3>
79
80 <sect3 role="installation" id="new-perl-build-install"
81 xreflabel="instructions for packages using Build.PL">
82 <title>Installation of Perl Modules which use Build.PL</title>
83
84 <para>Install <application>Perl</application> modules which use
85 Build.PL by running the following commands:</para>
86
87<screen><userinput>perl Build.PL &amp;&amp;
88./Build &amp;&amp;
89./Build test</userinput></screen>
90
91 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
92
93<screen role="root"><userinput>./Build install</userinput></screen>
94
95 </sect3>
96
97 <sect3 role="installation" id="new-perl-auto-install"
98 xreflabel="alternate auto installation instructions">
99 <title>(Alternate) Auto Installation of Perl Modules.</title>
100
101 <para>There is an alternate way of installing the modules using the
102 <command>cpan</command> shell <command>install</command> command. The
103 command automatically downloads the source from the CPAN archive, extracts
104 it, runs the compilation, testing and installation commands mentioned
105 above, and removes the build source tree. You may still need to install
106 dependent library packages before running the automated installation
107 method.</para>
108
109 <para>The first time you run <command>cpan</command>, you'll be prompted
110 to enter some information regarding download locations and methods. This
111 information is retained in files located in
112 <filename class='directory'>~/.cpan</filename>. Start the
113 <command>cpan</command> shell by issuing '<command>cpan</command>' as the
114 <systemitem class="username">root</systemitem> user. Any module may now be
115 installed from the
116 <emphasis role='underlined'><prompt>cpan&gt;&nbsp;</prompt></emphasis>
117 prompt with the command:</para>
118
119<screen role="root"><userinput>install <replaceable>&lt;Module::Name&gt;</replaceable></userinput></screen>
120
121 <para>For additional commands and help, issue '<command>help</command>'
122 from the
123 <emphasis role='underlined'><prompt>cpan&gt;&nbsp;</prompt></emphasis>
124 prompt.</para>
125
126 <para>Alternatively, for scripted or non-interactive installations, use the
127 following syntax as the
128 <systemitem class="username">root</systemitem> user to install one or more
129 modules:</para>
130
131<screen role="root"><userinput>cpan -i <replaceable>&lt;Module1::Name&gt; &lt;Module2::Name&gt;</replaceable></userinput></screen>
132
133 <para>Review the <filename>cpan.1</filename> man page for additional
134 parameters you can pass to <command>cpan</command> on the command
135 line.</para>
136
137 </sect3>
138
139 </sect2>
Note: See TracBrowser for help on using the repository browser.