Files
kata-containers/obs-packaging/runtime/debian.rules-template
Jose Carlos Venegas Munoz 6396e7c6d6 pkgs: Add commit to build.
We dont have commit when we build the pkg.
Lets define the COMMIT variable to kwnow the commit from each project.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-07-04 14:30:41 -05:00

43 lines
1.2 KiB
Makefile

#!/usr/bin/make -f
export DH_VERBOSE = 1
export PKG_NAME=kata-runtime
export DOMAIN=github.com
export ORG=kata-containers
export PROJECT=runtime
export IMPORTNAME=$(DOMAIN)/$(ORG)/$(PROJECT)
export DH_GOPKG:=$(IMPORTNAME)
export DEB_BUILD_OPTIONS=nocheck
export PATH:=/usr/src/packages/BUILD/local/go/bin:$(PATH)
export GOPATH=/usr/src/packages/BUILD/go
export GOROOT=/usr/src/packages/BUILD/local/go
export DH_OPTIONS
export DEFAULT_QEMU=qemu-lite-system-x86_64
GO_VERSION=@GO_VERSION@
%:
dh $@
override_dh_auto_clean:
override_dh_auto_build:
mkdir -p /usr/src/packages/BUILD/local/
mkdir -p /usr/src/packages/BUILD/go/src/$(DOMAIN)/$(ORG)/
tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /usr/src/packages/BUILD/local
ln -s /usr/src/packages/BUILD /usr/src/packages/BUILD/go/src/$(IMPORTNAME)
cd $(GOPATH)/src/$(IMPORTNAME)/; \
make QEMUPATH=/usr/bin/$(DEFAULT_QEMU) COMMIT=@HASH@
override_dh_auto_install:
mkdir -p debian/$(PKG_NAME)
cd $(GOPATH)/src/$(IMPORTNAME)/; \
make install \
DESTDIR=$(shell pwd)/debian/$(PKG_NAME)/ \
PREFIX=/usr \
COMMIT=@HASH@ \
QEMUPATH=/usr/bin/$(DEFAULT_QEMU)
sed -i -e '/^initrd =/d' $(shell pwd)/debian/$(PKG_NAME)/usr/share/defaults/kata-containers/configuration.toml