source: general/prog/python2.xml@ 6397333

basic
Last change on this file since 6397333 was 6397333, checked in by Bruce Dubbs <bdubbs@…>, 6 years ago

Convert internal like to external links for BLFS packages not in
the Basic book.

Reorder some chapters.

Merge System V and systemd sections so both are always displayed
with proper attribution for system type.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/basic@20524 af4574ff-66df-0310-9fd7-8a98e5e911e0

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