#!/usr/bin/make -f 

export PYMODPATH="usr/share/python-support/linda"

build: build-stamp
build-stamp:
	dh_testdir
	touch $@

clean:
	$(RM) -r build-stamp install-stamp test-stamp
	$(RM) debian/copyright
	$(MAKE) $@
	$(MAKE) -C po $@
	$(RM) po/*.mo
	dh_clean

test: test-stamp
test-stamp: doc-stamp
	$(MAKE) test DESTDIR="$(CURDIR)/debian/linda"
	touch $@

install: build-stamp install-stamp
install-stamp:
	$(MAKE) install DESTDIR="$(CURDIR)/debian/linda"
	ln -s $(CURDIR)/copyright $(CURDIR)/debian/copyright
	touch $@

doc: doc-stamp
doc-stamp: install-stamp
	mkdir -p $(CURDIR)/debian/linda/usr/share/doc/linda/html
	epydoc --no-frames --help-file doc/help.html -o $(CURDIR)/debian/linda/usr/share/doc/linda/html $(CURDIR)/debian/linda/$(PYMODPATH)/linda

binary-indep: build-stamp install-stamp doc-stamp test-stamp
	dh_testroot
	dh_installdirs
	dh_installdocs -X.svn
	dh_installman
	dh_installchangelogs
	dh_pysupport
	dh_python
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep
.PHONY: build clean binary-indep binary install test
