#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

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

override_dh_auto_install:
	dh_auto_install -- --no-source

execute_before_dh_installman:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	help2man debian/kubectx/usr/bin/kubectx \
		--no-info --no-discard-stderr \
		--version-string="$(DEB_VERSION)" \
		-n "Tool to switch between contexts (clusters) on kubectl faster" > debian/kubectx.1

	help2man debian/kubectx/usr/bin/kubens \
		--no-info --no-discard-stderr \
		--version-string="$(DEB_VERSION)" \
		-n "Tool to switch between Kubernetes namespaces, and configure them for kubectl" > debian/kubens.1
endif
