29 | 29 |
include $(_cdbs_rules_path)/debhelper.mk$(_cdbs_makefile_suffix)
|
30 | 30 |
|
31 | 31 |
# Declare Build-Deps for packages using this file
|
32 | |
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-sugar, python-sugar-toolkit (>= 0.79.6-2), unzip
|
|
32 |
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-sugar, python-sugar-toolkit (>= 0.79.6-2~), unzip
|
33 | 33 |
# FIXME: Resolve DEB_PYTHON_PACKAGES in build targets only
|
34 | 34 |
ifeq (,$(cdbs_python_pkg_check)$(DEB_PYTHON_ARCH_PACKAGES))
|
35 | 35 |
ifneq (, $(cdbs_python_compile_version))
|
|
46 | 46 |
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), python-central (>= 0.5.6)
|
47 | 47 |
endif
|
48 | 48 |
|
|
49 |
DEB_PYTHON_SUGAR_PACKAGES = $(filter sugar-%-activity, $(DEB_PACKAGES))
|
|
50 |
|
49 | 51 |
# Files or `find -name`-compatible search patterns to add to temp MANIFEST
|
50 | 52 |
#DEB_PYTHON_SUGAR_MANIFEST = *.py *.po *.pot *.svg
|
51 | 53 |
|
52 | 54 |
DEB_PYTHON_SUGAR_MANIFEST_REGEX =
|
53 | 55 |
DEB_PYTHON_SUGAR_MANIFEST_IGNORE_REGEX = ^debian/.*
|
54 | 56 |
|
|
57 |
# TODO: Move this to buildvars.mk
|
|
58 |
cdbs_pkgsrcdir = $(if $(DEB_PKGSRCDIR_$(cdbs_curpkg)),$(DEB_PKGSRCDIR_$(cdbs_curpkg)),$(DEB_SRCDIR))
|
|
59 |
|
55 | 60 |
cdbs_python_sugar_manifest_files_tmp = $(patsubst %,-or -name '%',$(DEB_PYTHON_SUGAR_MANIFEST))
|
56 | 61 |
cdbs_python_sugar_manifest_files = $(wordlist 2, $(words $(cdbs_python_sugar_manifest_files_tmp)), $(cdbs_python_sugar_manifest_files_tmp))
|
57 | |
cdbs_python_sugar_manifest_files = $(if $(DEB_PYTHON_SUGAR_MANIFEST),$(DEB_SRCDIR)/MANIFEST)
|
58 | 62 |
|
59 | |
# Preserve upstream MANIFEST files if overridden
|
|
63 |
cdbs_python_sugar_automanifest = $(if $(DEB_PYTHON_SUGAR_MANIFEST_$(cdbs_curpkg)),$(DEB_PYTHON_SUGAR_MANIFEST_$(cdbs_curpkg)),$(DEB_PYTHON_SUGAR_MANIFEST))
|
|
64 |
|
60 | 65 |
pre-build::
|
61 | |
for i in $(cdbs_python_sugar_manifest_files); do \
|
62 | |
if [ -e "$$i" ] && [ ! -e "$$i.cdbs-orig" ]; then \
|
63 | |
mv "$$i" "$$i.cdbs-orig"; \
|
64 | |
fi; \
|
|
66 |
mkdir -p debian/stamps-configure
|
|
67 |
|
|
68 |
# FIXME: make these targets *not* run twice but respect stamps!
|
|
69 |
$(patsubst %,configure/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: configure/%: debian/stamps-configure/%
|
|
70 |
$(patsubst %,debian/stamps-configure/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: debian/stamps-configure/%:
|
|
71 |
$(if $(cdbs_python_sugar_automanifest),i="$(cdbs_pkgsrcdir)/MANIFEST"; if [ -e "$$i" ] && [ ! -e "$$i.cdbs-orig" ]; then mv "$$i" "$$i.cdbs-orig"; fi)
|
|
72 |
$(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")
|
|
73 |
touch $@
|
|
74 |
|
|
75 |
$(patsubst %,build/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: build/%:
|
|
76 |
for pythonver in $(cdbs_python_build_versions); do \
|
|
77 |
/usr/bin/python$$ver $(cdbs_pkgsrcdir)/setup.py dist; \
|
65 | 78 |
done
|
66 | 79 |
|
67 | |
# Generate MANIFEST files
|
68 | |
common-configure-arch common-configure-indep:: $(cdbs_python_sugar_manifest_files)
|
69 | |
$(cdbs_python_sugar_manifest_files):
|
70 | |
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))' > "$@"
|
71 | |
|
72 | |
$(patsubst %,build/%,$(DEB_PACKAGES)) :: build/%:
|
|
80 |
$(patsubst %,install/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: install/%:
|
|
81 |
mkdir -p $(DEB_DESTDIR)usr/share/activities
|
73 | 82 |
for pythonver in $(cdbs_python_build_versions); do \
|
74 | |
/usr/bin/python$$ver setup.py dist; \
|
|
83 |
/usr/bin/python$$ver $(cdbs_pkgsrcdir)/setup.py install $(DEB_DESTDIR)usr/share/activities; \
|
75 | 84 |
done
|
76 | 85 |
|
77 | |
$(patsubst %,install/%,$(DEB_PACKAGES)) :: install/%:
|
78 | |
mkdir -p $(DEB_DESTDIR)usr/share/activities
|
79 | |
for pythonver in $(cdbs_python_build_versions); do \
|
80 | |
/usr/bin/python$$ver setup.py install $(DEB_DESTDIR)usr/share/activities; \
|
81 | |
done
|
82 | |
|
83 | |
$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
|
|
86 |
$(patsubst %,binary-install/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: binary-install/%:
|
84 | 87 |
ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
|
85 | 88 |
dh_pysupport -p$(cdbs_curpkg) $(DEB_PYTHON_PRIVATE_MODULES_DIRS) $(DEB_PYTHON_PRIVATE_MODULES_DIRS_$(cdbs_curpkg))
|
86 | 89 |
else
|
87 | 90 |
dh_pycentral -p$(cdbs_curpkg)
|
88 | 91 |
endif
|
89 | 92 |
|
90 | |
clean::
|
|
93 |
clean:: $(patsubst %,cleanpythonsugar/%,$(DEB_PYTHON_SUGAR_PACKAGES))
|
|
94 |
ifeq (, $(cdbs_selected_pycompat))
|
|
95 |
echo "$(cdbs_pycompat)" >debian/pycompat
|
|
96 |
endif # use pycompat
|
|
97 |
rm -rf debian/stamps-configure
|
|
98 |
|
|
99 |
$(patsubst %,cleanpythonsugar/%,$(DEB_PYTHON_SUGAR_PACKAGES)) :: cleanpythonsugar/% :
|
91 | 100 |
for pythonver in $(cdbs_python_build_versions); do \
|
92 | |
/usr/bin/python$$ver setup.py clean; \
|
|
101 |
/usr/bin/python$$ver $(cdbs_pkgsrcdir)/setup.py clean; \
|
93 | 102 |
done
|
94 | |
find "$(DEB_SRCDIR)" -maxdepth 1 -type f -name '*.xo' -exec rm -f '{}' ';'
|
95 | |
-IFS="`printf '\n'`" find "$(DEB_SRCDIR)/locale" -type f \( -name '*.mo' -or -name 'activity.linfo' \) | while read path; do \
|
|
103 |
find "$(cdbs_pkgsrcdir)" -maxdepth 1 -type f -name '*.xo' -exec rm -f '{}' ';'
|
|
104 |
-IFS="`printf '\n'`" find "$(cdbs_pkgsrcdir)/locale" -type f \( -name '*.mo' -or -name 'activity.linfo' \) | while read path; do \
|
96 | 105 |
rm -f "$$path"; \
|
97 | 106 |
rmdir --ignore-fail-on-non-empty "`dirname "$$path"`"; \
|
98 | 107 |
done
|
99 | |
-rmdir --ignore-fail-on-non-empty "$(DEB_SRCDIR)/locale"
|
100 | |
for i in $(cdbs_python_sugar_manifest_files); do \
|
101 | |
if test -e "$$i.cdbs-orig"; then \
|
102 | |
mv -f "$$i.cdbs-orig" "$$i"; \
|
103 | |
fi; \
|
104 | |
done
|
105 | |
ifeq (, $(cdbs_selected_pycompat))
|
106 | |
echo "$(cdbs_pycompat)" >debian/pycompat
|
107 | |
endif # use pycompat
|
|
108 |
-rmdir --ignore-fail-on-non-empty "$(cdbs_pkgsrcdir)/locale"
|
|
109 |
$(if $(cdbs_python_sugar_automanifest),i="$(cdbs_pkgsrcdir)/MANIFEST"; if test -e "$$i.cdbs-orig"; then mv -f "$$i.cdbs-orig" "$$i"; fi)
|
108 | 110 |
|
109 | 111 |
## TODO: Drop this when DEB_PYTHON_PACKAGES is only resolved in build targets
|
110 | 112 |
pre-build clean::
|