#!/usr/bin/make -f

DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

# lxpanel does not build (yet) with hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=-all

%:
	dh ${@} --with autoreconf

autoreconf:
	autoreconf --install --force
	intltoolize --copy --force --automake

override_dh_autoreconf:
	dh_autoreconf debian/rules -- autoreconf

override_dh_auto_configure:
ifeq ($(DEB_HOST_ARCH_OS),linux)
	dh_auto_configure -- --enable-man --enable-indicator-support --with-plugins=all
else
	# omit netstat plugin on non-linux, requires wireless-tools
	dh_auto_configure -- --enable-man --enable-indicator-support --with-plugins=netstatus,volume,volumealsa,cpu,deskno,batt,kbled,xkb,thermal,cpufreq,monitors,wnckpager
endif

override_dh_auto_test:
	# disabled: test fails in po directory

override_dh_builddeb:
	dh_builddeb -- -Zxz -z9

override_dh_install:
	dh_install --fail-missing
ifeq ($(UBUNTU),yes)
	dh_install -plxpanel debian/local/source_lxpanel.py usr/share/apport/package-hooks
endif

override_dh_strip:
	dh_strip --dbg-package=lxpanel-dbg
