#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

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

export DPKG_GENSYMBOLS_CHECK_LEVEL=4

include /usr/share/dpkg/default.mk

ifneq (,$(filter $(DEB_HOST_ARCH),ppc64el powerpc arm64))
        LOCATION_SERVICE_ENABLE_GPS_PROVIDER = OFF
else
        LOCATION_SERVICE_ENABLE_GPS_PROVIDER = ON
endif

%:
	dh $@ --parallel --fail-missing

override_dh_install:
	dh_install -Xubuntu-location-service.1 --fail-missing

override_dh_strip:
	dh_strip --dbg-package=libubuntu-location-service-dbg

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/ubuntu-location-service -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) -DLOCATION_SERVICE_ENABLE_GPS_PROVIDER=$(LOCATION_SERVICE_ENABLE_GPS_PROVIDER)
