#!/usr/bin/make -f

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

%:
	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

	# Remove the Python 3 entry scripts.
	rm -rf debian/python3-google-compute-engine/usr/bin

override_dh_python2:
	dh_python2

	# Split the Python 2 entry script to the google-compute-engine package.
	mkdir -p debian/google-compute-engine/usr/bin
	mv debian/python-google-compute-engine/usr/bin/* debian/google-compute-engine/usr/bin/
	rm -rf debian/python-google-compute-engine/usr/bin

override_dh_clean:
	rm -rf google_compute_engine.egg-info
	dh_clean
