#!/usr/bin/make -f

export DH_GOLANG_EXCLUDES := _examples

%:
	dh $@ --builddirectory=_build --buildsystem=golang

# Tests need a session bus (and a few want a system bus). Run them under
# dbus-run-session so the session-bus tests pass; skip the handful that
# require a real system bus, which is never available in build chroots.
override_dh_auto_test:
	dbus-run-session -- dh_auto_test -- \
	    -skip '^(TestSystemBus|TestConnectSystemBus|TestExecCommandHelper)$$'

# Upstream ships exec_command_test.go with the executable bit set.
# Strip it so the installed Go source files all have sane permissions.
override_dh_fixperms:
	dh_fixperms
	find debian/golang-github-godbus-dbus-v5-dev -type f -name '*.go' \
	    -exec chmod 0644 {} +
