#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1

# The versions of python currently supported
PYTHON=$(shell pyversions -r)

build: build-stamp

build-stamp: 
	dh_testdir
	$(PYTHON) setup.py build
	touch $@

clean: 
	dh_testdir
	rm -f *-stamp
	rm -rf compile build
	./clean.sh
	dh_clean

install: build install-$(PYTHON)

install-$(PYTHON):
	dh_testdir
	dh_testroot
	mkdir -p debian/pkipplib/usr/lib
	$(PYTHON) setup.py install --prefix /usr --root `pwd`/debian/pkipplib/
	find ./debian/pkipplib/usr/lib -name '*\.py' | xargs sed -i -e '1 s|^#\!.*python.*||'

# Build architecture-independent files here.
# Pass to all debhelper commands in this target to reduce clutter.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installchangelogs
	dh_pycentral
	dh_compress -X.py
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep

binary-arch:

.PHONY: build clean binary-indep binary install
