#!/usr/bin/make -f
#export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS=nocheck
export PYBUILD_NAME=dodgy

VERSION := $(shell dpkg-parsechangelog -Sversion | cut -d- -f1)
DEBDATE := $(shell dpkg-parsechangelog -Sdate | date -u +"%F" -f -)

%:
	dh $@ --with python2 --buildsystem=pybuild

override_dh_auto_test:
	PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="{interpreter} -m nose -v" dh_auto_test

override_dh_installdocs:
	pandoc -t plain -o .pybuild/README README.md
	dh_installdocs .pybuild/README

override_dh_installman:
	txt2man -s 1 -v "dodgy" -t "dodgy" -r "$(VERSION)" -d "$(DEBDATE)" debian/dodgy.txt > .pybuild/dodgy.1
	dh_installman .pybuild/dodgy.1
