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

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

PREFIX = /usr

derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")

%:
	dh $@ --with=python2

override_dh_auto_build:
	./tools/po-compile.sh
	dh_auto_build

override_dh_auto_clean:
	./tools/clean.sh
	debconf-updatepo
	dh_auto_clean

override_dh_auto_install:
	dh_auto_install -- --prefix=$(PREFIX) --install-lib=$(PREFIX)/share/solaar/lib

override_dh_python2:
	dh_python2 $(PREFIX)/share/solaar/lib

override_dh_gencontrol:
ifeq ($(derives_from_ubuntu),yes)
	dh_gencontrol -- '-Vsolaar:Desktop-Icon-Theme=gnome-icon-theme-full | oxygen-icon-theme-complete' -Vsolaar:Gnome-Icon-Theme=gnome-icon-theme-full
else
	dh_gencontrol -- '-Vsolaar:Desktop-Icon-Theme=gnome-icon-theme | oxygen-icon-theme' -Vsolaar:Gnome-Icon-Theme=gnome-icon-theme
endif
