#!/usr/bin/make -f

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

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

execute_before_dh_auto_install:
	mkdir -v -p $(CURDIR)/debian/completion
	_build/bin/gum completion bash > $(CURDIR)/debian/completion/gum.bash
	_build/bin/gum completion fish > $(CURDIR)/debian/completion/gum.fish
	_build/bin/gum completion zsh > $(CURDIR)/debian/completion/gum.zsh

override_dh_auto_install:
	dh_auto_install -- --no-source

execute_before_dh_installman:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	help2man debian/gum/usr/bin/gum \
		--no-info --no-discard-stderr \
		--version-string="$(DEB_VERSION_UPSTREAM)" \
		-n "Tool for glamorous shell scripts" > debian/gum.1
endif
