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

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

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

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

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

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

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

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

override_dh_auto_test:
	# Disable tests, upstream doesn't use them
	:

override_dh_install-indep:
	dh_install --list-missing

	rm -f debian/cinnamon-common/usr/share/cinnamon/js/misc/config.js

override_dh_install-arch:
	dh_install -X.la --list-missing

override_dh_girepository:
	dh_girepository -l src /usr/lib/$(DEB_HOST_MULTIARCH)/cinnamon

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

override_dh_makeshlibs:
	dh_makeshlibs -pcinnamon -Xlibcinnamon
	dh_makeshlibs --remaining-packages
