Initial commit

This commit is contained in:
2020-08-26 17:26:11 -07:00
commit 0cfceb976c
3 changed files with 44 additions and 0 deletions

4
Dockerfile Normal file
View File

@@ -0,0 +1,4 @@
FROM alpine:3
ARG VERSION
RUN echo "Building: tmux v${VERSION}" >&2

28
Makefile Normal file
View 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)

12
README.md Normal file
View File

@@ -0,0 +1,12 @@
# static-tmux
Build a static tmux that can be copied anywhere.
## Usage
Run `make` for a usage display:
```shell
$ make
```