#!/usr/bin/make -f
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_build:
	:

override_dh_auto_clean:
	rm -rf debian/tmp

override_dh_auto_install:
	rm -rf debian/tmp
	mkdir -p debian/tmp/256
	mkdir -p debian/tmp/48
	mkdir -p debian/tmp/32
	mkdir -p debian/tmp/24
	mkdir -p debian/tmp/16
	icotool --extract --width=256 -o debian/tmp/256/nexuiz.png nexuiz.ico
	icotool --extract --width=48 -o debian/tmp/48/nexuiz.png nexuiz.ico
	icotool --extract --width=32 -o debian/tmp/32/nexuiz.png nexuiz.ico
	icotool --extract --width=24 -o debian/tmp/24/nexuiz.png nexuiz.ico
	icotool --extract --width=16 -o debian/tmp/16/nexuiz.png nexuiz.ico
	sed -e 's/@DPSELF@/nexuiz/g' \
		-e 's/@DPROLE@/client/g' \
		-e 's/@DPBINARY@/darkplaces/g' \
		< debian/nexuiz.in > debian/tmp/nexuiz
	sed -e 's/@DPSELF@/nexuiz-server/g' \
		-e 's/@DPROLE@/server/g' \
		-e 's/@DPBINARY@/darkplaces-server/g' \
		< debian/nexuiz.in > debian/tmp/nexuiz-server
