diff options
author | Ueda Naoaki <nao@uedder.com> | 2023-02-01 22:13:58 +0900 |
---|---|---|
committer | Ueda Naoaki <nao@uedder.com> | 2023-02-02 00:17:32 +0900 |
commit | 6cc3dd2648af19a110872b09eddb58b775e38b2a (patch) | |
tree | 85f3443d06dbab7c5c419c20edf4b9f9e4ba2dca | |
parent | 62ccceb58e15fa73db83811a3276a207235a1df4 (diff) | |
download | asustor-nas-tailscale-installer-6cc3dd2648af19a110872b09eddb58b775e38b2a.tar.gz asustor-nas-tailscale-installer-6cc3dd2648af19a110872b09eddb58b775e38b2a.tar.bz2 asustor-nas-tailscale-installer-6cc3dd2648af19a110872b09eddb58b775e38b2a.zip |
Refactoring a process to install
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 25 |
2 files changed, 17 insertions, 10 deletions
@@ -3,3 +3,5 @@ custom.mk S??tailscale tailscale tailscaled +ver +downloaded @@ -25,18 +25,23 @@ install: tailscaled tailscale install.sh | $(init_file) $(init_file): SXXtailscale.template cp -a $< $@ -tailscale tailscaled: $(tailscale.tgz) - tar --strip-components 1 -xmvzf $< $(basename $<)/$@ +tailscale tailscaled: downloaded + tar --strip-components 1 -xmvzf $(tailscale.tgz) $(basename $(tailscale.tgz))/$@ -$$(tailscale.tgz): +ver: + curl -s https://api.github.com/repos/tailscale/tailscale/releases/latest | perl -nle '/"name":\s*"(.+)"/ and print $$1' > $@ + +.PHONY: ver-updated +ver-updated: + $(MAKE) --always-make ver + +TGZ_URL = https://pkgs.tailscale.com/stable/tailscale_$(shell cat ver 2> /dev/null || printf '<ver>')_arm64.tgz +tailscale.tgz = $(notdir $(TGZ_URL)) + +downloaded: ver curl -L $(TGZ_URL) -O + touch $@ .PHONY: clean clean: - rm -f *.tgz $(init_file) tailscale tailscaled - -.SECONDEXPANSION: -# default is latest -VER ?= $(shell curl -s https://api.github.com/repos/tailscale/tailscale/releases/latest | perl -nle '/"name":\s*"(.+)"/ and print $$1') -TGZ_URL = https://pkgs.tailscale.com/stable/tailscale_$(VER)_arm64.tgz -tailscale.tgz = $(notdir $(TGZ_URL)) + rm -f *.tgz $(init_file) tailscale tailscaled ver downloaded |