#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PACKAGE_NAME=gozerbot
MODULE_NAME=gozerbot

DEB_PYTHON_SYSTEM=pysupport
DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
PYVER=$(shell python -V 2>&1 | cut -d ' ' -f 2 | cut -d . -f 1-2)

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp
	rm -rf dist build
	find . -name *\.py[co] -exec rm {} \;
	dh_clean

build: build-stamp
build-stamp: $(PYVERS:%=build-ext-%)
	touch $@
build-ext-%:
	dh_testdir
	python$* setup.py build
	touch $@

install: install-indep

install-indep: build
	dh_testdir
	dh_testroot
	python setup.py install --root=debian/gozerbot

binary-arch:

binary-indep: build install
	dh_install runbot /usr/bin
	dh_installdocs
	dh_testdir
	dh_testroot
	dh_installchangelogs doc/changelog
	dh_installdocs
	dh_installman
	dh_fixperms
	dh_compress
	dh_pysupport
	dh_installdeb
	dh_gencontrol 
	dh_md5sums
	dh_builddeb 

binary: binary-indep binary-arch

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