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

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

%: 
	dh $@ --with systemd

override_dh_auto_build:
	# create XDG compatible icons from SVG
	for i in 16 22 32 48 64 128; do \
		mkdir -p "icons/hicolor/$${i}x$${i}/apps" ; \
		inkscape --export-width=$${i} \
			 --export-height=$${i} \
			 --export-png="$(CURDIR)/icons/hicolor/$${i}x$${i}/apps/sidu-manual.png" \
				$(CURDIR)/icons/sidu-manual.svg ; \
	done
	
	# create XPM icons for the debian menu system
	convert  ./icons/hicolor/32x32/apps/sidu-manual.png icons/sidu-manual.xpm
	
	# create new search db
	cd development; \
	./buildHelpDb.sh	

	
override_dh_auto_clean:
	$(RM) -r icons/pixmaps
	$(RM) -r icons/hicolor
	$(RM) data/sidu-manual*.db
	find . -name \*.pyc | xargs rm -f
	dh_auto_clean
