#!/usr/bin/make -f

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

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Upstream changelog
upstream_changes := $(wildcard dist/changes-*)

%:
	dh $@ --parallel --list-missing --dbg-package=qtcreator-dbg --buildsystem=qmake_qt4 --builddirectory=builddir

override_dh_auto_configure:
	mkdir -p builddir
	dh_auto_configure -- $(CURDIR) IDE_LIBRARY_BASENAME=lib/$(DEB_HOST_MULTIARCH) $(extra_configure_opts)

override_dh_auto_install:
ifneq (,$(filter qtcreator-doc, $(shell dh_listpackages)))
	dh_auto_build -- qch_docs
endif
	dh_auto_install --destdir=debian/tmp/usr
	dh_auto_build -- install_docs INSTALL_ROOT=$(CURDIR)/debian/tmp/usr

override_dh_installdocs:
	dh_installdocs -pqtcreator $(upstream_changes)
	dh_installdocs --remaining-packages

override_dh_makeshlibs:
	# qtcreator doesn't provide any public libraries

override_dh_builddeb:
	dh_builddeb -- -Zxz
