Files
clapper/install.sh
Rafostar f6f2a2f4e4 Add some easy way to install
I know that this should be done using some sort of build system (like meson), but the player is still far from finished and a basic install script should be sufficient for the time being, if anyone wishes to test it.
2020-09-03 11:33:42 +02:00

38 lines
879 B
Bash
Executable File

#!/bin/sh
LICENSES_DIR="/usr/local/share/licenses/clapper"
DOC_DIR="/usr/local/share/doc/clapper"
MAIN_DIR="/usr/local/share/clapper"
BIN_DIR="/usr/local/bin"
GJS_DIR="/usr/local/share/gjs-1.0"
SCRIPT_ERR="Error: this script must be"
if [ ! -d "./clapper_src" ]; then
echo "$SCRIPT_ERR run from clapper directory!" 1>&2
exit 1
elif [ "$EUID" -ne 0 ]; then
echo "$SCRIPT_ERR run as root!" 1>&2
exit 1
fi
echo "Creating directories..."
mkdir -p "$LICENSES_DIR"
mkdir -p "$DOC_DIR"
mkdir -p "$MAIN_DIR"
mkdir -p "$GJS_DIR"
mkdir -p "$BIN_DIR"
echo "Copying files..."
cp -f "./COPYING" "$LICENSES_DIR/"
cp -f "./README.md" "$DOC_DIR/"
cp -rf "./clapper_src" "$MAIN_DIR/"
cp -f "./main.js" "$MAIN_DIR/"
cp -f "./gjs-1.0/clapper.js" "$GJS_DIR/"
cp -f "./bin/clapper" "$BIN_DIR/"
echo "Creating executables..."
chmod +x "$BIN_DIR/clapper"
echo "Install finished"