-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (55 loc) · 1.75 KB
/
Makefile
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -----------------------------------------------------------------------------
# MAKEFILE RUNNING COMMAND
# -----------------------------------------------------------------------------
# Author : Dwi Fahni Denni (@zeroc0d3)
# Repository : https://github.com/zeroc0d3/multivpn.git
# License : Apache License, version 2
# -----------------------------------------------------------------------------
# Notes:
# use [TAB] instead [SPACE]
VERSION=1.0.1
PATH_FOLDER=`pwd`
DEFAULT_KEYS_VPN='/opt/multivpn/keys/default.ovpn'
#---------------------------------
# Cleanup all binary
#---------------------------------
clean:
@rm -rf ./bin
@rm -rf ./build
#---------------------------------
# Installation
#---------------------------------
install:
@sudo apt install -y openvpn network-manager-openvpn network-manager-openvpn-gnome
@make setup
setup:
@sudo mkdir -p /var/log/multivpn
@sudo touch /var/log/multivpn/multivpn.log
@sudo chmod -R 777 /var/log/multivpn
@sudo mkdir -p /opt/multivpn/config
@sudo mkdir -p /opt/multivpn/keys
@sudo chmod -R 777 /opt/multivpn
@go get github.com/laher/goxc
develop:
@make setup
@cp ./keys/auth.txt /opt/multivpn/keys/auth.txt
@cp ./src/config/*.yaml /opt/multivpn/config
@sudo chmod -R 777 /opt/multivpn
#---------------------------------
# Running with 'default.ovpn' key
#---------------------------------
run:
@.${PATH_FOLDER}/bin/multivpn ${DEFAULT_KEYS_VPN}
#---------------------------------
# Build binary for 'multivpn'
#---------------------------------
build:
@$(GOPATH)/bin/goxc \
-bc="darwin,amd64" \
-pv=$(VERSION) \
-d=build \
-build-ldflags "-X main.VERSION=$(VERSION)"
@go build -o ./bin/multivpn ${PATH_FOLDER}/main.go
@sudo chmod +x ${PATH_FOLDER}/bin/multivpn
version:
@echo $(VERSION)