#!/usr/bin/make -f

-include /usr/share/dpkg/buildflags.mk

configure: configure-stamp

configure-stamp:
	dh_testdir
	touch $@

build: build-arch build-indep

build-arch:

build-indep: build-stamp

build-stamp: configure-stamp
	python setup.py build
	make -C doc html
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -rf build doc/_build
	dh_clean configure-stamp build-stamp

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	python setup.py install --prefix=/usr --root=debian/tmp --skip-build

binary: binary-arch binary-indep

binary-arch:

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdirs
	dh_installdocs
	dh_installchangelogs
	dh_install
	dh_missing --fail-missing
	dh_sphinxdoc
	dh_python2
	dh_link
	dh_compress -X html
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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