#! /usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# We don't install all files upstream wants to. Those files get added to
# the following variable which gives us a cleaner buildd output (idea taken
# from the mesa package).
NOT_INSTALLED := \
				usr/lib/$(DEB_HOST_MULTIARCH)/libkvilib.so \
				usr/bin/kvirc-config \
				usr/share/kvirc/5.2/license/LICENSE-OPENSSL \
				usr/share/kvirc/5.2/license/COPYING \
				usr/share/kvirc/5.2/license/ABOUT-LICENSE \
				usr/share/pixmaps/kvirc.png

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
			-DCMAKE_BUILD_TYPE=RelWithDebInfo \
			-DWANT_COEXISTENCE=OFF \
			-DWANT_OSS=OFF \
			-DWANT_STRIP=OFF \
			-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
			-DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

override_dh_install:
	set -e; for file in $(NOT_INSTALLED); do rm debian/tmp/$$file; done
	dh_install

.PHONY: override_dh_auto_configure override_dh_install
