#!/usr/bin/make -f
DESTDIR = $(CURDIR)/debian/tmp

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

export PYSHORT=python3
export PYTHON=$(shell which $(PYSHORT))
export PYTHON_CONFIG="$(PYTHON)-config"

%:
	dh $* $(BUILD_PACKAGES)

override_dh_auto_configure:
	dh_auto_configure -- \
		-DUSEWX=yes -DPYTHON=yes \
		-DEDITOR_JUMPWORD=yes -DEDITOR_EDITWRAP=yes \
		-DNETCFG=yes -DSQLITEPLUGIN=yes -DPROCPLUGIN=yes \
		-DARCLITE=yes \
        -DHEXITOR=yes \
        -DOPENWITH=yes \
        -DU_ADB=yes \
        -DU_MTP=yes \
		-DCMAKE_BUILD_TYPE=Release

override_dh_auto_test:
	# Running make test requires configuration with --enable-selftest, which
	# we don't want to do for production systems.

override_dh_missing:
	dh_missing --fail-missing
