#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh ${@} --parallel --with autoreconf

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh -- 

override_dh_auto_configure:
ifeq ($(DEB_HOST_ARCH_OS),linux)
	dh_auto_configure -- --with-plugins=all --enable-indicator-support --disable-silent-rules
else
	# omit netstat plugin on non-linux, requires wireless-tools
	dh_auto_configure -- --with-plugins=all,-netstat --disable-silent-rules
endif

override_dh_install:
	dh_install --fail-missing

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

override_dh_makeshlibs:
	# plugins are not shared libs so disable processing for them
	dh_makeshlibs -X/plugins/

# remove unused .la file from the package
override_dh_auto_install:
	dh_auto_install
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/lxpanel/*.la
