source: general/prog/python2.xml@ b8bc70d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since b8bc70d was 73f65d9e, checked in by Bruce Dubbs <bdubbs@…>, 6 years ago

Update to wget-1.19.3.
Update to LibRaw-0.18.7.
Update to libuv-1.19.1.

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

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