#!/usr/bin/make -f
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs -Wl,--as-needed

%:
	dh $@ --with gnome,gir

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=\$${prefix}/lib/cheese

override_dh_install:
	find debian/tmp -name '*.la' -print -delete
	dh_install
	pkg-gnome-compat-desktop-file \
		$(CURDIR)/debian/cheese/usr/share/applications/org.gnome.Cheese.desktop \
		$(CURDIR)/debian/cheese/usr/share/applications/cheese.desktop

override_dh_missing:
	dh_missing --fail-missing

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

override_dh_clean:
	dh_clean
	rm -rf *vala.stamp
	rm -rf src/*.c

# https://bugzilla.gnome.org/731009
override_dh_auto_test:
	-xvfb-run dh_auto_test
