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 python2-download-http
|
---|
8 | "https://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
|
---|
9 | <!ENTITY python2-download-ftp " ">
|
---|
10 | <!ENTITY python2-md5sum "1dbcc848b4cd8399a8199d000f9f823c">
|
---|
11 | <!ENTITY python2-size "12 MB">
|
---|
12 | <!ENTITY python2-buildsize "229 MB (additional 18 MB for the tests)">
|
---|
13 | <!ENTITY python2-time "0.8 SBU (additional 5.6 SBU for tests)">
|
---|
14 |
|
---|
15 | <!ENTITY python2htmldoc-download-http
|
---|
16 | "https://docs.python.org/2.7/archives/python-&python2-version;-docs-html.tar.bz2">
|
---|
17 | ]>
|
---|
18 |
|
---|
19 | <sect1 id="python2" xreflabel="Python-&python2-version;">
|
---|
20 | <?dbhtml filename="python2.html" ?>
|
---|
21 |
|
---|
22 | <sect1info>
|
---|
23 | <othername>$LastChangedBy$</othername>
|
---|
24 | <date>$Date$</date>
|
---|
25 | </sect1info>
|
---|
26 |
|
---|
27 | <title>Python-&python2-version;</title>
|
---|
28 |
|
---|
29 | <indexterm zone="python2">
|
---|
30 | <primary sortas="a-Python2">Python2</primary>
|
---|
31 | </indexterm>
|
---|
32 |
|
---|
33 | <sect2 role="package">
|
---|
34 | <title>Introduction to Python 2</title>
|
---|
35 |
|
---|
36 | <para>
|
---|
37 | The <application>Python 2</application> package contains the
|
---|
38 | <application>Python</application> development environment. It is useful
|
---|
39 | for object-oriented programming, writing scripts, prototyping large
|
---|
40 | programs or developing entire applications. This version is for backward
|
---|
41 | compatibility with other dependent packages.
|
---|
42 | </para>
|
---|
43 |
|
---|
44 | &lfs79_checked;
|
---|
45 |
|
---|
46 | &gcc6_checked;
|
---|
47 |
|
---|
48 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
49 | <itemizedlist spacing="compact">
|
---|
50 | <listitem>
|
---|
51 | <para>
|
---|
52 | Download (HTTP): <ulink url="&python2-download-http;"/>
|
---|
53 | </para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>
|
---|
57 | Download (FTP): <ulink url="&python2-download-ftp;"/>
|
---|
58 | </para>
|
---|
59 | </listitem>
|
---|
60 | <listitem>
|
---|
61 | <para>
|
---|
62 | Download MD5 sum: &python2-md5sum;
|
---|
63 | </para>
|
---|
64 | </listitem>
|
---|
65 | <listitem>
|
---|
66 | <para>
|
---|
67 | Download size: &python2-size;
|
---|
68 | </para>
|
---|
69 | </listitem>
|
---|
70 | <listitem>
|
---|
71 | <para>
|
---|
72 | Estimated disk space required: &python2-buildsize;
|
---|
73 | </para>
|
---|
74 | </listitem>
|
---|
75 | <listitem>
|
---|
76 | <para>
|
---|
77 | Estimated build time: &python2-time;
|
---|
78 | </para>
|
---|
79 | </listitem>
|
---|
80 | </itemizedlist>
|
---|
81 |
|
---|
82 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
83 |
|
---|
84 | <itemizedlist spacing="compact">
|
---|
85 | <title>Optional HTML Documentation</title>
|
---|
86 | <listitem>
|
---|
87 | <para>
|
---|
88 | Download (HTTP): <ulink url="&python2htmldoc-download-http;"/>
|
---|
89 | </para>
|
---|
90 | </listitem>
|
---|
91 | </itemizedlist>
|
---|
92 |
|
---|
93 | <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
|
---|
94 |
|
---|
95 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
96 | <para role="recommended">
|
---|
97 | <xref linkend="libffi"/>
|
---|
98 | </para>
|
---|
99 |
|
---|
100 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
101 | <para role="optional">
|
---|
102 | <xref linkend="bluez"/> and
|
---|
103 | <xref linkend="valgrind"/>
|
---|
104 | </para>
|
---|
105 |
|
---|
106 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
107 | <para role="optional">
|
---|
108 | <xref linkend="openssl"/>,
|
---|
109 | <xref linkend="sqlite"/> and
|
---|
110 | <xref linkend="tk"/>
|
---|
111 | </para>
|
---|
112 |
|
---|
113 | <note>
|
---|
114 | <para>
|
---|
115 | <!-- new for ff31. Any reasonable version of openssl will do,
|
---|
116 | even old maintained versions, so do not xref openssl here
|
---|
117 | Same thing for Seamonkey AFAIK now. I tried it on an older build
|
---|
118 | earlier. -->
|
---|
119 | If you are building <xref linkend="thunderbird"/>,
|
---|
120 | <xref linkend="firefox"/>, or <xref linkend="seamonkey"/>,
|
---|
121 | you must install <application>OpenSSL</application> before you build
|
---|
122 | <application>Python 2</application>.
|
---|
123 | </para>
|
---|
124 | </note>
|
---|
125 |
|
---|
126 | <para condition="html" role="usernotes">
|
---|
127 | User Notes: <ulink url="&blfs-wiki;/Python"/>
|
---|
128 | </para>
|
---|
129 | </sect2>
|
---|
130 |
|
---|
131 | <sect2 role="installation">
|
---|
132 | <title>Installation of Python 2</title>
|
---|
133 |
|
---|
134 | <para>
|
---|
135 | Install <application>Python 2</application> by running the following
|
---|
136 | commands:
|
---|
137 | </para>
|
---|
138 |
|
---|
139 | <screen><userinput>./configure --prefix=/usr \
|
---|
140 | --enable-shared \
|
---|
141 | --with-system-expat \
|
---|
142 | --with-system-ffi \
|
---|
143 | --enable-unicode=ucs4 &&
|
---|
144 | make</userinput></screen>
|
---|
145 |
|
---|
146 | <para>
|
---|
147 | To test the results, issue: <command>make -k test</command>.
|
---|
148 | Some tests fail for unknown reasons.
|
---|
149 | </para>
|
---|
150 |
|
---|
151 | <para>
|
---|
152 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
153 | </para>
|
---|
154 |
|
---|
155 | <screen role="root"><userinput>make install &&
|
---|
156 | chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
---|
157 |
|
---|
158 | <para>
|
---|
159 | Since <application>Python 2</application> is in maintenance mode, and
|
---|
160 | <application>Python 3</application> is recommended by upstream for
|
---|
161 | development, you probably do not need to install the documentation.
|
---|
162 | However, if you still want to install documentation for both
|
---|
163 | <application>Python</application> versions, be sure to define the
|
---|
164 | <envar>PYTHONDOCS</envar>
|
---|
165 | variable for the version you want to use, each time you need to consult
|
---|
166 | the documentation. If you have downloaded the preformatted documentation
|
---|
167 | from <ulink url="http://docs.python.org/download.html"/>, install it
|
---|
168 | as the <systemitem class="username">root</systemitem> user:
|
---|
169 | </para>
|
---|
170 |
|
---|
171 | <screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &&
|
---|
172 |
|
---|
173 | tar --strip-components=1 \
|
---|
174 | --no-same-owner \
|
---|
175 | --directory /usr/share/doc/python-&python2-version; \
|
---|
176 | -xvf ../python-&python2-version;-docs-html.tar.bz2 &&
|
---|
177 |
|
---|
178 | find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &&
|
---|
179 | find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
|
---|
180 | </sect2>
|
---|
181 |
|
---|
182 | <sect2 role="commands">
|
---|
183 | <title>Command Explanations</title>
|
---|
184 |
|
---|
185 | <para>
|
---|
186 | <option>--with-system-expat</option>: This switch enables linking against
|
---|
187 | system version of <application>Expat</application>, which was installed in LFS.
|
---|
188 | </para>
|
---|
189 |
|
---|
190 | <para>
|
---|
191 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
192 | system version of <application>libffi</application>. Remove if you have
|
---|
193 | not installed <xref linkend="libffi"/>.
|
---|
194 | </para>
|
---|
195 |
|
---|
196 | <para>
|
---|
197 | <parameter>--enable-unicode=ucs4</parameter>: This switch enables
|
---|
198 | 32bit Unicode support in <application>Python</application>.
|
---|
199 | </para>
|
---|
200 |
|
---|
201 | <para>
|
---|
202 | <parameter>--with-dbmliborder=bdb:gdbm:ndbm</parameter>: Use this switch
|
---|
203 | if you want to build <application>Python</application> DBM Module
|
---|
204 | against <application>Berkeley DB</application> instead of
|
---|
205 | <application>GDBM</application>.
|
---|
206 | </para>
|
---|
207 |
|
---|
208 | <para>
|
---|
209 | <command>chmod ...</command>: Fix permissions for libraries to be
|
---|
210 | consistent with other libraries.
|
---|
211 | </para>
|
---|
212 |
|
---|
213 | </sect2>
|
---|
214 |
|
---|
215 | <sect2 role="configuration">
|
---|
216 | <title>Configuring Python 2</title>
|
---|
217 |
|
---|
218 | <para>
|
---|
219 | In order for <command>python</command> to find the installed
|
---|
220 | documentation, you must add the following environment variable to
|
---|
221 | individual user's or the system's profile:
|
---|
222 | </para>
|
---|
223 |
|
---|
224 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
|
---|
225 |
|
---|
226 | </sect2>
|
---|
227 |
|
---|
228 | <sect2 role="content">
|
---|
229 | <title>Contents</title>
|
---|
230 |
|
---|
231 | <segmentedlist>
|
---|
232 | <segtitle>Installed Programs</segtitle>
|
---|
233 | <segtitle>Installed Library</segtitle>
|
---|
234 | <segtitle>Installed Directories</segtitle>
|
---|
235 |
|
---|
236 | <seglistitem>
|
---|
237 | <seg>
|
---|
238 | 2to3, pydoc, python (symlink), python-config (symlink),
|
---|
239 | python2 (symlink), python2-config (symlink),
|
---|
240 | python&python2-majorver;, python&python2-majorver;-config,
|
---|
241 | smtpd.py, and idle
|
---|
242 | </seg>
|
---|
243 | <seg>
|
---|
244 | libpython&python2-majorver;.so
|
---|
245 | </seg>
|
---|
246 | <seg>
|
---|
247 | /usr/{include,lib}/python&python2-majorver; and
|
---|
248 | /usr/share/doc/python-&python2-version;
|
---|
249 | </seg>
|
---|
250 | </seglistitem>
|
---|
251 | </segmentedlist>
|
---|
252 |
|
---|
253 | <variablelist>
|
---|
254 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
255 | <?dbfo list-presentation="list"?>
|
---|
256 | <?dbhtml list-presentation="table"?>
|
---|
257 |
|
---|
258 | <varlistentry id="python2-2to3">
|
---|
259 | <term><command>2to3</command></term>
|
---|
260 | <listitem>
|
---|
261 | <para>
|
---|
262 | is a <application>Python</application> program that reads
|
---|
263 | <application>Python 2.x</application> source code and applies a series of
|
---|
264 | fixers to transform it into valid <application>Python 3.x</application>
|
---|
265 | code.
|
---|
266 | </para>
|
---|
267 | <indexterm zone="python2 python2-2to3">
|
---|
268 | <primary sortas="b-2to3">2to3</primary>
|
---|
269 | </indexterm>
|
---|
270 | </listitem>
|
---|
271 | </varlistentry>
|
---|
272 |
|
---|
273 | <varlistentry id="idle">
|
---|
274 | <term><command>idle</command></term>
|
---|
275 | <listitem>
|
---|
276 | <para>
|
---|
277 | is a wrapper script that opens a <application>Python</application>
|
---|
278 | aware GUI editor. For this script to run, you must have installed
|
---|
279 | <application>Tk</application> before Python so that the Tkinter
|
---|
280 | Python module is built.
|
---|
281 | </para>
|
---|
282 | <indexterm zone="python2 idle">
|
---|
283 | <primary sortas="b-idle">idle</primary>
|
---|
284 | </indexterm>
|
---|
285 | </listitem>
|
---|
286 | </varlistentry>
|
---|
287 |
|
---|
288 | <varlistentry id="pydoc2">
|
---|
289 | <term><command>pydoc</command></term>
|
---|
290 | <listitem>
|
---|
291 | <para>
|
---|
292 | is the <application>Python</application> documentation tool.
|
---|
293 | </para>
|
---|
294 | <indexterm zone="python2 pydoc2">
|
---|
295 | <primary sortas="b-pydoc2">pydoc</primary>
|
---|
296 | </indexterm>
|
---|
297 | </listitem>
|
---|
298 | </varlistentry>
|
---|
299 |
|
---|
300 | <varlistentry id="python">
|
---|
301 | <term><command>python</command></term>
|
---|
302 | <listitem>
|
---|
303 | <para>
|
---|
304 | is an interpreted, interactive, object-oriented programming
|
---|
305 | language.
|
---|
306 | </para>
|
---|
307 | <indexterm zone="python2 python">
|
---|
308 | <primary sortas="b-python2">python</primary>
|
---|
309 | </indexterm>
|
---|
310 | </listitem>
|
---|
311 | </varlistentry>
|
---|
312 |
|
---|
313 | <varlistentry id="python2-ver">
|
---|
314 | <term><command>python&python2-majorver;</command></term>
|
---|
315 | <listitem>
|
---|
316 | <para>
|
---|
317 | is a version-specific name for the <command>python</command>
|
---|
318 | program.
|
---|
319 | </para>
|
---|
320 | <indexterm zone="python2 python2-ver">
|
---|
321 | <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
---|
322 | </indexterm>
|
---|
323 | </listitem>
|
---|
324 | </varlistentry>
|
---|
325 |
|
---|
326 | <varlistentry id="smtpd.py">
|
---|
327 | <term><command>smtpd.py</command></term>
|
---|
328 | <listitem>
|
---|
329 | <para>
|
---|
330 | is an SMTP proxy implemented in <application>Python</application>.
|
---|
331 | </para>
|
---|
332 | <indexterm zone="python2 smtpd.py">
|
---|
333 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
334 | </indexterm>
|
---|
335 | </listitem>
|
---|
336 | </varlistentry>
|
---|
337 |
|
---|
338 | </variablelist>
|
---|
339 |
|
---|
340 | </sect2>
|
---|
341 |
|
---|
342 | </sect1>
|
---|