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
|
2022-02-17 17:33:26 +01:00
|
|
|
INSTALLATION_NAME := docker-vpn
|
2021-11-28 02:53:29 +01:00
|
|
|
DOCKERFILE := Dockerfile
|
2022-02-17 17:33:26 +01:00
|
|
|
TAG = docker-vpn
|
2021-11-28 02:53:29 +01:00
|
|
|
|
|
|
|
build: build-docker $(START_SCRIPT)
|
|
|
|
|
|
|
|
build-docker: $(DOCKERFILE) start-openvpn.sh
|
2021-11-28 03:03:09 +01:00
|
|
|
docker pull alpine
|
2021-11-28 02:53:29 +01:00
|
|
|
docker build --tag=$(TAG) .
|
2021-11-28 03:03:09 +01:00
|
|
|
@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-11-28 03:03:09 +01:00
|
|
|
|
2021-12-22 17:43:14 +01:00
|
|
|
uninstall:
|
|
|
|
$(RM) $(PREFIX)/bin/$(INSTALLATION_NAME)
|
|
|
|
|
2021-12-22 17:47:16 +01:00
|
|
|
.PHONY: check shellcheck clean
|