#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.

GIT='https://github.com/muammar/mkchromecast'
# The full changelog version number, used for the orig.tar.gz
VER=$(shell dpkg-parsechangelog -ldebian/changelog -SVersion | cut -d- -f1)
export DH_VERBOSE = 1

export PYBUILD_NAME=mkchromecast

%:
	dh $@  --with python3

override_dh_auto_build:
	touch build

override_dh_auto_test:
	echo 'Do nothing'

override_dh_install:
	dh_install
	dh_python3
	chmod +x debian/mkchromecast/usr/share/mkchromecast/mkchromecast.py

override_dh_auto_clean:
	echo 'Cleaning *.pyc'
	find . -name \*.pyc -exec rm {} \;

get-orig-source:
	rm -rf mkchromecast-$(VER)
	git clone -b debian $(GIT) mkchromecast-$(VER)
	cd mkchromecast-$(VER)
	git archive --format=tar --prefix=mkchromecast-$(VER)/ HEAD > mkchromecast_$(VER).orig.tar
	gzip --best mkchromecast_$(VER).orig.tar
	mv mkchromecast_$(VER).orig.tar.gz ..
	rm -rf mkchromecast-$(VER)
