#!/usr/bin/make -f
# -*- makefile -*-

# export DH_VERBOSE=1

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

DESTDIR := $(CURDIR)/debian/murano-common

%:
	dh $@ --buildsystem=python_distutils --with python2,sphinxdoc

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. sphinx-build -b html doc/source $(CURDIR)/debian/murano-doc/usr/share/doc/murano-doc/html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif

override_dh_auto_install:
	cp $(CURDIR)/etc/murano/murano-paste.ini $(DESTDIR)/etc/murano/murano-paste.ini
	cp $(CURDIR)/etc/murano/netconfig.yaml.samle $(DESTDIR)/etc/murano/netconfig.yaml.sample
	cp $(CURDIR)/etc/murano/logging.conf.sample $(DESTDIR)/etc/murano/logging.conf
	cp $(CURDIR)/etc/murano/policy.json $(DESTDIR)/etc/murano/policy.json
	set -e; cd $(CURDIR)/meta/io.murano/; zip -r $(DESTDIR)/var/cache/murano/meta/io.murano.zip ./
	cd $(CURDIR)
	dh_auto_install
