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

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

CFLAGS = -Wall $(shell xml2-config --cflags) $(shell dpkg-buildflags --get CFLAGS)

# We need dependency on hardening-wrapper to get hardened gcc as this is cleaner than
# patching upstream build system.
export DEB_BUILD_HARDENING=1

%:
	dh  $@ --with autoreconf

override_dh_clean:
	rm -rf icons
	dh_clean

override_dh_auto_build:
	for size in 48 72 ; do \
		mkdir -p icons/$${size}x$${size}/apps ; \
		rsvg-convert --width $$size --height $$size doc/eBook-speaker.svg \
			--output icons/$${size}x$${size}/apps/eBook-speaker.png ; done
	mkdir -p icons/scalable/apps
	gzip -c9 doc/eBook-speaker.svg > icons/scalable/apps/eBook-speaker.svgz

	dh_auto_build -- CFLAGS="$(CFLAGS)"

override_dh_strip:
	dh_strip --dbg-package=ebook-speaker-dbg
