#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,--as-needed

# Disable gconf on Ubuntu
ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
        PLATFORM = --with-platform=gtk-only
endif

%:
	dh $@ --with gnome

override_dh_auto_configure:
	dh_auto_configure -- \
		--bindir=\$${prefix}/games \
		--with-pysol-card-theme-path=/usr/share/games/pysol \
		$(PLATFORM)

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_fixperms:
	dh_fixperms -X/usr/games/sol

override_dh_makeshlibs:
	dh_makeshlibs -p aisleriot --no-act
	dh_makeshlibs --remaining-packages

# Only install gconf schemas if not Ubuntu
override_dh_install:
ifneq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
	dh_install -p aisleriot debian/tmp/etc
endif
	dh_install --remaining-packages

override_dh_missing:
	dh_missing --fail-missing
