#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

SRC_TMP=$(CURDIR)/SRC_TMP
debtmp := $(CURDIR)/debian/tmp

pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
VERSION := $(shell dpkg-parsechangelog | grep Version | cut -d\  -f2 | cut -d- -f1)
UVERSION := $(shell dpkg-parsechangelog | grep Version | cut -d\  -f2 | cut -d- -f1 | sed 's/\./_/g')

%:
	dh $@ --with python2

override_dh_auto_clean:
	dh_auto_clean
	rm -rf solvers

override_dh_auto_build:
	mkdir solvers
	dh_auto_build

override_dh_install-indep:
	dh_install
	rm -rf debian/$(pkg)/usr/share/cain/help/* debian/$(pkg)/usr/share/cain/gui/help.htm*
	cd help && zip ../debian/$(pkg)/usr/share/cain/help/cain.htb * -r -q -x *.htb *.htd
	if [ -d debian/$(pkg)/usr/share/cain/ ] ; then \
	    find debian/$(pkg)/usr/share/cain/ -type f -executable -exec chmod 644 {} + ; \
	fi

override_dh_auto_test:
	echo "no tests implemented"

get-orig-source:
	uscan --verbose --force-download --repack --compression xz
#	find $(SRC_TMP) -type f -exec chmod 644 {} +
#	find $(SRC_TMP) -type d -exec chmod 755 {} +
