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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 8aeb474 was f695fc0, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Update to docbook-xsl-1.77.1

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

  • Property mode set to 100644
File size: 11.5 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 "http://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
9 <!ENTITY python2-download-ftp " ">
10 <!-- <!ENTITY python2-download-ftp "&gentoo-ftp-repo;/Python-&python2-version;.tar.xz"> -->
11 <!ENTITY python2-md5sum "62c4c1699170078c469f79ddfed21bc0">
12 <!ENTITY python2-size "9.6 MB">
13 <!ENTITY python2-buildsize "235 MB (not including the test suite)">
14 <!ENTITY python2-time "1.1 SBU (not including the test suite)">
15 <!ENTITY python2htmldoc-download-http
16 "http://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
17 <!ENTITY python2htmldoc-md5sum "101c13d39f76fd6706aac3a9196b2f01">
18 <!ENTITY python2htmldoc-size "4.2 MB">
19]>
20
21<sect1 id="python2" xreflabel="Python-&python2-version;">
22 <?dbhtml filename="python2.html" ?>
23
24 <sect1info>
25 <othername>$LastChangedBy$</othername>
26 <date>$Date$</date>
27 </sect1info>
28
29 <title>Python-&python2-version;</title>
30
31 <indexterm zone="python2">
32 <primary sortas="a-Python2">Python</primary>
33 </indexterm>
34
35 <sect2 role="package">
36 <title>Introduction to Python 2</title>
37
38 <para>
39 The <application>Python 2</application> package contains the
40 <application>Python</application> development environment. This is useful
41 for object-oriented programming, writing scripts, prototyping large
42 programs or developing entire applications. This version is for backward
43 compatibility with other dependent packages.
44 </para>
45
46 &lfs72_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 <listitem>
92 <para>
93 Download MD5 sum: &python2htmldoc-md5sum;
94 </para>
95 </listitem>
96 <listitem>
97 <para>
98 Download size: &python2htmldoc-size;
99 </para>
100 </listitem>
101 </itemizedlist>
102
103 <bridgehead renderas="sect3">Python Dependencies</bridgehead>
104
105 <bridgehead renderas="sect4">Optional</bridgehead>
106 <para role="optional">
107 <!-- <xref linkend="pth"/> can only be used if you've overwritten glibc's
108 libpthread. -->
109 <xref linkend="libffi"/> and <xref linkend="pkgconfig"/>
110 (<command>configure</command> uses <command>pkgconfig</command> to find
111 <application>libffi</application>. There is a circular dependency here:
112 <application>Pkgconfig</application> requires
113 <application>Glib</application> which requires
114 <application>Python 2</application>),
115 <!-- gcc's libffi does not install a pkgconfig file -->
116 <ulink url="http://sphinx.pocoo.org/">Sphinx</ulink> (to create the docs),
117 <xref linkend="bluez"/>,
118 <xref linkend="openssl"/>,
119 <xref linkend="tk"/> (there is a circular dependency with the
120 <application>Tk</application> package as it requires Xorg to be installed
121 but parts of Xorg depend on <application>Python</application>),
122 <!--<xref linkend="db"/> and-->
123 <ulink
124 url="http://www.oracle.com/technetwork/products/berkeleydb/downloads/">BerkeleyDB</ulink>
125 (only versions up to 4.8), and
126 <xref linkend="sqlite"/>.
127 </para>
128
129 <para condition="html" role="usernotes">
130 User Notes: <ulink url="&blfs-wiki;/Python"/>
131 </para>
132 </sect2>
133
134 <sect2 role="installation">
135 <title>Installation of Python</title>
136
137 <para>
138 Install <application>Python</application> by running the following
139 commands:
140 </para>
141
142<screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &amp;&amp;
143./configure --prefix=/usr --enable-shared &amp;&amp;
144make</userinput></screen>
145
146 <para>
147 To test the results, issue: <command>make test</command>.
148 </para>
149
150 <para>
151 In order to use the <command>help ('name_string')</command> feature of the
152 <command>python</command> interpreter with some statements and keywords,
153 you must create or download the optional HTML documentation.
154 </para>
155
156 <para>
157 If you have installed <ulink url="http://sphinx.pocoo.org/">Sphinx</ulink>
158 and wish to create the HTML documentation:
159 </para>
160
161<screen><userinput>make -C Doc html</userinput></screen>
162
163 <para>
164 Now, as the <systemitem class="username">root</systemitem> user:
165 </para>
166
167<screen role="root"><userinput>make install &amp;&amp;
168chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
169
170 <para>
171 If you created the html documentation with
172 <application>Sphinx</application> then install it as the
173 <systemitem class="username">root</systemitem> user:
174 </para>
175
176<screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version; &amp;&amp;
177cp -rfv Doc/build/html/* /usr/share/doc/python-&python2-version;</userinput></screen>
178
179 <para>
180 Alternatively, you can download preformatted documentation from
181 <ulink url="http://docs.python.org/download.html"/> and install it as the
182 <systemitem class="username">root</systemitem> user:
183 </para>
184
185<screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version; &amp;&amp;
186tar --strip-components=1 -C /usr/share/doc/Python-&python2-version; \
187 -xvf ../python-&python2-version;-docs-html.tar.bz2 &amp;&amp;
188find /usr/share/doc/Python-&python2-version; -type d -exec chmod 0755 {} \; &amp;&amp;
189find /usr/share/doc/Python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
190 </sect2>
191
192 <sect2 role="commands">
193 <title>Command Explanations</title>
194
195 <para>
196 <option>--with-system-ffi</option>: If you have installed
197 <application>Libffi</application> and
198 <application>Pkgconfig</application>, add this option to compile
199 <application>Python</application>'s _ctypes module using the system
200 installed <application>Libffi</application>. Otherwise
201 <application>Python</application> will compile its own copy of
202 <application>Libffi</application>.
203 </para>
204
205 <para>
206 <command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command is
207 used to fix a build problem with the <application>GDBM</application>
208 library.
209 </para>
210
211 <para>
212 <command>chmod ...</command>: Fix permissions for libraries to be
213 consistent with other libraries.
214 </para>
215 </sect2>
216
217 <sect2 role="configuration">
218 <title>Configuring Python 2</title>
219
220 <para>
221 In order for <command>python</command> to find the installed
222 documentation, you must add the following environment variable to
223 individual user's or the system's profile:
224 </para>
225
226<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python2-version;</userinput></screen>
227 </sect2>
228
229 <sect2 role="content">
230 <title>Contents</title>
231
232 <segmentedlist>
233 <segtitle>Installed Programs</segtitle>
234 <segtitle>Installed Libraries</segtitle>
235 <segtitle>Installed Directories</segtitle>
236
237 <seglistitem>
238 <seg>
239 2to3, pydoc, python, python-config, python&python2-majorver;,
240 python&python2-majorver;-config, smtpd.py, and optionally if
241 <application>Tk</application> is installed, idle
242 </seg>
243 <seg>
244 libpython&python2-majorver;.so and numerous modules installed in
245 /usr/lib/python&python2-majorver;/lib-dynload
246 </seg>
247 <seg>
248 /usr/include/python&python2-majorver;,
249 /usr/lib/python&python2-majorver;, and
250 /usr/share/doc/python-&python2-version;</seg>
251 </seglistitem>
252 </segmentedlist>
253
254 <variablelist>
255 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
256 <?dbfo list-presentation="list"?>
257 <?dbhtml list-presentation="table"?>
258
259 <varlistentry id="python2-2to3">
260 <term><command>2to3</command></term>
261 <listitem>
262 <para>
263 is a <application>Python</application> program that reads
264 <application>Python 2.x</application> source code and applies a series of
265 fixers to transform it into valid <application>Python 3.x</application>
266 code.
267 </para>
268 <indexterm zone="python2 python2-2to3">
269 <primary sortas="b-2to3">2to3</primary>
270 </indexterm>
271 </listitem>
272 </varlistentry>
273
274 <varlistentry id="idle2">
275 <term><command>idle</command></term>
276 <listitem>
277 <para>
278 is a wrapper script that opens a <application>Python</application>
279 aware GUI editor.
280 </para>
281 <indexterm zone="python2 idle2">
282 <primary sortas="b-idle2">idle</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="pydoc2">
288 <term><command>pydoc</command></term>
289 <listitem>
290 <para>
291 is the <application>Python</application> documentation tool.
292 </para>
293 <indexterm zone="python2 pydoc2">
294 <primary sortas="b-pydoc2">pydoc</primary>
295 </indexterm>
296 </listitem>
297 </varlistentry>
298
299 <varlistentry id="python">
300 <term><command>python</command></term>
301 <listitem>
302 <para>
303 is an interpreted, interactive, object-oriented programming
304 language.
305 </para>
306 <indexterm zone="python2 python">
307 <primary sortas="b-python2">python</primary>
308 </indexterm>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry id="python2-ver">
313 <term><command>python&python2-majorver;</command></term>
314 <listitem>
315 <para>
316 is a version-specific name for the <command>python</command>
317 program.
318 </para>
319 <indexterm zone="python2 python2-ver">
320 <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
321 </indexterm>
322 </listitem>
323 </varlistentry>
324
325 <varlistentry id="smtpd.py2">
326 <term><command>smtpd.py</command></term>
327 <listitem>
328 <para>
329 is an SMTP proxy implemented in <application>Python</application>.
330 </para>
331 <indexterm zone="python2 smtpd.py2">
332 <primary sortas="b-smtpd.py2">smtpd.py</primary>
333 </indexterm>
334 </listitem>
335 </varlistentry>
336 </variablelist>
337 </sect2>
338</sect1>
Note: See TracBrowser for help on using the repository browser.