#!/usr/bin/make -f
# -*- makefile -*-

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

export LDFLAGS+=-Wl,--as-needed

# To avoid running configure twice (because gnome-autogen.sh)
export NOCONFIGURE=yes

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  DH_PARALLEL_OPTION=--parallel
endif

ifeq ($(cinnamon dpkg-vendor --query vendor),Ubuntu)
DH_GENCONTROL_ARGS = -Vicon-theme:Depends=gnome-icon-theme-full
endif

%:
	dh  $@ --with autoreconf,python2 $(DH_PARALLEL_OPTION)


override_dh_autoreconf:
	dh_autoreconf --as-needed ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- --enable-compile-warnings=yes \
	                     --disable-schemas-install \
	                     BROWSER_PLUGIN_DIR=/usr/lib/mozilla/plugins

# Disable checks since they are not functional for the moment
override_dh_auto_test:

override_dh_install:
	dh_install -X.la

override_dh_strip:
	dh_strip --dbg-package=cinnamon-dbg

override_dh_makeshlibs:
	dh_makeshlibs -Xplugin

override_dh_shlibdeps:
	dh_shlibdeps
	dh_girepository -l src -p/usr/lib/muffin /usr/lib/cinnamon

override_dh_gencontrol:
	dh_gencontrol -- $(DH_GENCONTROL_ARGS)
