-
Notifications
You must be signed in to change notification settings - Fork 111
/
Makefile
71 lines (60 loc) · 2.6 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
64
65
66
67
68
69
70
71
os_name = "$(shell cat /etc/os-release | grep "^ID=" | cut -d = -f 2)"
all: build install
clean:
rm -rf bin
uninstall:
# Remove config files
rm -rf /etc/anonsurf/
# Remove daemon scripts and some other binaries
rm -rf /usr/lib/anonsurf/
# Remove binaries
rm /usr/bin/anonsurf
rm /usr/bin/anonsurf-gtk
# Remove systemd unit
rm /lib/systemd/system/anonsurfd.service
# Remove launchers
rm /usr/share/applications/anonsurf*.desktop
build-parrot:
# Compile binary on parrot's platform. libnim-gintro-dev is required.
# Gintro 0.9.8 is required
mkdir -p bin/
nim c --nimcache:/tmp --out:bin/dnstool -d:release src/nim/dnstool/dnstool.nim
nim c --nimcache:/tmp --out:bin/make-torrc -d:release src/nim/anonsurf/make_torrc.nim
nim c --nimcache:/tmp --out:bin/anonsurf-gtk -p:/usr/include/nim/ -d:release src/nim/anonsurf/AnonSurfGTK.nim
nim c --nimcache:/tmp --out:bin/anonsurf -p:/usr/include/nim/ -d:release src/nim/anonsurf/AnonSurfCli.nim
build:
# Build on other system. nimble install gintro is required
# Note: AnonSurf 3.3.2 was made with Gintro 0.9.6, and newer version comes with gintro 0.9.8 pre-release
mkdir -p bin/
nim c --out:bin/dnstool -d:release src/nim/dnstool/dnstool.nim
nim c --out:bin/make-torrc -d:release src/nim/anonsurf/make_torrc.nim
nim c --out:bin/anonsurf-gtk -d:release src/nim/anonsurf/AnonSurfGTK.nim
nim c --out:bin/anonsurf -d:release src/nim/anonsurf/AnonSurfCli.nim
install:
# Create all folders
mkdir -p $(DESTDIR)/etc/anonsurf/
mkdir -p $(DESTDIR)/usr/lib/anonsurf/
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/share/applications/
mkdir -p $(DESTDIR)/lib/systemd/system/
# Copy binaries to system
cp bin/anonsurf $(DESTDIR)/usr/bin/anonsurf
cp bin/anonsurf-gtk $(DESTDIR)/usr/bin/anonsurf-gtk
cp bin/dnstool $(DESTDIR)/usr/bin/dnstool
cp bin/make-torrc $(DESTDIR)/usr/lib/anonsurf/make-torrc
cp scripts/* $(DESTDIR)/usr/lib/anonsurf/
# Copy launchers
if [ os_name = "parrot" ]; then \
cp launchers/anon-change-identity.desktop $(DESTDIR)/usr/share/applications/; \
cp launchers/anon-surf-start.desktop $(DESTDIR)/usr/share/applications/; \
cp launchers/anon-surf-stop.desktop $(DESTDIR)/usr/share/applications/; \
cp launchers/anon-check-ip.desktop $(DESTDIR)/usr/share/applications/; \
cp launchers/anon-gui.desktop $(DESTDIR)/usr/share/applications/; \
else \
cp launchers/non-native/*.desktop $(DESTDIR)/usr/share/applications/; \
fi
# Copy configs
cp configs/bridges.txt $(DESTDIR)/etc/anonsurf/.
cp configs/onion.pac $(DESTDIR)/etc/anonsurf/.
# Copy daemon service
cp sys-units/anonsurfd.service $(DESTDIR)/lib/systemd/system/anonsurfd.service