From 0cfceb976c2e18b04ebf1bd17a63e7721cc53cde Mon Sep 17 00:00:00 2001 From: Gustavo Cordova Date: Wed, 26 Aug 2020 17:26:11 -0700 Subject: [PATCH] Initial commit --- Dockerfile | 4 ++++ Makefile | 28 ++++++++++++++++++++++++++++ README.md | 12 ++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6fd06f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM alpine:3 +ARG VERSION + +RUN echo "Building: tmux v${VERSION}" >&2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..03e9941 --- /dev/null +++ b/Makefile @@ -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) diff --git a/README.md b/README.md new file mode 100644 index 0000000..242b1e5 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# static-tmux + +Build a static tmux that can be copied anywhere. + +## Usage + +Run `make` for a usage display: + +```shell +$ make +``` +