source: general/prog/python2.xml@ fbc2084

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt 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 fbc2084 was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 3 years ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

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