#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk
DEB_INSTALL_DIR      = $(CURDIR)/debian/$(DEB_SOURCE)

%:
	dh $@ --with python3,vim_addon

execute_after_dh_install:
	echo "misc:Core-Ver=$(shell cat /usr/lib/ycmd/CORE_VERSION )" >> debian/vim-youcompleteme.substvars
	# No need to install tests
	$(RM) -rv $(DEB_INSTALL_DIR)/usr/share/vim-youcompleteme/python/ycm/tests \
              $(DEB_INSTALL_DIR)/usr/share/vim-youcompleteme/python/ycm/test_utils.py

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	LC_ALL=C.UTF-8 ./run_tests.py --skip-build --no-flake8
endif