[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 |
|
---|
| 7 | <!ENTITY python2-download-http "http://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
|
---|
[27d9434] | 8 | <!ENTITY python2-download-ftp " ">
|
---|
| 9 | <!-- <!ENTITY python2-download-ftp "&gentoo-ftp-repo;/Python-&python2-version;.tar.xz"> -->
|
---|
[bf847d6d] | 10 | <!ENTITY python2-md5sum "75c87a80c6ddb0b785a57ea3583e04fa">
|
---|
| 11 | <!ENTITY python2-size "9.5 MB">
|
---|
| 12 | <!ENTITY python2-buildsize "235 MB (not including the test suite)">
|
---|
| 13 | <!ENTITY python2-time "1 SBU (not including the test suite)">
|
---|
[27d9434] | 14 | <!ENTITY python2htmldoc-download-http "http://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
|
---|
[bf847d6d] | 15 | <!ENTITY python2htmldoc-md5sum "40f0bd51b221662cae14fb0c6b6f622b">
|
---|
| 16 | <!ENTITY python2htmldoc-size "4.1 MB">
|
---|
| 17 | ]>
|
---|
| 18 |
|
---|
[b88be39] | 19 | <sect1 id="python" xreflabel="Python-&python2-version;">
|
---|
[bf847d6d] | 20 | <?dbhtml filename="python2.html" ?>
|
---|
| 21 |
|
---|
| 22 | <sect1info>
|
---|
[4949485e] | 23 | <othername>$LastChangedBy$</othername>
|
---|
| 24 | <date>$Date$</date>
|
---|
[bf847d6d] | 25 | </sect1info>
|
---|
| 26 |
|
---|
| 27 | <title>Python-&python2-version;</title>
|
---|
| 28 |
|
---|
[b88be39] | 29 | <indexterm zone="python">
|
---|
[bf847d6d] | 30 | <primary sortas="a-Python2">Python</primary>
|
---|
| 31 | </indexterm>
|
---|
| 32 |
|
---|
| 33 | <sect2 role="package">
|
---|
| 34 | <title>Introduction to Python 2</title>
|
---|
| 35 |
|
---|
| 36 | <para>The <application>Python 2</application> package contains the
|
---|
| 37 | <application>Python</application> development environment.
|
---|
| 38 | This is useful for object-oriented programming, writing scripts,
|
---|
| 39 | prototyping large programs or developing entire applications. This version
|
---|
| 40 | is for backward compatibility with other dependent packages.</para>
|
---|
| 41 |
|
---|
| 42 | <!-- Python compiled against Pth, OpenSSL, and SQLite.
|
---|
| 43 | 326 tests OK, 36 tests skipped, 0 failures -->
|
---|
| 44 |
|
---|
| 45 | &lfs70_checked;
|
---|
| 46 |
|
---|
| 47 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 48 | <itemizedlist spacing="compact">
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (HTTP): <ulink url="&python2-download-http;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download (FTP): <ulink url="&python2-download-ftp;"/></para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download MD5 sum: &python2-md5sum;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Download size: &python2-size;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated disk space required: &python2-buildsize;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>Estimated build time: &python2-time;</para>
|
---|
| 66 | </listitem>
|
---|
| 67 | </itemizedlist>
|
---|
| 68 |
|
---|
| 69 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 70 |
|
---|
| 71 | <itemizedlist spacing='compact'>
|
---|
| 72 | <title>Optional HTML Documentation</title>
|
---|
| 73 | <listitem>
|
---|
| 74 | <para>Download (HTTP): <ulink url="&python2htmldoc-download-http;"/></para>
|
---|
| 75 | </listitem>
|
---|
| 76 | <listitem>
|
---|
| 77 | <para>Download MD5 sum: &python2htmldoc-md5sum;</para>
|
---|
| 78 | </listitem>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>Download size: &python2htmldoc-size;</para>
|
---|
| 81 | </listitem>
|
---|
| 82 | </itemizedlist>
|
---|
| 83 |
|
---|
| 84 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
| 85 |
|
---|
| 86 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 87 | <para role="optional"><xref linkend="pth"/>,
|
---|
| 88 | <xref linkend="libffi"/> or <xref linkend="gcc"/> (install JAVA so that the
|
---|
| 89 | <filename class="libraryfile">libffi</filename> library is built), and
|
---|
| 90 | <ulink url="http://www.bluez.org/">BlueZ</ulink></para>
|
---|
| 91 |
|
---|
| 92 | <bridgehead renderas="sect4">Optional
|
---|
| 93 | (to create package-specific support modules)</bridgehead>
|
---|
| 94 | <para role="optional"><xref linkend="openssl"/>,
|
---|
| 95 | <xref linkend="tk"/>,
|
---|
| 96 | <xref linkend="db"/>, and
|
---|
| 97 | <xref linkend="sqlite"/></para>
|
---|
| 98 |
|
---|
| 99 | <para>Note that there is a circular dependency with the
|
---|
| 100 | <application>Tk</application> package as it requires Xorg to be installed
|
---|
| 101 | but parts of Xorg depend on <application>Python</application>.</para>
|
---|
| 102 |
|
---|
| 103 | <para condition="html" role="usernotes">User Notes:
|
---|
| 104 | <ulink url="&blfs-wiki;/Python"/></para>
|
---|
| 105 |
|
---|
| 106 | </sect2>
|
---|
| 107 |
|
---|
| 108 | <sect2 role="installation">
|
---|
| 109 | <title>Installation of Python</title>
|
---|
| 110 |
|
---|
| 111 | <para>Install <application>Python</application> by running the following
|
---|
| 112 | commands:</para>
|
---|
| 113 |
|
---|
| 114 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
|
---|
| 115 | ./configure --prefix=/usr --enable-shared &&
|
---|
| 116 | make</userinput></screen>
|
---|
| 117 |
|
---|
| 118 | <para>To test the results, issue: <command>make test</command>. Note that
|
---|
| 119 | if you have an existing <application>Python 2</application> installation
|
---|
| 120 | which includes the <application>PyXML</application> module, the tests could
|
---|
| 121 | produce a segmentation fault.</para>
|
---|
| 122 |
|
---|
| 123 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 124 |
|
---|
[7224506] | 125 | <screen role="root"><userinput>make install &&
|
---|
| 126 | chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
---|
[bf847d6d] | 127 |
|
---|
| 128 | <para>There is no documentation installed using the instructions above.
|
---|
| 129 | See the <filename>Doc/README.txt</filename> file in the source
|
---|
| 130 | distribution for instructions on how to create the html. Alternatively,
|
---|
| 131 | you can download preformatted documentation from <ulink
|
---|
| 132 | url="http://docs.python.org/download.html"/>.</para>
|
---|
| 133 |
|
---|
| 134 | <para>In order to use the <command>help ('name_string')</command> feature
|
---|
| 135 | of the <command>python</command> interpreter with some statements and
|
---|
| 136 | keywords, you must download (or create) the optional HTML documentation
|
---|
| 137 | and install it. If you downloaded the HTML docs, issue the following
|
---|
| 138 | commands as the
|
---|
| 139 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 140 |
|
---|
| 141 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version;/html &&
|
---|
| 142 | tar --strip-components=1 \
|
---|
| 143 | --no-same-owner \
|
---|
| 144 | --no-same-permissions \
|
---|
| 145 | -C /usr/share/doc/Python-&python2-version;/html \
|
---|
[716ca8aa] | 146 | -xvf ../python-&python2-version;-docs-html.tar.bz2</userinput></screen>
|
---|
[bf847d6d] | 147 |
|
---|
| 148 | </sect2>
|
---|
| 149 |
|
---|
| 150 | <sect2 role="commands">
|
---|
| 151 | <title>Command Explanations</title>
|
---|
| 152 |
|
---|
| 153 | <para><command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command
|
---|
| 154 | is used to fix a build problem with the <application>GDBM</application>
|
---|
| 155 | library.</para>
|
---|
| 156 |
|
---|
[7224506] | 157 | <para><command>chmod ...</command>: Fix permissions for libraries to be
|
---|
| 158 | consistent with other libraries.</para>
|
---|
| 159 |
|
---|
[bf847d6d] | 160 | </sect2>
|
---|
| 161 |
|
---|
| 162 | <sect2 role="configuration">
|
---|
| 163 | <title>Configuring Python 2</title>
|
---|
| 164 |
|
---|
| 165 | <para>In order for <command>python</command> to find the installed
|
---|
| 166 | documentation, you must add the following environment variable to
|
---|
| 167 | individual user's or the system's profile:</para>
|
---|
| 168 |
|
---|
| 169 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python2-version;/html</userinput></screen>
|
---|
| 170 |
|
---|
| 171 | </sect2>
|
---|
| 172 |
|
---|
| 173 | <sect2 role="content">
|
---|
| 174 | <title>Contents</title>
|
---|
| 175 |
|
---|
| 176 | <segmentedlist>
|
---|
| 177 | <segtitle>Installed Programs</segtitle>
|
---|
| 178 | <segtitle>Installed Libraries</segtitle>
|
---|
| 179 | <segtitle>Installed Directories</segtitle>
|
---|
| 180 |
|
---|
| 181 | <seglistitem>
|
---|
| 182 | <seg>pydoc, python, python-config, python&python2-majorver;,
|
---|
| 183 | python&python2-majorver;-config, smtpd.py, and optionally if
|
---|
| 184 | <application>Tk</application> is installed, idle</seg>
|
---|
| 185 | <seg>libpython&python2-majorver;.so and numerous modules installed in
|
---|
| 186 | /usr/lib/python&python2-majorver;/lib-dynload</seg>
|
---|
| 187 | <seg>/usr/include/python&python2-majorver;,
|
---|
| 188 | /usr/lib/python&python2-majorver;, and
|
---|
| 189 | /usr/share/doc/python-&python2-version;</seg>
|
---|
| 190 | </seglistitem>
|
---|
| 191 | </segmentedlist>
|
---|
| 192 |
|
---|
| 193 | <variablelist>
|
---|
| 194 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 195 | <?dbfo list-presentation="list"?>
|
---|
| 196 | <?dbhtml list-presentation="table"?>
|
---|
| 197 |
|
---|
| 198 | <varlistentry id="idle2">
|
---|
| 199 | <term><command>idle</command></term>
|
---|
| 200 | <listitem>
|
---|
| 201 | <para>is a wrapper script that opens a
|
---|
| 202 | <application>Python</application> aware GUI editor.</para>
|
---|
[b88be39] | 203 | <indexterm zone="python idle2">
|
---|
[bf847d6d] | 204 | <primary sortas="b-idle2">idle</primary>
|
---|
| 205 | </indexterm>
|
---|
| 206 | </listitem>
|
---|
| 207 | </varlistentry>
|
---|
| 208 |
|
---|
| 209 | <varlistentry id="pydoc2">
|
---|
| 210 | <term><command>pydoc</command></term>
|
---|
| 211 | <listitem>
|
---|
| 212 | <para>is the <application>Python</application> documentation
|
---|
| 213 | tool.</para>
|
---|
[b88be39] | 214 | <indexterm zone="python pydoc2">
|
---|
[bf847d6d] | 215 | <primary sortas="b-pydoc2">pydoc</primary>
|
---|
| 216 | </indexterm>
|
---|
| 217 | </listitem>
|
---|
| 218 | </varlistentry>
|
---|
| 219 |
|
---|
| 220 | <varlistentry id="python2-prog">
|
---|
| 221 | <term><command>python</command></term>
|
---|
| 222 | <listitem>
|
---|
| 223 | <para>is an interpreted, interactive, object-oriented programming
|
---|
| 224 | language.</para>
|
---|
[b88be39] | 225 | <indexterm zone="python python2-prog">
|
---|
| 226 | <primary sortas="b-python">python</primary>
|
---|
[bf847d6d] | 227 | </indexterm>
|
---|
| 228 | </listitem>
|
---|
| 229 | </varlistentry>
|
---|
| 230 |
|
---|
| 231 | <varlistentry id="python2-ver">
|
---|
| 232 | <term><command>python&python2-majorver;</command></term>
|
---|
| 233 | <listitem>
|
---|
| 234 | <para>is a version-specific name for the <command>python</command>
|
---|
| 235 | program.</para>
|
---|
[b88be39] | 236 | <indexterm zone="python python2-ver">
|
---|
| 237 | <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
---|
[bf847d6d] | 238 | </indexterm>
|
---|
| 239 | </listitem>
|
---|
| 240 | </varlistentry>
|
---|
| 241 |
|
---|
| 242 | <varlistentry id="smtpd.py2">
|
---|
| 243 | <term><command>smtpd.py</command></term>
|
---|
| 244 | <listitem>
|
---|
| 245 | <para>is an SMTP proxy implemented in
|
---|
| 246 | <application>Python</application>.</para>
|
---|
[b88be39] | 247 | <indexterm zone="python smtpd.py2">
|
---|
[bf847d6d] | 248 | <primary sortas="b-smtpd.py2">smtpd.py</primary>
|
---|
| 249 | </indexterm>
|
---|
| 250 | </listitem>
|
---|
| 251 | </varlistentry>
|
---|
| 252 |
|
---|
| 253 | </variablelist>
|
---|
| 254 |
|
---|
| 255 | </sect2>
|
---|
| 256 |
|
---|
| 257 | </sect1>
|
---|