#!/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

override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=/usr/lib/gnome-initial-setup \
		--disable-software-sources \
		--with-vendor-conf-file=/usr/lib/gnome-initial-setup/vendor.conf

override_dh_auto_build:
	cp debian/ubuntu-changes.png gnome-initial-setup/pages/ubuntu-changes
	dh_auto_build

# Skip language chooser on Ubuntu since it doesn't work there
override_dh_install:
	dh_install
ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
	dh_install debian/vendor.conf /usr/lib/gnome-initial-setup
endif

# Depend on the appropriate package for the Welcome logo
override_dh_gencontrol:
ifeq ($(shell dpkg-vendor --query vendor),Debian)
	dh_gencontrol -- -Vlogo:Depends='desktop-base'
else ifeq ($(shell dpkg-vendor --query vendor),Ubuntu)
	dh_gencontrol -- -Vlogo:Depends='gnome-control-center-data'
else
	dh_gencontrol
endif
