#!/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,systemd --buildsystem=pybuild

override_dh_installinit:
	dh_installinit --name=google-startup-scripts --onlyscripts --no-start --no-restart-on-upgrade 
	dh_installinit --name=google-shutdown-scripts --onlyscripts --no-start --no-restart-on-upgrade
	dh_installinit --name=google-shutdown-scripts-block-rsyslog --onlyscripts --no-start --no-restart-on-upgrade

override_dh_clean:
	rm -rf google_compute_engine.egg-info
	dh_clean

override_dh_python2:
	dh_python2

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