#!/usr/bin/make -f

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

export HOME=$(CURDIR)/build
%:
	dh $@ --with python3

override_dh_auto_build:
	dh_auto_build
	echo $(DEB_BUILD_ARCH) | grep 'amd64\|i386' \
	  || patch app/Screenshooter.py debian/use-cutycapt-for-arm.patch
	

override_dh_install:
	PYTHONPATH=. python3 app/settings.py
	dh_install -Xpycache

override_dh_fixperms:
	dh_fixperms
	chmod 755 debian/legion/usr/share/legion/scripts/*
