Your message dated Sun, 27 Jun 2010 11:23:46 +0200
with message-id <[email protected]>
and subject line Re: [Build-common-hackers] Bug#587240:  Bug#587240: example
has caused the Debian Bug report #587240,
regarding python installs to site-packages but with 2.6 they are not in sys.path
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
587240: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=587240
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cdbs
Version: 0.4.87
Severity: important

Hello,

I am browsing documentation and source and it seems like 
/usr/share/cdbs/1/class/python-distutils.mk
is somewhat stuck with python 2.5 where the site-packages
are part of the system path. With 2.6 this is no longer the
case but I want my python packages to be visible for all
without the need to 
export PYTHONPATH=/usr/lib/python2.6/site-packages

Here the proof:
$ python2.6
Python 2.6.5+ (release26-maint, Jun 16 2010, 09:20:52) 
[GCC 4.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; print sys.path
['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', 
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', 
'/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', 
'/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/pymodules/python2.6', 
'/usr/lib/pymodules/python2.6/gtk-2.0', 
'/usr/local/lib/python2.6/dist-packages']

If I am not erroneous, then the package should instead go to 
/usr/lib/python2.6/dist-packages by default. The following patch to 
/usr/share/cdbs/1/class/python-distutils.mk has fixed this for me:

--- python-distutils.mk.orig    2010-06-26 14:52:18.000000000 +0200
+++ python-distutils.mk 2010-06-26 16:34:41.000000000 +0200
@@ -74,14 +74,20 @@
 
 # install stage
 $(patsubst %,install/%,$(cdbs_python_indep_packages)) :: install/%: 
python-install-py
+       subdir=dist-packages ; \
+       if [ "2.5" == "$(cdbs_python_primary_versionsub)" -o "2.4" == 
"$(cdbs_python_primary_versionsub)" ]; then \
+               subdir=site-packages ; \
+       fi ; \
        cd $(DEB_SRCDIR) && python$(cdbs_python_nondefault_version) 
$(DEB_PYTHON_SETUP_CMD) install --root=$(cdbs_python_destdir) \
-               
--install-purelib=/usr/lib/python$(cdbs_python_primary_version)/site-packages/ 
$(DEB_PYTHON_INSTALL_ARGS_ALL)
+               
--install-purelib=/usr/lib/python$(cdbs_python_primary_version)/$$subdir/ 
$(DEB_PYTHON_INSTALL_ARGS_ALL)
 
 $(patsubst %,install/%,$(cdbs_python_arch_packages)) :: install/%: $(addprefix 
python-install-, $(cdbs_python_build_versions))
        set -e; for buildver in $(cdbs_python_build_versions); do \
+               subdir=dist-packages ; \
+               if [ "2.5" == "$$buildver" -o "2.4" == "$$buildver" ]; then 
subdir=site-packages ; fi ; \
                cd $(CURDIR) && cd $(DEB_SRCDIR) && $(call 
cdbs_python_binary,python$$buildver) $(DEB_PYTHON_SETUP_CMD) install \
-               --root=$(cdbs_python_destdir) 
--install-purelib=/usr/lib/python$$buildver/site-packages/ \
-               --install-platlib=/usr/lib/python$$buildver/site-packages/ 
$(DEB_PYTHON_INSTALL_ARGS_ALL); \
+               --root=$(cdbs_python_destdir) 
--install-purelib=/usr/lib/python$$buildver/$$subdir/ \
+               --install-platlib=/usr/lib/python$$buildver/$$subdir/ 
$(DEB_PYTHON_INSTALL_ARGS_ALL); \
        done
 
 # Deprecated targets.  You should use above targets instead.


Many thanks

Steffen

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cdbs depends on:
ii  debhelper                     7.9.1      helper programs for debian/rules

Versions of packages cdbs recommends:
ii  autotools-dev                 20100122.1 Update infrastructure for config.{

Versions of packages cdbs suggests:
ii  devscripts                    2.10.64    scripts to make the life of a Debi
ii  doc-base                      0.9.5      utilities to manage online documen

-- no debconf information



--- End Message ---
--- Begin Message ---
On Sun, Jun 27, 2010 at 10:55:53AM +0200, Jonas Smedegaard wrote:
On Sun, Jun 27, 2010 at 02:13:38AM +0200, Steffen Möller wrote:
I run into this issue for everything that I package with python-central. The python-support-run packages don't seem to be affected. When you look up to the patch a bit, you see that in only changes site-packages to dist-packages for the installation, and only if the version of python is 2.6 or higher. The Debian Python Policy almost verbatim states this on http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html section 1.5 "Module Path".

I know about Policy. I just believed that it was already magically taken care of, but now, double-checking with the Python packages I am involved in myself, I see that they either are arch-independent or use Autotools (not distutils).

I did wonder in the past how that explicit path in distutils.mk was so magically handled correctly also with Python 2.6 and apparently it really isn't after all. Your patch looks good and I'll apply it. Thanks a lot!

Ha haaa - no, my former feeling was correct after all, and the problem is another: python-nast emits the following crucial warning sduring build:

pycentral: pycentral debhelper: missing XB-Python-Version attribute in package 
python-nast

Add XB-Python-Version and XS-Python-Version to control file and it works.


Oh, and it seems pynast is not arch-dependent after all. If so, you should probably change to "Arch: all" in control file.


Piotr Ożarowski is the genius who dealt with the magical site-packages vs. dist-packages issue for distutils.mk - a summary of what it does is here: http://bugs.debian.org/565973#17


I will now close this as a non-bug.  Please yell if you disagree.

Thanks anyway for the many details. :-)


Kind regards,

 - Jonas

--
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: Digital signature


--- End Message ---

Reply via email to