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

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

export PREFIX=/usr

ifndef UPVER
UPVER   := $(shell dpkg-parsechangelog | grep ^Version | awk '{print $$2}' | cut -d- -f1)
endif
SVNREPO := http://svn.leocad.org/tags

%:
	dh $@

override_dh_auto_clean:
	$(MAKE) veryclean

# Install icon too
override_dh_install:
	dh_install
	install -m644 -D tools/icon/icon32.png \
		debian/leocad/usr/share/pixmaps/leocad32.png

get-orig-source:
	svn checkout $(SVNREPO)/leocad-$(UPVER)
	find leocad-$(UPVER)/ -name ".svn" -type d | xargs rm -rf
	tar cf leocad_$(UPVER).orig.tar leocad-$(UPVER)
	bzip2 leocad_$(UPVER).orig.tar
	rm -rf leocad-$(UPVER)/
