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

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

export DEB_CFLAGS_MAINT_APPEND=-Wall $(shell xml2-config --cflags)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
ICONSDIR=debian/icons/hicolor

%:
	dh  $@ --ddeb-migration='daisy-player-dbg (<< 10.3-2~)'

override_dh_clean:
	rm -rf $(ICONSDIR)
	dh_clean

override_dh_auto_build:
	dh_auto_build

	# Building icons
	for size in 48 72 ; do \
		mkdir -p $(ICONSDIR)/$${size}x$${size}/apps ; \
		rsvg-convert --width $$size --height $$size icons/daisy-player.svg \
			--output $(ICONSDIR)/$${size}x$${size}/apps/daisy-player.png ; done
	mkdir -p $(ICONSDIR)/scalable/apps
	gzip -c9 icons/daisy-player.svg >  $(ICONSDIR)/scalable/apps/daisy-player.svgz

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp

