forked from loki-47-6F-64/sunshine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen-deb.in
executable file
·76 lines (60 loc) · 1.78 KB
/
gen-deb.in
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
#!/bin/sh
if [ ! "@SUNSHINE_UNDEFINED_VARIABLE@" = "" ]; then
echo "Please run gen-deb generated by cmake inside the build directory"
exit 1
fi
if [ -d package-deb ]; then
echo "package-deb already exists: It will be replaced"
rm -rf package-deb
fi
export DEBIAN=package-deb/sunshine/DEBIAN
export RULES=package-deb/sunshine/etc/udev/rules.d
export BIN=package-deb/sunshine/usr/bin
export ASSETS=package-deb/sunshine/etc/sunshine
mkdir -p $DEBIAN
mkdir -p $RULES
mkdir -p $BIN
mkdir -p $ASSETS
if [ ! -f sunshine ]; then
echo "Error: Can't find sunshine"
exit 1
fi
cat << 'EOF' > $DEBIAN/conffiles
/etc/sunshine/sunshine.conf
/etc/sunshine/apps_linux.json
EOF
cat << 'EOF' > $DEBIAN/control
Package: sunshine
Architecture: amd64
Maintainer: @loki
Priority: optional
Version: 0.2.1
Depends: libssl1.1, libavdevice58, libboost-thread1.71.0, libboost-filesystem1.71.0, libboost-log1.71.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0
Description: Gamestream host for Moonlight
EOF
cat << 'EOF' > $DEBIAN/postinst
#!/bin/sh
export GROUP_INPUT=input
if [ -f /etc/group ]; then
if ! grep -q $GROUP_INPUT /etc/group; then
echo "Creating group $GROUP_INPUT"
groupadd $GROUP_INPUT
fi
else
echo "Warning: /etc/group not found"
fi
EOF
cat << 'EOF' > $RULES/85-sunshine-rules.rules
KERNEL=="uinput", GROUP="input", MODE="0660"
EOF
cp sunshine $BIN/sunshine
cp @CMAKE_CURRENT_SOURCE_DIR@/assets/apps_linux.json $ASSETS/apps_linux.json
cp @CMAKE_CURRENT_SOURCE_DIR@/assets/sunshine.conf $ASSETS/sunshine.conf
chmod 755 $DEBIAN/postinst
chmod 755 $BIN/sunshine
chmod 644 $RULES/85-sunshine-rules.rules
cd package-deb
if fakeroot dpkg-deb --build sunshine; then
echo "generated debian package: @CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine.deb"
fi
cd ..