#!/usr/bin/make -f

%:
	dh $@ --with python3 --buildsystem=pybuild

# The Makefile test target is broken and refers to a non-existant test/runtests.py;
# in fact that target should not exist at all.
override_dh_auto_test:

override_dh_auto_clean:
	python3 setup.py clean -a
	rm -rf gajim/__pycache__/
	rm -rf gajim/command_system/__pycache__/
	rm -rf gajim/command_system/implementation/__pycache__/
	rm -rf gajim/common/__pycache__/
	rm -rf gajim/common/protocol/__pycache__/
	rm -rf gajim/common/zeroconf/__pycache__/
	rm -rf gajim/data/emoticons/font-emoticons/__pycache__/
	rm -rf gajim/data/emoticons/noto-emoticons/__pycache__/
	rm -rf gajim/plugins/__pycache__/

override_dh_auto_configure:
	python3 setup.py config

override_dh_auto_build:
	python3 setup.py build

override_dh_auto_install:
	python3 setup.py install --install-layout=deb --root=$(CURDIR)/debian/gajim
	rm -rf $(CURDIR)/debian/gajim/usr/lib/python3/dist-packages/gajim/data/emoticons/*-emoticons/*
	touch $(CURDIR)/debian/gajim/usr/lib/python3/dist-packages/gajim/data/emoticons/.dummy
