#!/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
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk


# 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

# Disable check since upstream do not use them
override_dh_auto_test:

override_dh_install:
	dh_install -X.la

override_dh_python2:
	dh_python2 /usr/lib/cinnamon-menu-editor
	dh_python2 /usr/lib/cinnamon-settings
	dh_python2 /usr/lib/cinnamon-looking-glass
	dh_python2 /usr/lib/cinnamon-screensaver-lock-dialog

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

override_dh_makeshlibs:
	dh_makeshlibs -Xplugin

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