#!/usr/bin/make -f
INSTALL = /usr/bin/install
INSTALL_PROGRAM = $(INSTALL) -m 755 -o root -g root
INSTALL_DATA = $(INSTALL) -m 644 -o root -g root
INSTALL_DIR = $(INSTALL) -d -m 755 -o root -g root
DESTDIR=`pwd`/debian
PREFIX = $(DESTDIR)/Y
EXAMPLES = demo.py

PYFILES = yappy/parser.py yappy/osets.py yappy/__init__.py

DIRS =  usr/X11R6/bin usr/lib/apoo usr/share/doc

PYVERS := $(shell pyversions -r)

build: build-stamp
build-stamp:
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	rm -f build-stamp install-stamp
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	set -e; for py in $(PYVERS); do \
	    inst_dir=debian/python-yappy/usr/lib/$$py/site-packages/yappy; \
	    mkdir -p $$inst_dir;                                           \
	    ${INSTALL_DATA} ${PYFILES} $$inst_dir;                         \
	done

	touch install-stamp



binary-indep: build install
	dh_testdir -i 
	dh_testroot -i
	dh_link
	dh_strip
	dh_installchangelogs
	dh_installdocs
	dh_installexamples
	dh_compress -X.py -X.pdf
	dh_fixperms
	dh_python2
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: ;

binary: binary-indep 
.PHONY: build clean binary-indep binary-arch binary install configure
