#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# https://bugs.launchpad.net/openstack-ci/+bug/1322882
export PBR_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p' | cut -f1 -d '-')

%:
	dh $@ --with python2,sphinxdoc

override_dh_auto_build:
	dh_auto_build
	$(MAKE) -C doc html man BUILDDIR=$(CURDIR)/build/docs

override_dh_auto_clean:
	dh_auto_clean
	rm -rf *.egg*

override_dh_auto_install:
	dh_auto_install -- --install-lib=/usr/share/jenkins-job-builder

override_dh_install:
	dh_install
	mv debian/jenkins-job-builder/usr/bin/jenkins-jobs \
		debian/jenkins-job-builder/usr/share/jenkins-job-builder

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

get-orig-source:
	uscan --noconf --force-download --rename --repack --destdir=.
