[Build-common-hackers] Bug#504346: cdbs: make it possible to have setup.py in a far down subdir and still do "autotools" in other dirs

Sune Vuorela reportbug at pusling.com
Sun Nov 2 23:04:08 UTC 2008


Package: cdbs
Version: 0.4.52
Severity: normal
Tags: patch


I have a source package which is a c++ package using autotools and some
python stuff in some foo/bar/baz subdir.

I couldn't trick cdbs into supporting that, as it is DEB_SRCDIR is used
in both.

I tried whip up the following, and it solved it for me. I *think* it is
compatible, but a bit unsure:

It is basically as mentioned in the first hunk, my comment, what is
done.

--- /usr/share/cdbs/1/class/python-distutils.mk 2008-04-01 11:51:40.000000000 +0200
+++ debian/cdbs/python-distutils.mk     2008-11-02 23:55:44.000000000 +0100
@@ -33,6 +33,10 @@

 # Once all old-style packages are removed before etch, some of the old
 # can be refactored or removed.
+#
+# DIFF to real cdbs version
+# s/DEB_SRCDIR/DEB_PYTHON_SRCDIR/
+# and added DEB_PYTHON_SRCDIR ?= $(DEB_SRCDIR)


 _cdbs_scripts_path ?= /usr/lib/cdbs
@@ -45,6 +49,7 @@ _cdbs_class_python_distutils = 1
 include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
 include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)

+DEB_PYTHON_SRCDIR ?= $(DEB_SRCDIR)

 # check python system
 cdbs_use_xs_field := $(shell grep -q "^XS-Python-Version:" debian/control && echo yes)
@@ -119,7 +124,7 @@ cdbs_python_ver = $(filter-out -%,$(subs

 common-build-arch common-build-indep:: common-build-impl
 common-build-impl::
-       cd $(DEB_SRCDIR) && python$(DEB_PYTHON_COMPILE_VERSION) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
+       cd $(DEB_PYTHON_SRCDIR) && python$(DEB_PYTHON_COMPILE_VERSION) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)


 # See if this package doesn't appear to need to be compiled by multiple
@@ -127,14 +132,14 @@ common-build-impl::
 ifeq (,$(DEB_PYTHON_REAL_LIB_PACKAGES))
 common-install-arch common-install-indep:: common-install-impl
 common-install-impl::
-       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))
+       cd $(DEB_PYTHON_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) && 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_PYTHON_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/% :
-       cd $(DEB_SRCDIR) && python $(DEB_PYTHON_SETUP_CMD) install --root=$(CURDIR)/debian/$(cdbs_curpkg) $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))
+       cd $(DEB_PYTHON_SRCDIR) && python $(DEB_PYTHON_SETUP_CMD) install --root=$(CURDIR)/debian/$(cdbs_curpkg) $(DEB_PYTHON_INSTALL_ARGS_ALL) $(DEB_PYTHON_INSTALL_ARGS_$(cdbs_curpkg))

 # This class can optionally utilize debhelper's "dh_python" command.  Just
 # be sure you include debhelper.mk before including this file.
@@ -212,9 +217,9 @@ cdbs_python_binary = $(if $(call cdbs_st
 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) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
+       cd $(DEB_PYTHON_SRCDIR) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
 else
-       cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
+       cd $(DEB_PYTHON_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
 endif # archall detection
        touch $@

@@ -223,11 +228,11 @@ endif # archall detection
 ifeq (all, $(cdbs_python_module_arch))
 common-install-arch common-install-indep:: python-install-py
 python-install-py:
-       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)
+       cd $(DEB_PYTHON_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) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
+       cd $(DEB_PYTHON_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
 endif # archall detection


@@ -251,9 +256,9 @@ endif
 clean:: $(addprefix python-clean-, $(cdbs_python_build_versions))
 python-clean-%:
 ifeq (all, $(cdbs_python_module_arch))
-       -cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
+       -cd $(DEB_PYTHON_SRCDIR) && $(call cdbs_python_binary,python$(cdbs_python_compile_version)) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
 else
-       -cd $(DEB_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
+       -cd $(DEB_PYTHON_SRCDIR) && $(call cdbs_python_binary,python$*) $(DEB_PYTHON_SETUP_CMD) clean $(DEB_PYTHON_CLEAN_ARGS)
 endif # archall detection

 clean::


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (200, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

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

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

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

-- no debconf information





More information about the Build-common-hackers mailing list