#!/usr/bin/make -f

# Verbose mode
#export DH_VERBOSE=1

%:
	dh $@ --with python2

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/doc doc/source/api doc/.autogenerated
	rm -rf tests.sqlite clean.sqlite run_tests.log
	rm -rf CA
	rm -rf nova.egg-info
	rm -f po/nova.pot

override_dh_auto_build:
	dh_auto_build
	python setup.py build_sphinx
	mv doc/doc/build/man/novamanage.1 doc/doc/build/man/nova-manage.1

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

override_dh_fixperms:
	dh_fixperms -Xnova_sudoers
	rm -f $(CURDIR)/debian/python-nova/usr/share/pyshared/nova/CA/.gitignore
	rm -f $(CURDIR)/debian/python-nova/usr/share/pyshared/nova/CA/projects/.gitignore
	rm -f $(CURDIR)/debian/python-nova/usr/share/pyshared/nova/CA/reqs/.gitignore

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