提交 f02adbdc 编写于 作者: J jiazhiguang

add rpm target in Makefile

上级 d750d269
......@@ -4,6 +4,11 @@ ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Base path used to install.
DESTDIR ?= /usr/local
# Variables for building rpm
VERSION ?= 0.2.0
RELEASE_TARBALL_URL ?= https://github.com/alibaba/inclavare-containers/archive/v$(VERSION).tar.gz
RPMBUILD_DIR ?= /tmp/inclavare-containers/shim/rpmbuild
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
......@@ -39,7 +44,7 @@ SHIM_CGO_ENABLED ?= 0
BINARIES=$(addprefix bin/,$(COMMANDS))
.PHONY: clean all build binaries help install uninstall
.PHONY: clean all binaries help install uninstall rpm
.DEFAULT: default
all: binaries
......@@ -49,11 +54,19 @@ bin/containerd-shim-rune-v2:
@echo "bin/containerd-shim-rune-v2"
@CGO_ENABLED=${SHIM_CGO_ENABLED} GOOS=${GOOS} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-rune-v2 ./cmd/containerd-shim-rune-v2
binaries: $(BINARIES) ## build binaries
binaries: clean $(BINARIES) ## build binaries
clean: ## clean up binaries
@echo "$@"
@rm -f $(BINARIES)
@rm -fr ${RPMBUILD_DIR}
rpm:
@mkdir -p $(RPMBUILD_DIR)
@echo "%_topdir $(RPMBUILD_DIR)" >> ~/.rpmmacros
@mkdir -p $(RPMBUILD_DIR)/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
@wget -P $(RPMBUILD_DIR)/SOURCES $(RELEASE_TARBALL_URL)
$(MAKE) -C dist/centos rpm RPMBUILD_DIR=$(RPMBUILD_DIR)
install: ## install binaries
@echo "$@ $(BINARIES)"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册