source: general/prog/python2.xml@ 8d52465b

11.0 lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 8d52465b was 8d52465b, checked in by Douglas R. Reno <renodr@…>, 6 months ago

Python2: Remove extra newline before the patch is applied
Hexchat: Fix python plugin and temporarily disable lua plugin

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24425 af4574ff-66df-0310-9fd7-8a98e5e911e0

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