#!/usr/bin/make -f

export PYBUILD_NAME=ubuntu-image
#export PYBUILD_VERBOSE=1
#export DH_VERBOSE=1

export UBUNTU_IMAGE_TESTS_NO_NETWORK=1
export pkgversion=$(shell dpkg-parsechangelog --show-field version)


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

# Override dh_install to ensure that /usr/bin/ubuntu-image is in the dedicated
# package.
override_dh_install:
	dh_install
	mkdir -p debian/ubuntu-image/usr/bin
	mv debian/python3-ubuntu-image/usr/bin/ubuntu-image \
	   debian/ubuntu-image/usr/bin/

override_dh_installman:
	rst2man ubuntu-image.rst > debian/ubuntu-image.1
	dh_installman

# Run the bare minimum of tests during build.  The majority of the tests will
# run during the autopkgtests.
override_dh_auto_test:
	dh_auto_test -- --system=custom \
		--test-args='{interpreter} -m nose2 -vv'

override_dh_auto_clean:
	rm -f debian/ubuntu-image.1
	dh_auto_clean
