#!/usr/bin/make -f

# Verbose mode
#export DH_VERBOSE=1


DEB_PYTHON_SYSTEM=pysupport

#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/doc/build

override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	python setup.py build_sphinx
else
	mkdir -p doc/doc/build/html
endif

get-orig-source:
	uscan --verbose --force-download --rename --destdir=../build-area

override_dh_install:
	dh_install
	chmod 440 $(CURDIR)/debian/nova-common/etc/sudoers.d/nova_sudoers

override_dh_fixperms:
	dh_fixperms -Xnova_sudoers

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	./run_tests.sh -N
endif

override_dh_installinit:
	dh_installinit --error-handler=true
