#!/usr/bin/make -f

# Verbose mode
#export DH_VERBOSE=1

DEB_PYTHON_SYSTEM=pysupport
DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed

%:
	dh $@ --with python2

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

override_dh_auto_install:
	dh_auto_install -- --single-version-externally-managed
#
##override_dh_install:
##	dh_install --fail-missing
##	rm -rf debian/python-keystone-voms/usr/lib/python*/*/doc
##	install -D -m 0600 $(CURDIR)/etc/voms.json  $(CURDIR)/debian/keystone/etc/keystone/voms.json
##
override_dh_clean:
	rm -rf $(CURDIR)/build/
	rm -rf $(CURDIR)/doc/build
	dh_clean

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

