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

# extract the architecture for setting the library path suffix
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# extract the last section of the changelog version for extra info
DEB_VERSION ?= $(shell dpkg-parsechangelog -S Version)
DEB_VERSION_EXTRA := $(lastword $(subst -, ,$(DEB_VERSION)))

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

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_AUTOSET_INSTALL_RPATH=FALSE \
		-DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" \
		-DSOAPY_SDR_EXTVER="$(DEB_VERSION_EXTRA)"

override_dh_installchangelogs:
	dh_installchangelogs Changelog.txt
