diff options
author | Jonas Smedegaard <dr@jones.dk> | 2008-03-15 20:12:00 (GMT) |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2008-03-15 20:12:00 (GMT) |
commit | fc7f80d9413ce733ada6cb065e4540ea3a766a2d (patch) | |
tree | 5655c9d8ada563f642a08f50ac29ee2cdfc65a4e | |
parent | b2af679ff09468eb75132118472ac2770a15712e (diff) |
* Update CDBS tweaks:
+ Add local python-autotools.mk (and drop py-compile.mk).
+ Update python-vars.mk and makefile.mk for improved DEB_*PACKAGES
and build-dependency resolving.
+ Cosmetic updates to README.cdbs-tweaks.
-rw-r--r-- | debian/README.cdbs-tweaks | 16 | ||||
-rw-r--r-- | debian/cdbs/1/class/makefile.mk | 2 | ||||
-rw-r--r-- | debian/cdbs/1/class/python-autotools.mk (renamed from debian/cdbs/1/class/py-compile.mk) | 26 | ||||
-rw-r--r-- | debian/cdbs/1/class/python-vars.mk | 39 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rwxr-xr-x | debian/rules | 4 |
6 files changed, 64 insertions, 33 deletions
diff --git a/debian/README.cdbs-tweaks b/debian/README.cdbs-tweaks index 9f79ba3..5880b2f 100644 --- a/debian/README.cdbs-tweaks +++ b/debian/README.cdbs-tweaks @@ -39,7 +39,7 @@ Support multiple build flavors in makefile and autotools classes. Various improvements to python-distutils class ---------------------------------------------- -Use full path to python interpreter (Python Policy section 1.3.2). +Use full path to Python interpreter (Python Policy section 1.3.2). Add CDBS_BUILD_DEPENDS to old policy method. @@ -55,10 +55,18 @@ Quote install path. -New py-compile class --------------------- +New python-autotools class +-------------------------- + +Handle autotools-based Python packaging. + + + +New python-sugar class +---------------------- + +Handle packaging of Sugar activities. -Handle autotools-based python packaging. New copyright-check rule diff --git a/debian/cdbs/1/class/makefile.mk b/debian/cdbs/1/class/makefile.mk index e66b3fd..7f931ec 100644 --- a/debian/cdbs/1/class/makefile.mk +++ b/debian/cdbs/1/class/makefile.mk @@ -34,7 +34,7 @@ DEB_PHONY_RULES += makefile-clean # TODO: Move this to buildvars.mk cdbs_curpkgbuilddir = $(if $(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR_$(cdbs_curpkg)),$(DEB_BUILDDIR)) -cdbs_make_builddir_check = $(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),$(error Setting DEB_MAKE_FLAVORS requires DEB_BUILDDIR different from DEB_SRCDIR)) +cdbs_make_builddir_check = $(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),$(error DEB_MAKE_FLAVORS in use: DEB_BUILDDIR must be different from DEB_SRCDIR, and needs to be declared before including makefile.mk)) cdbs_make_build_targets = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-build/%,$(DEB_MAKE_FLAVORS)),debian/stamp-makefile-build) cdbs_make_install_targets = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-install/%,$(DEB_MAKE_FLAVORS)),debian/stamp-makefile-install) cdbs_make_check_targets = $(if $(DEB_MAKE_FLAVORS),$(cdbs_make_builddir_check)$(patsubst %,debian/stamp-makefile-check/%,$(DEB_MAKE_FLAVORS)),debian/stamp-makefile-check) diff --git a/debian/cdbs/1/class/py-compile.mk b/debian/cdbs/1/class/python-autotools.mk index 8e25912..5728470 100644 --- a/debian/cdbs/1/class/py-compile.mk +++ b/debian/cdbs/1/class/python-autotools.mk @@ -22,19 +22,35 @@ _cdbs_scripts_path ?= /usr/lib/cdbs _cdbs_rules_path ?= /usr/share/cdbs/1/rules _cdbs_class_path ?= /usr/share/cdbs/1/class -ifndef _cdbs_class_autotools_python -_cdbs_class_autotools_python = 1 +ifndef _cdbs_class_python_autotools +_cdbs_class_python_autotools = 1 #include $(_cdbs_class_path)/python-vars.mk$(_cdbs_makefile_suffix) include debian/cdbs/1/class/python-vars.mk # Flavors are used in implicit rules, so must be set before including makefile -DEB_BUILDDIR = build DEB_MAKE_FLAVORS = $(cdbs_python_curpkg_build_versions) #include $(_cdbs_class_path)/autotools.mk$(_cdbs_makefile_suffix) include debian/cdbs/1/class/autotools.mk +# Declare Build-Deps for packages using this file +# FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only +ifeq (,$(cdbs_python_pkg_check)$(DEB_PYTHON_ARCH_PACKAGES)) + ifneq (, $(cdbs_python_compile_version)) + CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python$(cdbs_python_compile_version)-dev, python (>= 2.3.5-11) + else + CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-dev (>= 2.3.5-11) + endif +else +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-all-dev (>= 2.3.5-11) +endif +ifeq (pysupport, $(DEB_PYTHON_SYSTEM)) +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-support (>= 0.6) +else +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-central (>= 0.6) +endif + DEB_CONFIGURE_SCRIPT_ENV += PYTHON="python$(cdbs_make_curflavor)" # This class can optionally use debhelper's commands. @@ -52,4 +68,8 @@ ifeq (, $(cdbs_selected_pycompat)) endif # use pycompat rm -rf python-build-stamp +## TODO: Drop this when DEB_PYTHON_PACKAGES is only resolved in build targets +pre-build clean:: + $(cdbs_python_pkgresolve_check) + endif diff --git a/debian/cdbs/1/class/python-vars.mk b/debian/cdbs/1/class/python-vars.mk index c749f23..3f78176 100644 --- a/debian/cdbs/1/class/python-vars.mk +++ b/debian/cdbs/1/class/python-vars.mk @@ -27,20 +27,26 @@ _cdbs_class_path ?= /usr/share/cdbs/1/class ifndef _cdbs_class_python_vars _cdbs_class_python_vars = 1 +include $(_cdbs_rules_path)/buildvars.mk$(_cdbs_makefile_suffix) + DEB_PYTHON_PACKAGES = $(filter-out %-doc %-dev %-common, $(DEB_PACKAGES)) -## FIXME: Support multiple binary python packages per source package -## TODO: Check and bail out if pultiple packages are declared/resolved DEB_PYTHON_ARCH_PACKAGES = $(filter $(DEB_PYTHON_PACKAGES), $(DEB_ARCH_PACKAGES)) DEB_PYTHON_INDEP_PACKAGES = $(filter $(DEB_PYTHON_PACKAGES), $(DEB_INDEP_PACKAGES)) +## FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only +# Avoid including buildcore.mk to not risk breaking when hopefully removing again +cdbs_python_streq = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),,yes) +cdbs_python_packages_pre := $(DEB_PYTHON_ARCH_PACKAGES)$(DEB_PYTHON_INDEP_PACKAGES) +cdbs_python_pkgresolve_check = $(if $(call cdbs_python_streq,$(DEB_PYTHON_ARCH_PACKAGES)$(DEB_PYTHON_INDEP_PACKAGES),$(cdbs_python_packages_pre)),, $(warning Setting DEB_PYTHON_*PACKAGES after python-vars in included is currently unsupported)) +## TODO: Rephrase when DEB_PYTHON_PACKAGES is only resolved in build targets +cdbs_python_pkg_check = $(if $(DEB_PYTHON_ARCH_PACKAGES)$(DEB_PYTHON_INDEP_PACKAGES),, $(warning No Python packages found or declared - either rename binary packages or set DEB_PYTHON_PACKAGES (or one or both of DEB_PYTHON_ARCH_PACKAGES and DEB_PYTHON_INDEP_PACKAGES) before including python-vars.mk)) + # check python system cdbs_use_xs_field := $(shell grep -q "^XS-Python-Version:" debian/control && echo yes) cdbs_selected_pycompat := $(shell if [ -e debian/pycompat ]; then cat debian/pycompat; fi) cdbs_pycompat = $(cdbs_selected_pycompat) ifeq (pysupport, $(DEB_PYTHON_SYSTEM)) -## FIXME: Support multiple binary python packages per source package - cdbs_python_support_path = usr/share/python-support/$(DEB_PYTHON_PACKAGES) ifeq (, $(cdbs_selected_pycompat)) cdbs_pycompat = 2 endif # use pycompat @@ -70,9 +76,9 @@ else endif # pysupport # Calculate cdbs_python_build_versions -## FIXME: Support multiple binary python packages per source package cdbs_python_current_version := $(shell pyversions -vd) -ifeq (,$(DEB_PYTHON_ARCH_PACKAGES)) +## FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only +ifeq (,$(cdbs_python_pkg_check)$(DEB_PYTHON_ARCH_PACKAGES)) # check if current is in build versions ifneq ($(cdbs_python_current_version), $(filter $(cdbs_python_current_version), $(shell pyversions -vr))) cdbs_python_compile_version := $(firstword $(strip $(sort $(shell pyversions -vr)))) @@ -93,25 +99,12 @@ $(error invalid setting for XS-Python-Version) endif # system selected endif # build versions empty - -# Declare Build-Deps for packages using this file -ifeq (,$(DEB_PYTHON_ARCH_PACKAGES)) - ifneq (, $(cdbs_python_compile_version)) - CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python$(cdbs_python_compile_version)-dev, python (>= 2.3.5-11) - else - CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-dev (>= 2.3.5-11) - endif -else -CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-all-dev (>= 2.3.5-11) -endif -ifeq (pysupport, $(DEB_PYTHON_SYSTEM)) -CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-support (>= 0.6) -else -CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-central (>= 0.6) -endif - # TODO: Support multiple python programs built for different python versions # FIXME: Understand the above sentence and rephrase it cdbs_python_curpkg_build_versions = $(cdbs_python_build_versions) +## TODO: Drop this when DEB_PYTHON_PACKAGES is only resolved in build targets +pre-build clean:: + $(cdbs_python_pkgresolve_check) + endif diff --git a/debian/changelog b/debian/changelog index 6cf0b8f..fa1dfa1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +sugar-datastore (0.8.0~git.13d354b-6) UNRELEASED; urgency=low + + * Update CDBS tweaks: + + Add local python-autotools.mk (and drop py-compile.mk). + + Update python-vars.mk and makefile.mk for improved DEB_*PACKAGES + and build-dependency resolving. + + Cosmetic updates to README.cdbs-tweaks. + + -- Jonas Smedegaard <dr@jones.dk> Sat, 15 Mar 2008 21:11:22 +0100 + sugar-datastore (0.8.0~git.13d354b-5) unstable; urgency=low * Pass over maintenance of the package to the OLPC team: Change diff --git a/debian/rules b/debian/rules index d901fb4..d8835da 100755 --- a/debian/rules +++ b/debian/rules @@ -10,9 +10,9 @@ DEB_AUTO_UPDATE_LIBTOOL = pre DEB_PYTHON_SYSTEM = pycentral include /usr/share/cdbs/1/rules/patchsys-quilt.mk -include debian/cdbs/1/class/py-compile.mk -include /usr/share/cdbs/1/rules/debhelper.mk include debian/cdbs/1/rules/copyright-check.mk +include debian/cdbs/1/class/python-autotools.mk +include /usr/share/cdbs/1/rules/debhelper.mk include debian/cdbs/1/rules/buildinfo.mk pkg = python-sugar-datastore |