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

include /usr/share/dpkg/architecture.mk

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

%:
	dh $@ --buildsystem=cmake

execute_after_dh_auto_clean:
	rm -rf debian/tmp-static static

override_dh_auto_configure:
	dh_auto_configure                         -- -DCMAKE_INSTALL_RPATH="" -DBUILD_SHARED_LIBS=YES
	dh_auto_configure --builddirectory=static -- -DCMAKE_INSTALL_RPATH="" -DBUILD_SHARED_LIBS=NO

override_dh_auto_build:
	dh_auto_build
	dh_auto_build --builddirectory=static

override_dh_auto_install:
	dh_auto_install
	dh_auto_install --builddirectory=static --destdir=debian/tmp-static
	cp debian/tmp-static/usr/lib/${DEB_HOST_MULTIARCH}/*.a debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/

# No dbgsym packages:
override_dh_strip:
	dh_strip --no-automatic-dbgsym
