Files
docker-cli/components/packaging/deb/Makefile
Sebastiaan van Stijn 3d7a0f54f5 Bump Golang to 1.10.3
go1.10.3 (released 2018/06/05) includes fixes to the go command, and the
crypto/tls, crypto/x509, and strings packages. In particular, it adds minimal
support to the go command for the vgo transition. See the Go 1.10.3 milestone
on our issue tracker for details;
https://github.com/golang/go/issues?q=milestone%3AGo1.10.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 65fc4f1c0cc81739df97605f1fbf91dbf2e7739f
Component: packaging
2018-06-11 10:35:39 -07:00

98 lines
2.7 KiB
Makefile

SHELL:=/bin/bash
ARCH:=$(shell uname -m)
ENGINE_DIR:=$(CURDIR)/../../engine
CLI_DIR:=$(CURDIR)/../../cli
GITCOMMIT?=$(shell cd $(ENGINE_DIR) && git rev-parse --short HEAD)
VERSION?=0.0.0-dev
GO_VERSION:=1.10.3
DEB_VERSION=$(shell ./gen-deb-ver $(ENGINE_DIR) "$(VERSION)")
CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown
EPOCH?=
BUILD=docker build --build-arg GO_VERSION=$(GO_VERSION) -t debbuild-$@/$(ARCH) -f $(CURDIR)/$@/Dockerfile.$(ARCH) .
RUN=docker run --rm -i \
-e EPOCH='$(EPOCH)' \
-e DEB_VERSION=$(DEB_VERSION) \
-e VERSION=$(VERSION) \
-e DOCKER_GITCOMMIT=$(GITCOMMIT) \
-v $(CURDIR)/debbuild/$@:/build \
-v $(ENGINE_DIR):/engine \
-v $(CLI_DIR):/cli \
-v $(CURDIR)/systemd:/root/build-deb/systemd \
debbuild-$@/$(ARCH)
.PHONY: help
help: ## show make targets
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: clean
clean: ## remove build artifacts
[ ! -d debbuild ] || $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild
$(RM) -r debbuild
.PHONY: deb
deb: ubuntu debian raspbian ## build all deb packages
.PHONY: ubuntu
ubuntu: ubuntu-bionic ubuntu-artful ubuntu-xenial ubuntu-trusty ## build all ubuntu deb packages
.PHONY: debian
debian: debian-stretch debian-jessie ## build all debian deb packages
.PHONY: raspbian
raspbian: raspbian-stretch debian-jessie ## build all raspbian deb packages
.PHONY: ubuntu-xenial
ubuntu-xenial: ## build ubuntu xenial deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: ubuntu-trusty
ubuntu-trusty: ## build ubuntu trusty deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: ubuntu-artful
ubuntu-artful: ## build ubuntu artful deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: ubuntu-bionic
ubuntu-bionic: ## build ubuntu bionic deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-buster
debian-buster: ## build debian buster deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-jessie
debian-jessie: ## build debian jessie deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-stretch
debian-stretch: ## build debian stretch deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: raspbian-jessie
raspbian-jessie: ## build raspbian jessie deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: raspbian-stretch
raspbian-stretch: ## build raspbian stretch deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@