#!/usr/bin/make -f

include /usr/share/openstack-pkg-tools/pkgos.make
export OSLO_PACKAGE_VERSION=$(VERSION)

%:
	dh $@  --with python2

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	./run_tests.sh || true
endif

override_dh_clean:
	dh_clean
	rm -rf heat.egg-info
	rm -rf doc/build
	find . -iname '*.pyc' -delete
	rm -f run_tests.err.log
	rm -f \
		debian/heat-common.postinst \
		debian/heat-common.config

override_dh_install:
	dh_install
	install -D -m 0640 etc/heat/heat.conf.sample $(CURDIR)/debian/heat-common/usr/share/heat-common/heat.conf
	cat $(CURDIR)/debian/keystone_authtoken >>$(CURDIR)/debian/heat-common/usr/share/heat-common/heat.conf

override_dh_auto_build:
	dh_auto_build
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func heat-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func heat-common.config

override_dh_installman:
	python setup.py build
	make -C doc man
	dh_installman
