-
Notifications
You must be signed in to change notification settings - Fork 0
/
tool.mk
44 lines (34 loc) · 1.28 KB
/
tool.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
INSTALL_PATH := $(if $(INSTALL_PATH),$(INSTALL_PATH),/usr/local/bin)
STAGEDIR := $(STAGE)/$(INSTALL_PATH)
all: config special build strip sign post
raw: all upload inject run
do: all deb install inject run
# ln -rs important as I want it to be relative
post:
@echo "$(arrow)$(green)Staging package dirs$(end)"
@if [ $(GIMME_PERM) -eq 1 ]; then\
echo "$(arrow)$(blue)Setting up /Applications hack for permissions$(end)";\
mkdir -p $(STAGE)/Applications/$(NAME).app;\
mv $(MKDIR)/$(NAME) $(STAGE)/Applications/$(NAME).app;\
ln -rsf /Applications/$(NAME).app/$(NAME) $(STAGEDIR)/$(NAME);\
cp Info.plist $(STAGE)/Applications/$(NAME).app;\
INSTALL_PATH=/Applications/$(NAME).app;\
else\
cp $(MKDIR)/$(NAME) $(STAGEDIR);\
fi;
upload:
$(REMOTETEST)
@echo "$(arrow)$(red)[WARNING] $(blue)Removing old and uploading new static binary $(red)(did you mean to run $(green)make install$(red)?)$(end)"
@$(SSH) "rm $(INSTALL_PATH)/$(NAME)" $(SHUTUP)
@$(SCP) $(MKDIR)/$(NAME) $(CLIENT):$(INSTALL_PATH)
inject:
$(REMOTETEST)
@if [ ! -z $(TRUST_BIN) ]; then\
echo "$(arrow)$(green)Injecting into trustcache$(end)"; \
$(SSH) "$(TRUST_BIN) $(INSTALL_PATH)/$(NAME) > /dev/null"; \
fi;\
run:
$(REMOTETEST)
@echo "$(arrow)$(green)Running...$(end)"
@echo ""
@$(SSH) "$(INSTALL_PATH)/$(NAME)"