docker-vpn/Makefile

37 lines
841 B
Makefile
Raw Normal View History

2021-12-22 17:34:56 +01:00
PREFIX := /usr/local
2021-11-28 02:53:29 +01:00
START_SCRIPT := start
START_SCRIPT_SRC := start.tmpl
2021-12-22 17:34:56 +01:00
INSTALLATION_NAME := docker-aria2
2021-11-28 02:53:29 +01:00
DOCKERFILE := Dockerfile
2021-12-22 17:34:56 +01:00
TAG = docker-aria2
2021-11-28 02:53:29 +01:00
build: build-docker $(START_SCRIPT)
build-docker: $(DOCKERFILE) start-openvpn.sh
docker pull alpine
2021-11-28 02:53:29 +01:00
docker build --tag=$(TAG) .
@echo "This is a marker for the docker build." > $@
2021-11-28 02:53:29 +01:00
$(START_SCRIPT): $(START_SCRIPT_SRC)
sed -e "s/{TAG}/$(TAG)/g" -e "s/{INSTALLATION_NAME}/$(INSTALLATION_NAME)/g" $< > $@
chmod +x $@
2021-12-22 17:41:41 +01:00
shellcheck.log: $(START_SCRIPT)
@echo "# Begin shellcheck log" > $@
shellcheck $< >> $@
shellcheck: shellcheck.log
2021-12-22 17:34:56 +01:00
check: shellcheck
2021-11-28 02:53:29 +01:00
clean:
2021-12-22 17:41:41 +01:00
$(RM) build-docker shellcheck.log $(START_SCRIPT)
2021-11-28 02:53:29 +01:00
2021-12-22 17:43:14 +01:00
install: check build
2021-12-22 17:34:56 +01:00
install -D --mode=755 $(START_SCRIPT) $(PREFIX)/bin/$(INSTALLATION_NAME)
2021-12-22 17:43:14 +01:00
uninstall:
$(RM) $(PREFIX)/bin/$(INSTALLATION_NAME)
2021-12-22 17:41:41 +01:00
.PHONY: check clean