File debian.rules of Package ksm-throttler

#!/usr/bin/make -f

DOMAIN     = github.com
ORG        = kata-containers
PROJECT    = ksm-throttler
IMPORTNAME = $(DOMAIN)/$(ORG)/$(PROJECT)
GO_VERSION = 1.12.3

export DH_VERBOSE=1
export DH_GOPKG:=$(DOMAIN)/$(ORG)/$(PROJECT)
export DEB_BUILD_OPTIONS=nocheck
export GOPATH=/usr/src/packages/BUILD/go
export GOROOT=/tmp/local/go
export PATH:=/tmp/local/go/bin:$(PATH)
export DH_OPTIONS

%:
	dh $@

override_dh_auto_build:
	mkdir -p /tmp/local/
	mkdir -p /usr/src/packages/BUILD/go/src/$(DOMAIN)/$(ORG)
	tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-amd64.tar.gz -C /tmp/local
	ln -s /usr/src/packages/BUILD /usr/src/packages/BUILD/go/src/$(IMPORTNAME)
	cd $(GOPATH)/src/$(IMPORTNAME); \
	make \
		COMMIT=783bb88 \
		TARGET=kata-ksm-throttler

override_dh_auto_install:
	mkdir -p debian/$(PROJECT)
	cd $(GOPATH)/src/$(IMPORTNAME); \
	make install \
		COMMIT=783bb88 \
		DESTDIR=$(shell pwd)/debian/kata-ksm-throttler \
		TARGET=kata-ksm-throttler