#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for spice-vdagent

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)
export deb_udevdir = $(shell pkg-config --variable=udevdir udev | sed s,^/,,)

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

override_dh_auto_configure:
	dh_auto_configure -- \
		    --with-init-script=systemd \
		    --enable-pie=yes \
                    --with-session-info=systemd \
		    --with-gtk=yes
%:
	dh $@

execute_after_dh_install:
# We cannot add this to the .link file because dh_link is called after
# dh_systemd_* helpers during normal build
	dh_link $(deb_systemdsystemunitdir)/spice-vdagentd.service $(deb_systemdsystemunitdir)/spice-vdagent.service
