-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (50 loc) · 2.19 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
src = .
flags = -race -tags sdnotify
clean:
rm -f coord-server
rm -f device-client
rm -f gen-keys
coord-server:
go build ${flags} ${src}/cmd/coord-server
device-client:
go build ${flags} ${src}/cmd/device-client
gen-keys:
go build ${flags} ${src}/cmd/gen-keys
install-coord: coord-server
install -m 755 -o root -g root coord-server ${pkgdir}/usr/bin/qrystal-coord-server
#
mkdir -p ${pkgdir}/etc/qrystal-coord/
install ${src}/config/coord-server-config.json ${pkgdir}/etc/qrystal-coord/config.json
chown root:root -R ${pkgdir}/etc/qrystal-coord/
chmod ugo+rX -R ${pkgdir}/etc/qrystal-coord/
#
mkdir -p ${pkgdir}/usr/lib/systemd/system
install ${src}/config/coord-server.service ${pkgdir}/usr/lib/systemd/system/qrystal-coord-server.service
systemctl daemon-reload
uninstall-coord:
rm ${pkgdir}/usr/bin/qrystal-coord-server
rm ${pkgdir}/etc/qrystal-coord
rm ${pkgdir}/usr/lib/systemd/system/qrystal-coord-server.service
install-device: device-client
install -m 755 -o root -g root device-client ${pkgdir}/usr/bin/qrystal-device-client
mkdir -p ${pkgdir}/usr/lib/sysusers.d
install -m 644 ${src}/config/sysusers-device.conf ${pkgdir}/usr/lib/sysusers.d/qrystal-device.conf
systemctl restart systemd-sysusers
#
mkdir -p ${pkgdir}/etc/qrystal-device/
chown root:qrystal-device ${pkgdir}/etc/qrystal-device/
chmod 755 ${pkgdir}/etc/qrystal-device/
install -m 640 -o root -g qrystal-device ${src}/config/device-client-config.json ${pkgdir}/etc/qrystal-device/client-config.json
install -m 640 -o root -g qrystal-device ${src}/config/device-dns-config.json ${pkgdir}/etc/qrystal-device/dns-config.json
#
mkdir -p ${pkgdir}/usr/lib/systemd/system
install ${src}/config/device-client.service ${pkgdir}/usr/lib/systemd/system/qrystal-device-client.service
systemctl daemon-reload
uninstall-device:
rm ${pkgdir}/usr/bin/qrystal-device-client
rm ${pkgdir}/usr/bin/qrystal-device-dns
rm ${pkgdir}/usr/lib/sysusers.d/qrystal-device.conf
rm ${pkgdir}/usr/lib/systemd/system/qrystal-device-client.service
rm ${pkgdir}/usr/lib/systemd/system/qrystal-device-dns.service
rm ${pkgdir}/usr/lib/systemd/system/qrystal-device-dns.socket
.PHONY: clean install-coord uninstall-coord install-device uninstall-device