#!/usr/bin/make -f

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

export DH_GOLANG_EXCLUDES := scripts/*
export DH_GOLANG_INSTALL_EXTRA := pkg/i18n/translations/ja.json \
                                  pkg/i18n/translations/pl.json \
                                  pkg/i18n/translations/ru.json \
                                  pkg/i18n/translations/ko.json \
                                  pkg/i18n/translations/pt.json \
                                  pkg/i18n/translations/zh-CN.json \
                                  pkg/i18n/translations/nl.json \
                                  pkg/i18n/translations/zh-TW.json
export DH_GOLANG_BUILDPKG := github.com/jesseduffield/lazygit

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

override_dh_auto_build:
	dh_auto_build -- \
		-buildmode=pie \
		-ldflags="-extldflags -Wl,-z,now \
			-X main.version='$(DEB_VERSION)' \
			-X main.buildSource='debian'"

override_dh_auto_install:
	dh_auto_install -- --no-source
