#!/usr/bin/make -f

#DEB_PYTHON_VERSIONS:=2.5
DEB_PYTHON_SYSTEM=pysupport

PYVERS = $(shell pyversions -vd)

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

cdbs_python_current_binary := $(shell pyversions -d)

DEB_PYTHON_INSTALL_ARGS_ALL = --no-compile -O0 --install-layout=deb

install/wifieye::
	dh_install misc/wifieye.sudoers etc/sudoers.d/
	dh_install misc/wifieye.desktop usr/share/applications/hildon/
	cp misc/wifieye-64x64.png debian/wifieye.png
	dh_install debian/wifieye.png usr/share/icons/hicolor/64x64/apps/

clean/wifieye::
	rm -f debian/wifieye.png

python-build-stamp-%:
ifeq (all, $(cdbs_python_module_arch))
	 cd $(DEB_SRCDIR) && $(cdbs_python_current_binary) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
else
	 cd $(DEB_SRCDIR) && $(cdbs_python_current_binary) $(DEB_PYTHON_SETUP_CMD) build $(DEB_PYTHON_BUILD_ARGS)
endif # archall detection
	 touch $@

# install stage
ifeq (all, $(cdbs_python_module_arch))
common-install-arch common-install-indep:: python-install-py
python-install-py:
	 cd $(DEB_SRCDIR) && $(cdbs_python_current_binary) $(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) && $(cdbs_python_current_binary) $(DEB_PYTHON_SETUP_CMD) install --root=$(DEB_DESTDIR) $(DEB_PYTHON_INSTALL_ARGS_ALL)
endif # archall detection

