#!/usr/bin/make -f

# some "down-deps" pull too many libs as direct deps
# (in particular links with unneded libgstbase,libgthread,libgstvideo)
# XXX but this option is placed at the end of the command line so has no effect
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --disable-silent-rules \
	 --enable-smartcard \
	 --with-gstreamer=1.0 \
	 --with-sasl \
	 --enable-lz4 \

# remove Requires.private and Libs.private defs from .pc file -- we're not building static libs
	sed -E -i '/^(Libs|Requires)\.private:/D' spice-server.pc

# at least one of the tests (listen) initializes dconf which,
# for some reason, initializes its cache in ~/.cache/dconf.
# On a buildd, writing to $HOME is forbidden. Work around this
# by temporarily overriding $HOME
override_dh_auto_test:
	mkdir -p .home
	HOME=${CURDIR}/.home dh_auto_test --no-parallel
	rm -rf .home
override_dh_auto_clean:
	dh_auto_clean
	rm -rf .home
