#!/usr/bin/make -f

# Set temporary HOME for lazarus primary config directory
export HOME=$(CURDIR)/tmphome

ROOT = $(CURDIR)/debian/c-evo

override_dh_auto_clean:
	$(RM) -r lib
	$(RM) lib c-evo

override_dh_auto_build:
	lazbuild --build-mode=Release AI/StdAI/StdAI.lpi
	mv AI/StdAI/libstdai.so AI/StdAI/libstdai-$(DEB_HOST_ARCH).so
	lazbuild --build-mode=Release Integrated.lpi

override_dh_auto_install:
	install -Dm755 c-evo -t $(ROOT)/usr/bin
	install -Dm644 Install/common/c-evo.desktop -t $(ROOT)/usr/share/applications
	install -Dm644 Install/common/c-evo.xml -t $(ROOT)/usr/share/mime/packages
	install -Dm644 Install/common/c-evo_256x256.png $(ROOT)/usr/share/pixmaps/c-evo.png
	install -Dm644 Install/common/c-evo_256x256.png $(ROOT)/usr/share/pixmaps/application-cevo.png
	install -Dm644 Install/common/c-evo_256x256.png $(ROOT)/usr/share/pixmaps/application-cevomap.png
	install -Dm644 AI/StdAI/libstdai-$(DEB_HOST_ARCH).so -t $(ROOT)/usr/share/c-evo/AI/StdAI

%:
	dh $@
