#! /usr/bin/make -f

VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
SHIM_VERSION := $(shell dpkg-query -f '$${Version}\n' -W shim-unsigned)

include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_HOST_ARCH),amd64)
export EFI_ARCH := x64
endif
ifeq ($(DEB_HOST_ARCH),arm64)
export EFI_ARCH := aa64
endif
ifeq ($(DEB_HOST_ARCH),i386)
export EFI_ARCH := ia32
endif

%:
	dh $@

docdir := debian/shim-signed-common/usr/share/doc/shim-signed-common

override_dh_installchangelogs:
	dh_installchangelogs -p shim-signed-common

override_dh_installdocs:
	dh_installdocs -p shim-signed-common
	dh_installdocs --remaining-packages --link-doc=shim-signed-common

override_dh_installdebconf:
	dh_installdebconf -p shim-signed-common

override_dh_gencontrol:
	dh_gencontrol -- -v$(VERSION)+$(SHIM_VERSION) \
		-Vshim:Version=$(SHIM_VERSION)
