~ubuntu-branches/ubuntu/karmic/python2.6/karmic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/distutils-install-layout.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-04-14 08:09:24 UTC
  • Revision ID: james.westby@ubuntu.com-20090414080924-ajkc33w750r2jpk3
Tags: 2.6.2~rc1-0ubuntu2
* Update to 20090414, taken from the 2.6 release branch.
  - No numbered table of contents for the docs, not in sphinx-0.5.
  - Fix issues #5731, #5741.
* Revert the change to interpret an unexpanded prefix in get_python_lib().
* Fix build failure on ia64.
* Move the bdist_wininst files into the -dev package (only needed to build
  windows installers).
* Document changes to the site directory name in the installation manual.

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
 
166
166
--- ./Lib/distutils/sysconfig.py.orig   2009-03-27 19:47:42.000000000 +0100
167
167
+++ ./Lib/distutils/sysconfig.py        2009-04-02 16:52:41.000000000 +0200
168
 
@@ -111,6 +111,10 @@
 
168
@@ -111,6 +111,7 @@
169
169
     If 'prefix' is supplied, use it instead of sys.prefix or
170
170
     sys.exec_prefix -- i.e., ignore 'plat_specific'.
171
171
     """
172
 
+    # work around an automake expansion bug
173
 
+    if prefix and prefix in ('${prefix}', '${exec_prefix}') and not 'real_prefix' in sys.__dict__:
174
 
+        prefix = '/usr/local'
175
172
+    is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local')
176
173
     if prefix is None:
177
174
         prefix = plat_specific and EXEC_PREFIX or PREFIX
185
182
         else:
186
183
             return os.path.join(libpython, "site-packages")
187
184
 
 
185
--- Doc/install/index.rst~      2009-01-04 13:57:46.000000000 +0100
 
186
+++ Doc/install/index.rst       2009-04-10 15:50:58.000000000 +0200
 
187
@@ -237,6 +237,8 @@
 
188
 +-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
 
189
 | Platform        | Standard installation location                      | Default value                                    | Notes |
 
190
 +=================+=====================================================+==================================================+=======+
 
191
+| Debian/Ubuntu   | :file:`{prefix}/lib/python{X.Y}/dist-packages`      | :file:`/usr/local/lib/python{X.Y}/dist-packages` | \(0)  |
 
192
++-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
 
193
 | Unix (pure)     | :file:`{prefix}/lib/python{X.Y}/site-packages`      | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1)  |
 
194
 +-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
 
195
 | Unix (non-pure) | :file:`{exec-prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1)  |
 
196
@@ -246,6 +248,14 @@
 
197
 
 
198
 Notes:
 
199
 
 
200
+(0)
 
201
+   Starting with Python-2.6 Debian/Ubuntu uses for the Python which comes within
 
202
+   the Linux distribution a non-default name for the installation directory. This
 
203
+   is to avoid overwriting of the python modules which come with the distribution,
 
204
+   which unfortunately is the upstream behaviour of the installation tools. The
 
205
+   non-default name in :file:`/usr/local` is used not to overwrite a local python
 
206
+   installation (defaulting to :file:`/usr/local`).
 
207
+
 
208
 (1)
 
209
    Most Linux distributions include Python as a standard part of the system, so
 
210
    :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` on
 
211
@@ -367,6 +377,15 @@
 
212
 
 
213
    /usr/bin/python setup.py install --prefix=/usr/local
 
214
 
 
215
+Starting with Python-2.6 Debian/Ubuntu does use
 
216
+:file:`/usr/lib/python{X.Y}/dist-packages` and
 
217
+:file:`/usr/local/lib/python{X.Y}/dist-packages` for the installation
 
218
+of python modules included in the Linux distribution.  To overwrite
 
219
+the name of the site directory, explicitely use the :option:`--prefix`
 
220
+option, however make sure that the installation path is included in
 
221
+``sys.path``.  For packaging of python modules for Debian/Ubuntu, use
 
222
+the new ``setup.py install`` option :option:`--install-layout=deb`.
 
223
+
 
224
 Another possibility is a network filesystem where the name used to write to a
 
225
 remote directory is different from the name used to read it: for example, the
 
226
 Python interpreter accessed as :file:`/usr/local/bin/python` might search for
 
227
@@ -605,6 +624,17 @@
 
228
 import them, this directory must be added to ``sys.path``.  There are several
 
229
 different ways to add the directory.
 
230
 
 
231
+On Debian/Ubuntu, starting with Python-2.6 the convention for system
 
232
+installed packages is to put then in the
 
233
+:file:`/usr/lib/python{X.Y}/dist-packages/` directory, and for locally
 
234
+installed packages is to put them in the
 
235
+:file:`/usr/lib/python{X.Y}/dist-packages/` directory.  To share the
 
236
+locally installed packages for the system provided Python with the
 
237
+locally installed packages of a local python installation, make
 
238
+:file:`/usr/lib/python{X.Y}/dist-packages/` a symbolic link to the
 
239
+:file:`{...}/site-packages/` directory of your local python
 
240
+installation.
 
241
+
 
242
 The most convenient way is to add a path configuration file to a directory
 
243
 that's already on Python's path, usually to the :file:`.../site-packages/`
 
244
 directory.  Path configuration files have an extension of :file:`.pth`, and each