-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
79 lines (67 loc) · 2.65 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
72
73
74
75
76
77
78
79
DESTDIR?=
PREFIX?=/usr/local/dowse
CONFDIR?=/etc/dowse
THREADS?=1
include config.mk
all: config sources
@echo
@echo "Dowse is compiled and ready to run"
@echo "setup conf/settings and launch ./start.sh"
@echo "or use interactive zsh mode:"
@echo "source dowse"
@echo "dowse-start"
@echo "dowse-[tab] for completion of other commands"
@echo
config:
@echo "configuring environment for the calling user: ${DOWSE_USER} and home: ${DOWSE_HOME}"
@mkdir -p build/bin
@mkdir -p build/db
sources:
THREADS=${THREADS} make -C src
clean:
@rm -rf build
make -C src clean
install-zlibs:
make -C zlibs install
make -C daemons install
make -C zuper install
install: install-zlibs
install -d ${DESTDIR}${PREFIX}
install -d ${DESTDIR}${PREFIX}/bin
install -p -m 644 dowse ${DESTDIR}${PREFIX}/zshrc
install -p -m 755 pendulum ${DESTDIR}${PREFIX}/bin/pendulum
make -C src install
install -d ${DESTDIR}${PREFIX}/webui2
cp -ra src/webui2/* ${DESTDIR}${PREFIX}/webui2/
install -d ${DESTDIR}${CONFDIR}
install -d ${DESTDIR}${CONFDIR}/blocklists
install -p -m 644 conf/settings.dist ${DESTDIR}${CONFDIR}/settings.dist
install -p -m 644 conf/network.dist ${DESTDIR}${CONFDIR}/network.dist
install -p -m 644 conf/blocklists/* ${DESTDIR}${CONFDIR}/blocklists
@modules/install.sh ${DESTDIR}${CONFDIR}
install -d ${DESTDIR}${PREFIX}/db
install -p -m 644 build/db/*.zkv ${DESTDIR}${PREFIX}/db
install -p -m 644 build/db/*.idx ${DESTDIR}${PREFIX}/db
install -p -m 755 build/bin/* ${DESTDIR}${PREFIX}/bin
install -d ${DESTDIR}/usr/share/nmap
install -p -m 644 build/nmap-mac ${DESTDIR}/usr/share/nmap/nmap-mac-prefixes
./set_privileges.sh ${DESTDIR}${PREFIX}
install -s -p -m 6755 build/sup ${DESTDIR}${PREFIX}/bin
install -d ${DESTDIR}${PREFIX}/lib/dnscrypt-proxy
install -s -p -m 644 src/dnscrypt-plugin/.libs/dnscrypt_dowse.so ${DESTDIR}${PREFIX}/lib/dnscrypt-proxy
chown -R ${DOWSE_USER}:${DOWSE_USER} ${DESTDIR}${DOWSE_HOME}/.dowse
install-node-red:
install -d ${DESTDIR}${PREFIX}/node-red
cp -ra build/node-red/* ${DESTDIR}${PREFIX}/node-red
install -d ${DESTDIR}${PREFIX}/nodejs
cp -ra build/nodejs/* ${DESTDIR}${PREFIX}/nodejs
# here sup is installed with suid bit. sup is a secure application we
# use for privilege escalation when needed. sup executes only certain
# binaries on a fixed path and they must match a sha256 hash which is
# compiled in. for more information see: https://github.com/dyne/sup
# to see what binaries are compiled in, do `sup -l`
uninstall:
rm -rf ${DESTDIR}${CONFDIR}
rm -rf ${DESTDIR}${PREFIX}
rm -rf ${DESTDIR}${DOWSE_HOME}/.dowse/*
.PHONY: all config sources clean install uninstall