Matthias Klose wrote:
> the interpreter is used by installation scripts to set the
> interpreter name in scripts, leading to hash lines
> /usr/bin/python2.3, which dh_python then turns into a python2.3
> dependency. Please call the unversioned interpreter for the default
> python version.
I have implemented a fix for this -- see attached patch -- but it breaks
the python-numpy build, which you nominated as example, so I'm unsure
what to do.
On further consideration, I think packages that rely on this behavior
either way are in error. The policy says that if programs can run with
any version, they must use /usr/bin/python as interpreter, so this must
be a fixed value, no matter how the build script is called or whether
the version being used for building is the default one at build time.
If, on the other hand, a program really needs a specific version
because of the way it is written, that version should be hard-wired
into the program, no matter what version you use to run the build
script.
Index: debian/changelog
===================================================================
--- debian/changelog (Revision 44)
+++ debian/changelog (Arbeitskopie)
@@ -9,8 +9,10 @@
(python-distutils.mk) (closes: #377965)
* Make use of per-patch stamp files and don't ignore failed patch
reversals (simple-patchsys.mk) (closes: #372682)
+ * Use unversioned interpreter for default Python version
+ (python-distutils.mk) (closes: #377964)
- -- Peter Eisentraut <[EMAIL PROTECTED]> Mon, 24 Jul 2006 22:45:11 +0200
+ -- Peter Eisentraut <[EMAIL PROTECTED]> Mon, 24 Jul 2006 23:55:18 +0200
cdbs (0.4.44) unstable; urgency=medium
Index: 1/class/python-distutils.mk.in
===================================================================
--- 1/class/python-distutils.mk.in (Revision 43)
+++ 1/class/python-distutils.mk.in (Arbeitskopie)
@@ -125,10 +125,10 @@
ifeq (,$(DEB_PYTHON_REAL_LIB_PACKAGES))
common-install-arch common-install-indep:: common-install-impl
common-install-impl::
- cd $(DEB_SRCDIR) && /usr/bin/python$(DEB_PYTHON_COMPILE_VERSION) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
+ cd $(DEB_SRCDIR) && python$(DEB_PYTHON_COMPILE_VERSION) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
else
$(patsubst %,install/%,$(DEB_PYTHON_REAL_LIB_PACKAGES)) :: install/% :
- cd $(DEB_SRCDIR) && /usr/bin/python$(cdbs_python_ver) $(DEB_PYTHON_SETUP_CMD) install --root=$(CURDIR)/debian/$(cdbs_curpkg) $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
+ cd $(DEB_SRCDIR) && python$(cdbs_python_ver) $(DEB_PYTHON_SETUP_CMD) install --root=$(CURDIR)/debian/$(cdbs_curpkg) $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
endif
$(patsubst %,install/%,$(DEB_PYTHON_SIMPLE_PACKAGES)) :: install/% :
@@ -203,13 +203,16 @@
endif
+cdbs_python_current_binary := $(shell pyversions -d)
+cdbs_python_binary = $(if $(call cdbs_streq,$(cdbs_python_current_binary),$(1)),python,$(1))
+
# build stage
common-build-arch common-build-indep:: $(addprefix python-build-stamp-, $(cdbs_python_build_versions))
python-build-stamp-%:
ifeq (all, $(cdbs_python_module_arch))
- cd $(DEB_SRCDIR) && python$(cdbs_python_compile_version) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
+ cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
else
- cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
+ cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
endif # archall detection
touch $@
@@ -218,11 +221,11 @@
ifeq (all, $(cdbs_python_module_arch))
common-install-arch common-install-indep:: python-install-py
python-install-py:
- cd $(DEB_SRCDIR) && python$(cdbs_python_compile_version) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
+ cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
else
common-install-arch common-install-indep:: $(addprefix python-install-, $(cdbs_python_build_versions))
python-install-%:
- cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
+ cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
endif # archall detection
@@ -246,9 +249,9 @@
clean:: $(addprefix python-clean-, $(cdbs_python_build_versions))
python-clean-%:
ifeq (all, $(cdbs_python_module_arch))
- -cd $(DEB_SRCDIR) && python$(cdbs_python_compile_version) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
+ -cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
else
- -cd $(DEB_SRCDIR) && python$* $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
+ -cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
endif # archall detection
clean::