#!/usr/bin/make -f

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

export DH_GOLANG_INSTALL_EXTRA := \
	typeparams/go.mod \
	# EOL

export DH_GOLANG_EXCLUDES := \
	apidiff \
	cmd \
	errors \
	x/exp/event \
	example \
	jsonrpc2 \
	shiny \
	shootout \
	slog/benchmarks/zap_benchmarks \
	slog/benchmarks/zerolog_benchmarks \
	sumdb \
	# EOL

%:
	dh $@ --builddirectory=_build

B = $(CURDIR)/debian/tmp/usr/bin
M = $(CURDIR)/debian/tmp/usr/share/man/man1

ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
execute_before_dh_installman-arch:
	mkdir -pv $(M)
	help2man --version-string="$(DEB_VERSION)" \
		--no-info --no-discard-stderr \
		--name="verifies EBNF grammar productions" \
		--output $(M)/ebnflint.1 \
		$(B)/ebnflint
endif
