#!/usr/bin/make -f
# -*- makefile -*-

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

include /usr/share/dpkg/buildflags.mk
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
DH_ADDONS := --with apport
CMAKE_FLAGS := \
	-DREPOWERD_ENABLE_HYBRIS=ON \
	-DREPOWERD_ENABLE_BINDER=ON \
	-DENABLE_WERROR=ON
else
CMAKE_FLAGS := \
	-DREPOWERD_ENABLE_HYBRIS=OFF \
	-DREPOWERD_ENABLE_BINDER=OFF \
	-DREPOWERD_ENABLE_LSC=OFF
endif

%:
	dh $@ $(DH_ADDONS)

override_dh_auto_configure:
	dh_auto_configure -- \
		$(CMAKE_FLAGS) \
		-DREPOWERD_DISABLE_TIME_SENSITIVE_TESTS=ON

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