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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# 跳过测试：server/listener 的 TestDeviceListenError 假定测试非 root 运行
# （绑定特权端口 127.0.0.1:99 应报 permission denied），但构建环境以 root
# 运行导致绑定成功、测试失败，属于环境依赖型测试失败。
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

export LOMIRI_PUSH_TEST_RESOURCES_ROOT := $(CURDIR)
export GODEBUG := cgocheck=0

%:
	dh $@ --builddirectory=_build

override_dh_auto_configure:
	dh_auto_configure
	cp -rp exec-tool/ _build/

override_dh_auto_build:
	dh_auto_build
	dh_auto_build --buildsystem=makefile --builddirectory=_build/exec-tool

override_dh_auto_test:
	dh_auto_test --no-parallel
	dh_auto_test --no-parallel --buildsystem=makefile --builddirectory=_build/exec-tool

override_dh_auto_install:
	dh_auto_install
	dh_auto_install --buildsystem=makefile --builddirectory=_build/exec-tool

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
