#!/usr/bin/make -f

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

DH_AC_FLAGS=--buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_DOC=OFF -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DSTATIC_BOOST=ON
DH_AT_CMD = dh_auto_build --verbose --parallel
ifdef DEB_HOST_MULTIARCH
	DH_AC_FLAGS += -DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
endif

%:
	dh $@ --verbose --parallel

override_dh_strip:
	dh_strip -p couchbase-transactions --dbg-package=couchbase-transactions-dbg
	dh_strip --remaining-packages

override_dh_auto_configure:
	echo "usr/include/*" > debian/couchbase-transactions.install
	echo "usr/lib/$(DEB_HOST_MULTIARCH)/libtransactions_cxx.so*" >> debian/couchbase-transactions.install
	dh_auto_configure $(DH_AC_FLAGS)

