#!/usr/bin/make -f

# add appropriate flags for Debian
DEB_CONFIGURE_EXTRA_FLAGS =
ifeq ($(shell dpkg-vendor --is Debian && echo yes),yes)
	DEB_CONFIGURE_EXTRA_FLAGS += --with-aticonfig=yes
endif
# add appropriate flags for Ubuntu
ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
DEB_CONFIGURE_EXTRA_FLAGS += --with-aticonfig=/usr/lib/fglrx/bin/aticonfig
endif

%:
	dh $@

override_dh_install:
	rm -rfv debian/tmp/usr/lib/*/*.la 
	rm -rfv debian/tmp/usr/lib/*/*/*.la 
	dh_install --list-missing

override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=/usr/lib/mate-sensors-applet
		$(DEB_CONFIGURE_EXTRA_FLAGS) \
		--with-nvidia=yes \
		--with-gtk=2.0

override_dh_strip:
	dh_strip --dbg-package=mate-sensors-applet-dbg

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
