diff options
author | Jonas Smedegaard <dr@jones.dk> | 2008-04-26 07:48:03 (GMT) |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2008-04-26 07:48:03 (GMT) |
commit | e0f019ce77a5bcf4f3c692e90c5f2df27624a88a (patch) | |
tree | 062e056d08ee3d04e9e68c9ae8afa6f60ca6e8e8 /debian/cdbs/1/class/python-sugar.mk | |
parent | 2ae4405acde4a217ff3691d98fc5b24e0f696e7b (diff) |
Support multiple activity packages from one source.
+ Fix preserve upstream MANIFEST files only once in python-sugar.mk.
+ Support multiple activity packages from one source in
+ Clean *.xo and locale in python-sugar.mk (based on initial work by
Santiago Ruano Rincón).
Diffstat (limited to 'debian/cdbs/1/class/python-sugar.mk')
-rw-r--r-- | debian/cdbs/1/class/python-sugar.mk | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/debian/cdbs/1/class/python-sugar.mk b/debian/cdbs/1/class/python-sugar.mk index 616ef2d..889ca4d 100644 --- a/debian/cdbs/1/class/python-sugar.mk +++ b/debian/cdbs/1/class/python-sugar.mk @@ -30,7 +30,7 @@ include debian/cdbs/1/class/python-vars.mk include $(_cdbs_rules_path)/debhelper.mk$(_cdbs_makefile_suffix) # Declare Build-Deps for packages using this file -CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-sugar, python-sugar-toolkit (>= 0.79.6-2), unzip +CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-sugar, python-sugar-toolkit (>= 0.79.6-2~), unzip # FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only ifeq (,$(cdbs_python_pkg_check)$(DEB_PYTHON_ARCH_PACKAGES)) ifneq (, $(cdbs_python_compile_version)) @@ -47,65 +47,67 @@ else CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-central (>= 0.5.6) endif +DEB_PYTHON_SUGAR_PACKAGES = $(filter sugar-%-activity, $(DEB_PACKAGES)) + # Files or `find -name`-compatible search patterns to add to temp MANIFEST #DEB_PYTHON_SUGAR_MANIFEST = *.py *.po *.pot *.svg DEB_PYTHON_SUGAR_MANIFEST_REGEX = DEB_PYTHON_SUGAR_MANIFEST_IGNORE_REGEX = ^debian/.* +# TODO: Move this to buildvars.mk +cdbs_pkgsrcdir = $(if $(DEB_PKGSRCDIR_$(cdbs_curpkg)),$(DEB_PKGSRCDIR_$(cdbs_curpkg)),$(DEB_SRCDIR)) + cdbs_python_sugar_manifest_files_tmp = $(patsubst %,-or -name '%',$(DEB_PYTHON_SUGAR_MANIFEST)) cdbs_python_sugar_manifest_files = $(wordlist 2, $(words $(cdbs_python_sugar_manifest_files_tmp)), $(cdbs_python_sugar_manifest_files_tmp)) -cdbs_python_sugar_manifest_files = $(if $(DEB_PYTHON_SUGAR_MANIFEST),$(DEB_SRCDIR)/MANIFEST) -# Preserve upstream MANIFEST files if overridden +cdbs_python_sugar_automanifest = $(if $(DEB_PYTHON_SUGAR_MANIFEST_$(cdbs_curpkg)),$(DEB_PYTHON_SUGAR_MANIFEST_$(cdbs_curpkg)),$(DEB_PYTHON_SUGAR_MANIFEST)) + pre-build:: - for i in $(cdbs_python_sugar_manifest_files); do \ - if [ -e "$$i" ] && [ ! -e "$$i.cdbs-orig" ]; then \ - mv "$$i" "$$i.cdbs-orig"; \ - fi; \ - done + mkdir -p debian/stamps-configure -# Generate MANIFEST files -common-configure-arch common-configure-indep:: $(cdbs_python_sugar_manifest_files) -$(cdbs_python_sugar_manifest_files): - cd "$(dirname $@)" && find * -type f $(if $(cdbs_python_sugar_manifest_files)$(DEB_PYTHON_SUGAR_MANIFEST_REGEX),'(' $(cdbs_python_sugar_manifest_files) $(if $(DEB_PYTHON_SUGAR_MANIFEST_REGEX),$(if $(cdbs_python_sugar_manifest_files),-or )-regex '$(DEB_PYTHON_SUGAR_MANIFEST_REGEX)') ')') $(if $(DEB_PYTHON_SUGAR_MANIFEST_IGNORE_REGEX),-not -regex '$(DEB_PYTHON_SUGAR_MANIFEST_IGNORE_REGEX))' > "$@" +# FIXME: make these targets *not* run twice but respect stamps! +$(patsubst %,configure/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: configure/%: debian/stamps-configure/% +$(patsubst %,debian/stamps-configure/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: debian/stamps-configure/%: + $(if $(cdbs_python_sugar_automanifest),i="$(cdbs_pkgsrcdir)/MANIFEST"; if [ -e "$$i" ] && [ ! -e "$$i.cdbs-orig" ]; then mv "$$i" "$$i.cdbs-orig"; fi) + $(if $(cdbs_python_sugar_automanifest),cd "$(cdbs_pkgsrcdir)" && find * -type f $(if $(cdbs_python_sugar_manifest_files)$(DEB_PYTHON_SUGAR_MANIFEST_REGEX),'(' $(cdbs_python_sugar_manifest_files) $(if $(DEB_PYTHON_SUGAR_MANIFEST_REGEX),$(if $(cdbs_python_sugar_manifest_files),-or )-regex '$(DEB_PYTHON_SUGAR_MANIFEST_REGEX)') ')') $(if $(DEB_PYTHON_SUGAR_MANIFEST_IGNORE_REGEX),-not -regex '$(DEB_PYTHON_SUGAR_MANIFEST_IGNORE_REGEX))' > "$(cdbs_pkgsrcdir)/MANIFEST") + touch $@ -$(patsubst %,build/%,$(DEB_PACKAGES)) :: build/%: +$(patsubst %,build/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: build/%: for pythonver in $(cdbs_python_build_versions); do \ - /usr/bin/python$$ver setup.py dist; \ + /usr/bin/python$$ver $(cdbs_pkgsrcdir)/setup.py dist; \ done -$(patsubst %,install/%,$(DEB_PACKAGES)) :: install/%: +$(patsubst %,install/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: install/%: mkdir -p $(DEB_DESTDIR)usr/share/activities for pythonver in $(cdbs_python_build_versions); do \ - /usr/bin/python$$ver setup.py install $(DEB_DESTDIR)usr/share/activities; \ + /usr/bin/python$$ver $(cdbs_pkgsrcdir)/setup.py install $(DEB_DESTDIR)usr/share/activities; \ done -$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%: +$(patsubst %,binary-install/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: binary-install/%: ifeq (pysupport, $(DEB_PYTHON_SYSTEM)) dh_pysupport -p$(cdbs_curpkg) $(DEB_PYTHON_PRIVATE_MODULES_DIRS) $(DEB_PYTHON_PRIVATE_MODULES_DIRS_$(cdbs_curpkg)) else dh_pycentral -p$(cdbs_curpkg) endif -clean:: +clean:: $(patsubst %,cleanpythonsugar/%,$(DEB_PYTHON_SUGAR_PACKAGES)) +ifeq (, $(cdbs_selected_pycompat)) + echo "$(cdbs_pycompat)" >debian/pycompat +endif # use pycompat + rm -rf debian/stamps-configure + +$(patsubst %,cleanpythonsugar/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: cleanpythonsugar/% : for pythonver in $(cdbs_python_build_versions); do \ - /usr/bin/python$$ver setup.py clean; \ + /usr/bin/python$$ver $(cdbs_pkgsrcdir)/setup.py clean; \ done - find "$(DEB_SRCDIR)" -maxdepth 1 -type f -name '*.xo' -exec rm -f '{}' ';' - -IFS="`printf '\n'`" find "$(DEB_SRCDIR)/locale" -type f \( -name '*.mo' -or -name 'activity.linfo' \) | while read path; do \ + find "$(cdbs_pkgsrcdir)" -maxdepth 1 -type f -name '*.xo' -exec rm -f '{}' ';' + -IFS="`printf '\n'`" find "$(cdbs_pkgsrcdir)/locale" -type f \( -name '*.mo' -or -name 'activity.linfo' \) | while read path; do \ rm -f "$$path"; \ rmdir --ignore-fail-on-non-empty "`dirname "$$path"`"; \ done - -rmdir --ignore-fail-on-non-empty "$(DEB_SRCDIR)/locale" - for i in $(cdbs_python_sugar_manifest_files); do \ - if test -e "$$i.cdbs-orig"; then \ - mv -f "$$i.cdbs-orig" "$$i"; \ - fi; \ - done -ifeq (, $(cdbs_selected_pycompat)) - echo "$(cdbs_pycompat)" >debian/pycompat -endif # use pycompat + -rmdir --ignore-fail-on-non-empty "$(cdbs_pkgsrcdir)/locale" + $(if $(cdbs_python_sugar_automanifest),i="$(cdbs_pkgsrcdir)/MANIFEST"; if test -e "$$i.cdbs-orig"; then mv -f "$$i.cdbs-orig" "$$i"; fi) ## TODO: Drop this when DEB_PYTHON_PACKAGES is only resolved in build targets pre-build clean:: |