#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

PACKAGE = wxgeometrie

%:
	dh $@ --with python2

override_dh_clean:
	rm -rf build session/* log/* preferences/*
	find . -name "*.pyc" -o -name "*~" | xargs rm -f
	rm -rf wxgeometrie/sympy/*
	rm -f wxgeometrie/doc/license.txt
	#
	dh_clean

override_dh_auto_build:
	python setup.py build

override_dh_auto_install:
	python setup.py install --root $(CURDIR)/debian/$(PACKAGE)
	install -d $(CURDIR)/debian/$(PACKAGE)/usr/bin
	install -m 755 wxgeom $(CURDIR)/debian/$(PACKAGE)/usr/bin
	install -d $(CURDIR)/debian/$(PACKAGE)/usr/share/applications
	install -m 644 wxgeometrie.desktop \
	           $(CURDIR)/debian/$(PACKAGE)/usr/share/applications
	install -d $(CURDIR)/debian/$(PACKAGE)/usr/share/icons
	install -m 644 ./wxgeometrie/images/archives/wxgeometrie-icone-small-no-background-2.svg \
	           $(CURDIR)/debian/$(PACKAGE)/usr/share/icons/wxgeometrie.svg
override_dh_compress:
	dh_compress -X.xhtml
