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 | <!ENTITY python-download-http "http://www.python.org/ftp/python/&Python-version;/Python-&Python-version;.tar.bz2">
|
---|
8 | <!ENTITY python-download-ftp "&gentoo-ftp-repo;/Python-&Python-version;.tar.bz2">
|
---|
9 | <!ENTITY python-md5sum "fee5408634a54e721a93531aba37f8c1">
|
---|
10 | <!ENTITY python-size "11 MB">
|
---|
11 | <!ENTITY python-buildsize "171 MB (23MB for the test suite, additional 26MB for the documentation)">
|
---|
12 | <!ENTITY python-time "1 SBU (additional 2.9 SBU to run the test suite)">
|
---|
13 | <!ENTITY pythonhtmldoc-download-http "http://docs.python.org/ftp/python/doc/&python-majorver;/python-&python-majorver;-docs-html.tar.bz2">
|
---|
14 | <!ENTITY pythonhtmldoc-md5sum "cfcd4b9b00ba1e7496b5d823692370a4">
|
---|
15 | <!ENTITY pythonhtmldoc-size "3.3 MB">
|
---|
16 | ]>
|
---|
17 |
|
---|
18 | <sect1 id="python" xreflabel="Python-&Python-version;">
|
---|
19 | <?dbhtml filename="python.html" ?>
|
---|
20 |
|
---|
21 | <sect1info>
|
---|
22 | <othername>$LastChangedBy$</othername>
|
---|
23 | <date>$Date$</date>
|
---|
24 | </sect1info>
|
---|
25 |
|
---|
26 | <title>Python-&Python-version;</title>
|
---|
27 |
|
---|
28 | <indexterm zone="python">
|
---|
29 | <primary sortas="a-Python">Python</primary>
|
---|
30 | </indexterm>
|
---|
31 |
|
---|
32 | <sect2 role="package">
|
---|
33 | <title>Introduction to Python</title>
|
---|
34 |
|
---|
35 | <para>The <application>Python</application> package contains the
|
---|
36 | <application>Python</application> development environment.
|
---|
37 | This is useful for object-oriented programming, writing scripts,
|
---|
38 | prototyping large programs or developing entire applications.</para>
|
---|
39 |
|
---|
40 | <!-- Python compiled against Pth, OpenSSL, and SQLite.
|
---|
41 | 326 tests OK, 36 tests skipped, 0 failures -->
|
---|
42 |
|
---|
43 | &lfs65_checked;
|
---|
44 |
|
---|
45 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
46 | <itemizedlist spacing="compact">
|
---|
47 | <listitem>
|
---|
48 | <para>Download (HTTP): <ulink url="&python-download-http;"/></para>
|
---|
49 | </listitem>
|
---|
50 | <listitem>
|
---|
51 | <para>Download (FTP): <ulink url="&python-download-ftp;"/></para>
|
---|
52 | </listitem>
|
---|
53 | <listitem>
|
---|
54 | <para>Download MD5 sum: &python-md5sum;</para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>Download size: &python-size;</para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>Estimated disk space required: &python-buildsize;</para>
|
---|
61 | </listitem>
|
---|
62 | <listitem>
|
---|
63 | <para>Estimated build time: &python-time;</para>
|
---|
64 | </listitem>
|
---|
65 | </itemizedlist>
|
---|
66 |
|
---|
67 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
68 |
|
---|
69 | <bridgehead renderas="sect4">Required Patch</bridgehead>
|
---|
70 | <itemizedlist spacing='compact'>
|
---|
71 | <listitem>
|
---|
72 | <para><ulink
|
---|
73 | url="&patch-root;/Python-&Python-version;-bdb_4.8-1.patch"/></para>
|
---|
74 | </listitem>
|
---|
75 | </itemizedlist>
|
---|
76 |
|
---|
77 | <!-- <bridgehead renderas="sect4">Optional Patch</bridgehead>
|
---|
78 | <itemizedlist spacing='compact'>
|
---|
79 | <listitem>
|
---|
80 | <para><ulink
|
---|
81 | url="&patch-root;/Python-&Python-version;-testing-1.patch"/></para>
|
---|
82 | </listitem>
|
---|
83 | </itemizedlist> -->
|
---|
84 |
|
---|
85 | <itemizedlist spacing='compact'>
|
---|
86 | <title>Optional HTML Documentation</title>
|
---|
87 | <listitem>
|
---|
88 | <para>Download (HTTP): <ulink url="&pythonhtmldoc-download-http;"/></para>
|
---|
89 | </listitem>
|
---|
90 | <listitem>
|
---|
91 | <para>Download MD5 sum: &pythonhtmldoc-md5sum;</para>
|
---|
92 | </listitem>
|
---|
93 | <listitem>
|
---|
94 | <para>Download size: &pythonhtmldoc-size;</para>
|
---|
95 | </listitem>
|
---|
96 | </itemizedlist>
|
---|
97 |
|
---|
98 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
99 |
|
---|
100 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
101 | <para role="optional"><xref linkend="pth"/>,
|
---|
102 | <xref linkend="gcc"/> (install JAVA for the
|
---|
103 | <filename class="libraryfile">libffi</filename> library) or
|
---|
104 | <ulink url="http://sourceware.org/libffi/">libffi</ulink>, and
|
---|
105 | <ulink url="http://www.bluez.org/">BlueZ</ulink></para>
|
---|
106 |
|
---|
107 | <bridgehead renderas="sect4">Optional
|
---|
108 | (to create package-specific support modules)</bridgehead>
|
---|
109 | <para role="optional"><xref linkend="openssl"/>,
|
---|
110 | <xref linkend="tk"/>,
|
---|
111 | <xref linkend="db"/>, and
|
---|
112 | <!-- <xref linkend="gdbm"/>, and -->
|
---|
113 | <xref linkend="sqlite"/></para>
|
---|
114 |
|
---|
115 | <para>Note that there is a circular dependency with the
|
---|
116 | <application>Tk</application> package as it requires Xorg to be installed
|
---|
117 | but parts of Xorg depend on <application>Python</application>.</para>
|
---|
118 |
|
---|
119 | <para condition="html" role="usernotes">User Notes:
|
---|
120 | <ulink url="&blfs-wiki;/Python"/></para>
|
---|
121 |
|
---|
122 | </sect2>
|
---|
123 |
|
---|
124 | <sect2 role="installation">
|
---|
125 | <title>Installation of Python</title>
|
---|
126 |
|
---|
127 | <para>Install <application>Python</application> by running the following
|
---|
128 | commands:</para>
|
---|
129 |
|
---|
130 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" \
|
---|
131 | setup.py &&
|
---|
132 | patch -Np1 -i ../Python-&Python-version;-bdb_4.8-1.patch &&
|
---|
133 |
|
---|
134 | ./configure --prefix=/usr --enable-shared &&
|
---|
135 | make</userinput></screen>
|
---|
136 |
|
---|
137 | <para>To test the results, issue: <command>make test</command>. Note that
|
---|
138 | if you have an existing <application>Python</application> installation
|
---|
139 | which includes the <application>PyXML</application> module, the tests could
|
---|
140 | produce a segmentation fault.</para>
|
---|
141 |
|
---|
142 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
143 |
|
---|
144 | <screen role="root"><userinput>make install &&
|
---|
145 | chmod -v 755 /usr/lib/libpython2.6.so.1.0</userinput></screen>
|
---|
146 |
|
---|
147 | <para>There is no documentation installed using the instructions above.
|
---|
148 | See the <filename>Doc/README.txt</filename> file in the source
|
---|
149 | distribution for instructions on how to create the html. Alternatively,
|
---|
150 | you can download preformatted documentation from <ulink
|
---|
151 | url="http://docs.python.org/download.html"/>.</para>
|
---|
152 |
|
---|
153 | <para>In order to use the <command>help ('name_string')</command> feature
|
---|
154 | of the <command>python</command> interpreter with some statements and
|
---|
155 | keywords, you must download (or create) the optional HTML documentation
|
---|
156 | and install it. If you downloaded the HTML docs, issue the following
|
---|
157 | commands as the
|
---|
158 | <systemitem class="username">root</systemitem> user:</para>
|
---|
159 |
|
---|
160 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&Python-version;/html &&
|
---|
161 | tar --strip-components=1 \
|
---|
162 | --no-same-owner \
|
---|
163 | --no-same-permissions \
|
---|
164 | -C /usr/share/doc/Python-&Python-version;/html \
|
---|
165 | -xvf ../python-&python-majorver;-docs-html.tar.bz2</userinput></screen>
|
---|
166 |
|
---|
167 | </sect2>
|
---|
168 |
|
---|
169 | <sect2 role="commands">
|
---|
170 | <title>Command Explanations</title>
|
---|
171 |
|
---|
172 | <para><command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command
|
---|
173 | is used to fix a build problem with the <application>GDBM</application>
|
---|
174 | library.</para>
|
---|
175 |
|
---|
176 | </sect2>
|
---|
177 |
|
---|
178 | <sect2 role="configuration">
|
---|
179 | <title>Configuring Python</title>
|
---|
180 |
|
---|
181 | <para>In order for <command>python</command> to find the installed
|
---|
182 | documentation, you must add the following environment variable to
|
---|
183 | individual user's or the system's profile:</para>
|
---|
184 |
|
---|
185 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&Python-version;/html</userinput></screen>
|
---|
186 |
|
---|
187 | </sect2>
|
---|
188 |
|
---|
189 | <sect2 role="content">
|
---|
190 | <title>Contents</title>
|
---|
191 |
|
---|
192 | <segmentedlist>
|
---|
193 | <segtitle>Installed Programs</segtitle>
|
---|
194 | <segtitle>Installed Libraries</segtitle>
|
---|
195 | <segtitle>Installed Directories</segtitle>
|
---|
196 |
|
---|
197 | <seglistitem>
|
---|
198 | <seg>2to3, pydoc, python, python-config, python&python-majorver;,
|
---|
199 | python&python-majorver;-config, smtpd.py, and optionally if
|
---|
200 | <application>Tk</application> is installed, idle</seg>
|
---|
201 | <seg>libpython&python-majorver;.so and numerous modules installed in
|
---|
202 | /usr/lib/python&python-majorver;/lib-dynload</seg>
|
---|
203 | <seg>/usr/include/python&python-majorver;,
|
---|
204 | /usr/lib/python&python-majorver;, and
|
---|
205 | /usr/share/doc/python-&Python-version;</seg>
|
---|
206 | </seglistitem>
|
---|
207 | </segmentedlist>
|
---|
208 |
|
---|
209 | <variablelist>
|
---|
210 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
211 | <?dbfo list-presentation="list"?>
|
---|
212 | <?dbhtml list-presentation="table"?>
|
---|
213 |
|
---|
214 | <varlistentry id="idle">
|
---|
215 | <term><command>idle</command></term>
|
---|
216 | <listitem>
|
---|
217 | <para>is a wrapper script that opens a
|
---|
218 | <application>Python</application> aware GUI editor.</para>
|
---|
219 | <indexterm zone="python idle">
|
---|
220 | <primary sortas="b-idle">idle</primary>
|
---|
221 | </indexterm>
|
---|
222 | </listitem>
|
---|
223 | </varlistentry>
|
---|
224 |
|
---|
225 | <varlistentry id="pydoc">
|
---|
226 | <term><command>pydoc</command></term>
|
---|
227 | <listitem>
|
---|
228 | <para>is the <application>Python</application> documentation
|
---|
229 | tool.</para>
|
---|
230 | <indexterm zone="python pydoc">
|
---|
231 | <primary sortas="b-pydoc">pydoc</primary>
|
---|
232 | </indexterm>
|
---|
233 | </listitem>
|
---|
234 | </varlistentry>
|
---|
235 |
|
---|
236 | <varlistentry id="python-prog">
|
---|
237 | <term><command>python</command></term>
|
---|
238 | <listitem>
|
---|
239 | <para>is an interpreted, interactive, object-oriented programming
|
---|
240 | language.</para>
|
---|
241 | <indexterm zone="python python-prog">
|
---|
242 | <primary sortas="b-python">python</primary>
|
---|
243 | </indexterm>
|
---|
244 | </listitem>
|
---|
245 | </varlistentry>
|
---|
246 |
|
---|
247 | <varlistentry id="python-ver">
|
---|
248 | <term><command>python&python-majorver;</command></term>
|
---|
249 | <listitem>
|
---|
250 | <para>is a version-specific name for the <command>python</command>
|
---|
251 | program.</para>
|
---|
252 | <indexterm zone="python python-ver">
|
---|
253 | <primary sortas="b-python&python-majorver;">python&python-majorver;</primary>
|
---|
254 | </indexterm>
|
---|
255 | </listitem>
|
---|
256 | </varlistentry>
|
---|
257 |
|
---|
258 | <varlistentry id="smtpd.py">
|
---|
259 | <term><command>smtpd.py</command></term>
|
---|
260 | <listitem>
|
---|
261 | <para>is an SMTP proxy implemented in
|
---|
262 | <application>Python</application>.</para>
|
---|
263 | <indexterm zone="python smtpd.py">
|
---|
264 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
265 | </indexterm>
|
---|
266 | </listitem>
|
---|
267 | </varlistentry>
|
---|
268 |
|
---|
269 | </variablelist>
|
---|
270 |
|
---|
271 | </sect2>
|
---|
272 |
|
---|
273 | </sect1>
|
---|