forked from MayaPosch/NymphCast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·66 lines (54 loc) · 1.92 KB
/
setup.sh
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
#!/bin/sh
# Compilation script for the NymphCast server
echo "UPDATE: $UPDATE"
echo "PACKAGE: $PACKAGE"
# Install the dependencies.
if [ -x "$(command -v apt)" ]; then
sudo apt update
sudo apt -y install libsdl2-image-dev libsdl2-dev libpoco-dev libswscale-dev libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev libpostproc-dev libswresample-dev
elif [ -x "$(command -v apk)" ]; then
sudo apk update
sudo apk add poco-dev sdl2-dev sdl2_image-dev ffmpeg-dev openssl-dev
fi
if [ ! -z "${UPDATE}" ]; then
if [ -f "/usr/local/lib/libnymphrpc.a" ]; then
sudo rm /usr/local/lib/libnymphrpc.a
sudo rm -rf /usr/local/include/nymph
fi
fi
if [ -f "/usr/local/lib/libnymphrpc.a" ]; then
echo "NymphRPC library found in /usr/local/lib. Skipping installation."
else
# Obtain current version of NymphRPC
git clone --depth 1 https://github.com/MayaPosch/NymphRPC.git
# Build NymphRPC and install it.
echo "Installing NymphRPC..."
make -C NymphRPC/ lib
sudo mkdir -p /usr/local/include/nymph
sudo cp NymphRPC/src/*.h /usr/local/include/nymph/.
sudo chmod 766 /usr/local/include/nymph/*
sudo cp NymphRPC/lib/libnymphrpc.a /usr/local/lib/.
sudo cp NymphRPC/lib/libnymphrpc.so.* /usr/lib/.
sudo chmod 766 /usr/local/lib/libnymphrpc.a
sudo chmod 766 /usr/lib/libnymphrpc.so*
fi
# Remove NymphRPC folder.
rm -rf NymphRPC
# Build NymphCast server.
if [ -f "src/server/bin/nymphcast_server" ]; then
rm src/server/bin/nymphcast_server
fi
make -C src/server/ clean
make -C src/server/
# Copy the wallpaper files into the bin folder.
mkdir -p src/server/bin/wallpapers
cp src/server/*.jpg src/server/bin/wallpapers/.
# Copy the configuration file into the bin folder.
cp src/server/*.ini src/server/bin/.
# Copy the NymphCast apps into the bin folder.
cp -r src/server/apps src/server/bin/.
if [ ! -z "${PACKAGE}" ]; then
# Package into a tar.gz
echo "Packaging into tar.gz file."
tar -czC src/server/bin -f nymphcast_server.tar.gz .
fi