#!/usr/bin/make -f

%:
	dh ${@} --parallel

override_dh_auto_build:
	help2man	--name=setpassword \
			--section=8 \
			--source=siduction \
			--no-info \
			--version-option="--dpkg-parsechangelog" \
			--output=$(CURDIR)/setpassword.8 \
				$(CURDIR)/setpassword
	dh_auto_build

override_dh_auto_clean:
	rm -f $(CURDIR)/setpassword.8
	dh_auto_clean

create-icons:
	# requires inkscape to be installed
	@if [ ! -x /usr/bin/inkscape ]; then \
		echo "ERROR: inkscape not installed!" ; \
		false ; \
	fi
	
	# 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/setpassword.png" \
				$(CURDIR)/icons/setpassword.svg ; \
	done
