#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
BUILDDIR := _build/src/gitlab.com/gitlab-org/gitlab-shell

export DH_GOLANG_EXCLUDES := internal/testhelper $(shell cd client && ls *_test.go) $(shell find internal -type f -name '*_test.go') client/testserver

%:
	dh $@  --buildsystem=golang --with=golang --package=golang-gitlab-gitlab-org-gitlab-shell-v14-dev \
        --builddirectory=_build
	dh $@  --buildsystem=golang --with=golang --builddirectory=_build --package=gitlab-shell

override_dh_auto_configure-indep:
	dh_auto_configure -O--buildsystem=golang -O--with=golang -O--builddirectory=_build -O--package=golang-gitlab-gitlab-org-gitlab-shell-v14-dev

override_dh_auto_configure-arch:
	dh_auto_configure -O--buildsystem=golang -O--with=golang -O--builddirectory=_build -O--package=gitlab-shell

override_dh_auto_install:
	dh_auto_install
	mv $(CURDIR)/debian/tmp/usr/bin/check $(CURDIR)/debian/tmp/usr/bin/gitlab-shell-check

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	-dh_auto_test -O--buildsystem=golang -O--package=gitlab-shell
endif
