#!/usr/bin/make -f

export PYBUILD_NAME=google-compute-engine
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS={dir}/google_compute_engine/

%:
	dh $@ --with python2,python3,systemd --buildsystem=pybuild

override_dh_systemd_start:
	dh_systemd_start --no-restart-on-upgrade --no-start --name=google-startup-scripts
	dh_systemd_start --no-restart-on-upgrade --no-start --name=google-shutdown-scripts

override_dh_python3:
	dh_python3
	
	# We want to split the Python 3 scripts out to the
	# gce-compute-image-packages package
	mkdir -p debian/gce-compute-image-packages/usr/bin/
	mv debian/python3-google-compute-engine/usr/bin/* debian/gce-compute-image-packages/usr/bin/
	rmdir debian/python3-google-compute-engine/usr/bin

override_dh_python2:
	dh_python2

	# We don't want the Python 2 scripts at all
	rm -rf debian/python-google-compute-engine/usr/bin

override_dh_clean:
	rm -rf google_compute_engine.egg-info
	dh_clean
