source: general/prog/python2.xml

trunk
Last change on this file was 99c90fa, checked in by Douglas R. Reno <renodr@…>, 2 months ago

Lots of tags

  • Property mode set to 100644
File size: 11.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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 "fd6cc8ec0a78c44036f825e739f36e5a">
11 <!ENTITY python2-size "12.2 MB">
12 <!ENTITY python2-buildsize "228 MB (add 17 MB for tests)">
13 <!ENTITY python2-time "0.5 SBU (Using parallelism=4; add 5.9 SBU for tests)">
14
15 <!ENTITY python2htmldoc-download-http
16 "https://www.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
17]>
18
19<sect1 id="python2" xreflabel="Python-&python2-version;">
20 <?dbhtml filename="python2.html" ?>
21
22
23 <title>Python-&python2-version;</title>
24
25 <indexterm zone="python2">
26 <primary sortas="a-Python2">Python2</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Python 2</title>
31
32 <para>
33 The <application>Python 2</application> package contains the
34 <application>Python</application> development environment. It is useful
35 for object-oriented programming, writing scripts, prototyping large
36 programs or developing entire applications. This version is for backward
37 compatibility with other dependent packages.
38 </para>
39
40 <note>
41 <para>
42 Python2 has been deprecated by the upstream developers.
43 Support for Python2 was discontinued on January 1st, 2020.
44 </para>
45
46 <para>
47 BLFS is attempting to use Python3 as much as possible, but some
48 packages have not been updated to support Python3.
49 </para>
50 </note>
51
52 &lfs121_checked;
53
54 <bridgehead renderas="sect3">Package Information</bridgehead>
55 <itemizedlist spacing="compact">
56 <listitem>
57 <para>
58 Download (HTTP): <ulink url="&python2-download-http;"/>
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Download (FTP): <ulink url="&python2-download-ftp;"/>
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Download MD5 sum: &python2-md5sum;
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Download size: &python2-size;
74 </para>
75 </listitem>
76 <listitem>
77 <para>
78 Estimated disk space required: &python2-buildsize;
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 Estimated build time: &python2-time;
84 </para>
85 </listitem>
86 </itemizedlist>
87
88 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
89
90 <itemizedlist spacing="compact">
91 <listitem>
92 <para>
93 Required patch:
94 <ulink url="&patch-root;/Python-&python2-version;-security_fixes-1.patch"/>
95 </para>
96 </listitem>
97 <listitem>
98 <para>
99 Optional HTML Documentation: <ulink url="&python2htmldoc-download-http;"/>
100 </para>
101 </listitem>
102 </itemizedlist>
103
104
105 <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
106
107 <bridgehead renderas="sect4">Recommended</bridgehead>
108 <para role="recommended">
109 <xref linkend="sqlite"/> (For an additional module)
110 </para>
111
112 <bridgehead renderas="sect4">Optional</bridgehead>
113 <para role="optional">
114 <xref linkend="bluez"/> and
115 <xref linkend="valgrind"/>
116 </para>
117
118 <bridgehead renderas="sect4">Optional (For more additional modules)</bridgehead>
119 <para role="optional">
120 <xref linkend="libnsl"/> and
121 <xref linkend="tk"/>
122 </para>
123
124 </sect2>
125
126 <sect2 role="installation">
127 <title>Installation of Python 2</title>
128
129 <para>
130 First, disable the installation of a script that overwrites a more
131 recent script:
132 </para>
133
134<screen><userinput>sed -i '/2to3/d' ./setup.py</userinput></screen>
135
136 <para>
137 Install <application>Python 2</application> by running the following
138 commands:
139 </para>
140
141<screen><userinput>patch -Np1 -i ../Python-&python2-version;-security_fixes-1.patch &amp;&amp;
142./configure --prefix=/usr \
143 --enable-shared \
144 --with-system-expat \
145 --with-system-ffi \
146 --enable-unicode=ucs4 &amp;&amp;
147make</userinput></screen>
148
149 <para>
150 If you invoke the tests, they will run through twice.
151 To test the results, issue: <command>make -k test</command>.
152 <!-- https://bugs.python.org/issue46811 -->
153 Several tests are known to fail, including
154 <literal>test_ftplib</literal>,
155 <literal>test_ssl</literal>,
156 <literal>test_urllib2_localnet</literal>,
157 <literal>test_xml_etree</literal>,
158 <literal>test_xml_etree_c</literal>, and
159 <literal>test_minidom</literal>. These failures are due to
160 OpenSSL-3 and Expat-2.4.6.
161 </para>
162
163 <para>
164 Now, as the <systemitem class="username">root</systemitem> user:
165 </para>
166
167<screen role="root"><userinput>make altinstall &amp;&amp;
168ln -s python2.7 /usr/bin/python2 &amp;&amp;
169ln -s python2.7-config /usr/bin/python2-config &amp;&amp;
170chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
171
172 <para>
173 Since <application>Python 2</application> is in maintenance mode, and
174 <application>Python 3</application> is recommended by upstream for
175 development, you probably do not need to install the documentation.
176 However, if you still want to install documentation for both
177 <application>Python</application> versions, be sure to define the
178 <envar>PYTHONDOCS</envar>
179 variable for the version you want to use, each time you need to consult
180 the documentation. If you have downloaded the preformatted documentation
181 from <ulink url="https://docs.python.org/download.html"/>, install it
182 as the <systemitem class="username">root</systemitem> user:
183 </para>
184
185<screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &amp;&amp;
186
187tar --strip-components=1 \
188 --no-same-owner \
189 --directory /usr/share/doc/python-&python2-version; \
190 -xvf ../python-&python2-version;-docs-html.tar.bz2 &amp;&amp;
191
192find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &amp;&amp;
193find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
194 </sect2>
195
196 <sect2 role="commands">
197 <title>Command Explanations</title>
198
199 <para>
200 <parameter>--with-system-expat</parameter>: This switch enables linking
201 against system version of <application>Expat</application>.
202 </para>
203
204 <para>
205 <parameter>--with-system-ffi</parameter>: This switch enables linking
206 against system version of <application>libffi</application>.
207 </para>
208
209 <para>
210 <parameter>--enable-unicode=ucs4</parameter>: This switch enables
211 32-bit Unicode support in <application>Python</application>.
212 </para>
213
214 <para>
215 <option>--with-ensurepip=yes</option> : This switch enables building
216 <command>pip</command> and <command>setuptools</command> packaging programs.
217 <command>setuptools</command> is needed for building some Python modules.
218 This switch is not recommended because this version of Python is no longer
219 maintained.
220 </para>
221
222 <para>
223 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
224 if you want to build <application>Python</application> DBM Module
225 against <application>Berkeley DB</application> instead of
226 <application>GDBM</application>.
227 </para>
228
229 <para>
230 <command>make altinstall</command>: This make target omits some default
231 symbolic links that may interfere with Python 3.
232 </para>
233
234 <para>
235 <command>chmod ...</command>: Fix permissions for libraries to be
236 consistent with other libraries.
237 </para>
238
239 </sect2>
240
241 <sect2 role="configuration">
242 <title>Configuring Python 2</title>
243
244 <para>
245 In order for <command>python</command> to find the installed
246 documentation, you must add the following environment variable to
247 individual user's or the system's profile:
248 </para>
249
250<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
251
252 </sect2>
253
254 <sect2 role="content">
255 <title>Contents</title>
256
257 <segmentedlist>
258 <segtitle>Installed Programs</segtitle>
259 <segtitle>Installed Library</segtitle>
260 <segtitle>Installed Directories</segtitle>
261
262 <seglistitem>
263 <seg>
264 pydoc,
265 python2 (symlink),
266 python2-config (symlink),
267 python&python2-majorver;,
268 python&python2-majorver;-config,
269 smtpd.py, and
270 idle
271 </seg>
272 <seg>
273 libpython&python2-majorver;.so
274 </seg>
275 <seg>
276 /usr/{include,lib}/python&python2-majorver; and
277 /usr/share/doc/python-&python2-version;
278 </seg>
279 </seglistitem>
280 </segmentedlist>
281
282 <variablelist>
283 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
284 <?dbfo list-presentation="list"?>
285 <?dbhtml list-presentation="table"?>
286
287 <varlistentry id="idle">
288 <term><command>idle</command></term>
289 <listitem>
290 <para>
291 is a wrapper script that opens a <application>Python</application>
292 aware GUI editor. For this script to run, you must have installed
293 <application>Tk</application> before Python so that the Tkinter
294 Python module is built
295 </para>
296 <indexterm zone="python2 idle">
297 <primary sortas="b-idle">idle</primary>
298 </indexterm>
299 </listitem>
300 </varlistentry>
301
302 <varlistentry id="pydoc2">
303 <term><command>pydoc</command></term>
304 <listitem>
305 <para>
306 is the <application>Python</application> documentation tool
307 </para>
308 <indexterm zone="python2 pydoc2">
309 <primary sortas="b-pydoc2">pydoc</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry id="python">
315 <term><command>python2</command></term>
316 <listitem>
317 <para>
318 is an interpreted, interactive, object-oriented programming
319 language
320 </para>
321 <indexterm zone="python2 python">
322 <primary sortas="b-python2">python</primary>
323 </indexterm>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry id="python2-ver">
328 <term><command>python&python2-majorver;</command></term>
329 <listitem>
330 <para>
331 is a version-specific name for the <command>python</command>
332 program
333 </para>
334 <indexterm zone="python2 python2-ver">
335 <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
336 </indexterm>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry id="smtpd.py">
341 <term><command>smtpd.py</command></term>
342 <listitem>
343 <para>
344 is an SMTP proxy implemented in <application>Python</application>
345 </para>
346 <indexterm zone="python2 smtpd.py">
347 <primary sortas="b-smtpd.py">smtpd.py</primary>
348 </indexterm>
349 </listitem>
350 </varlistentry>
351
352 </variablelist>
353
354 </sect2>
355
356</sect1>
Note: See TracBrowser for help on using the repository browser.