#!/usr/bin/make -f

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

export HOME = $(CURDIR)/build

%:
	dh $@ --with python3

execute_after_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

execute_after_dh_fixperms:
	chmod 755 debian/legion/usr/share/legion/scripts/*
