#!/usr/bin/make -f

# workaround to avoid calling Scratchbox python2.3
PATH := /usr/bin:$(PATH)
export PATH
SBOX_REDIRECT_IGNORE = /usr/bin/python
export SBOX_REDIRECT_IGNORE

DEB_PYTHON_SYSTEM = pycentral

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

# Add here any variable or target overrides you need.

DEB_DH_INSTALL_ARGS := --sourcedir=$(DEB_DESTDIR)
DEB_PYTHON_INSTALL_ARGS_ALL = --no-compile -O0

DEB_DH_STRIP_ARGS := --dbg-package=python-location-dbg


build/python-location-dbg::
	set -e; \
	for i in $(cdbs_python_build_versions); do \
		python$$i-dbg ./setup.py build; \
	done

install/python-location-dbg::
	for i in $(cdbs_python_build_versions); do \
		python$$i-dbg ./setup.py install --root=$(CURDIR)/debian/python-location-dbg; \
	done
	find debian/python-location-dbg \
		! -type d ! -name '*_d.so' | xargs rm -f
	find debian/python-location-dbg -depth -empty -exec rmdir {} \;

binary-predeb/python-location-dbg::
	rm -rf debian/python-location-dbg/usr/share/doc/python-location-dbg
	ln -s python-location debian/python-location-dbg/usr/share/doc/python-location-dbg

clean::
	rm -f location.c
