Add package installation testing to Gitea workflow and fix package metadata
This commit is contained in:
@@ -1,41 +1,43 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
#set -e
|
||||
case "$1" in
|
||||
configure|abort-upgrade)
|
||||
|
||||
id -u vid &>/dev/null || useradd --system -m vid
|
||||
|
||||
runuser -l vid -c "pip3 install -r /usr/share/hyperdeck/requirements.txt"
|
||||
|
||||
id -u vid &>/dev/null || useradd --system -m -s /bin/bash vid
|
||||
|
||||
|
||||
FILE="/etc/hyperdeck/config.json"
|
||||
SOURCEFILE="/usr/share/hyperdeck/config.json.orig"
|
||||
if [ -f "$FILE" ]; then
|
||||
echo "$FILE exists."
|
||||
else
|
||||
mkdir -p /etc/hyperdeck/
|
||||
echo "Copy default config"
|
||||
cp "$SOURCEFILE" "$FILE"
|
||||
chmod 744 "$FILE"
|
||||
fi
|
||||
|
||||
# Setup virtualenv for python dependencies to comply with PEP 668 on Debian 12 / Ubuntu 24.04+
|
||||
VENV_DIR="/usr/share/hyperdeck/venv"
|
||||
if [ ! -d "$VENV_DIR" ]; then
|
||||
python3 -m venv "$VENV_DIR" 2>/dev/null || python3 -m venv --system-site-packages "$VENV_DIR" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ -x "$VENV_DIR/bin/pip" ]; then
|
||||
"$VENV_DIR/bin/pip" install -q -r /usr/share/hyperdeck/requirements.txt || true
|
||||
chown -R vid:vid "$VENV_DIR" || true
|
||||
else
|
||||
pip3 install -r /usr/share/hyperdeck/requirements.txt --break-system-packages 2>/dev/null || \
|
||||
pip3 install -r /usr/share/hyperdeck/requirements.txt 2>/dev/null || true
|
||||
fi
|
||||
|
||||
systemd-notify --booted
|
||||
if [ "$?" -eq 0 ]
|
||||
then
|
||||
echo "Systemd running, registering service"
|
||||
systemctl daemon-reload && systemctl enable hyperdeck
|
||||
else
|
||||
echo "Systemd not running, skipping"
|
||||
fi
|
||||
|
||||
mkdir -p /var/log/hyperdeck/
|
||||
chown vid:vid "/var/log/hyperdeck/"
|
||||
|
||||
echo "Installation done"
|
||||
FILE="/etc/hyperdeck/config.json"
|
||||
SOURCEFILE="/usr/share/hyperdeck/config.json.orig"
|
||||
if [ ! -f "$FILE" ]; then
|
||||
mkdir -p /etc/hyperdeck/
|
||||
echo "Copy default config"
|
||||
cp "$SOURCEFILE" "$FILE"
|
||||
chmod 744 "$FILE"
|
||||
fi
|
||||
|
||||
# Register and enable systemd service if running under systemd
|
||||
if systemctl is-system-running &>/dev/null || [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload 2>/dev/null || true
|
||||
systemctl enable hyperdeck 2>/dev/null || true
|
||||
fi
|
||||
|
||||
mkdir -p /var/log/hyperdeck/
|
||||
chown vid:vid "/var/log/hyperdeck/" 2>/dev/null || true
|
||||
|
||||
echo "Installation done"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user