Initial commit
This commit is contained in:
4
Dockerfile
Normal file
4
Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM alpine:3
|
||||
ARG VERSION
|
||||
|
||||
RUN echo "Building: tmux v${VERSION}" >&2
|
||||
28
Makefile
Normal file
28
Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
.PHONY: help build extract
|
||||
|
||||
TMUX := https://github.com/tmux/tmux.git
|
||||
LATEST = $(shell git ls-remote --tags $(TMUX) \
|
||||
| egrep 'refs/tags/[0-9]+(\.[0-9]+)+[a-z]*$$' \
|
||||
| tail -1 | cut -d/ -f3)
|
||||
|
||||
IMAGE = tmux:$(LATEST)
|
||||
|
||||
help: ## Display this help message
|
||||
@echo "Latest: $(LATEST)"
|
||||
@echo "Usage:"
|
||||
@sed -nE "s/^([^:]+):\s+##\s+(.+)$$/\tmake \\1\t- \\2/p" \
|
||||
$(lastword $(MAKEFILE_LIST))
|
||||
|
||||
build: ## Build tmux in a docker image
|
||||
docker build \
|
||||
--build-arg VERSION=$(LATEST) \
|
||||
--tag $(IMAGE) \
|
||||
--rm .
|
||||
|
||||
extract: ## Extract the binaries from the docker image
|
||||
docker run \
|
||||
-ti --rm \
|
||||
-u $(shell id -u):$(shell id -g) \
|
||||
-v $(CURDIR):/mnt/cwd \
|
||||
-w /usr/local/lib \
|
||||
$(IMAGE) tar czf /mnt/cwd/tmux_v$(LATEST).tar.gz tmux_v$(LATEST)
|
||||
Reference in New Issue
Block a user