From b14c1b5d6418835457b6f268be88681512e9a268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Sedl=C3=A1k?= Date: Thu, 26 May 2016 19:08:52 +0200 Subject: [PATCH] added daemon installation for Fedora user instance of systemd can handle the ytdl_server.py as daemon for us. also use virtualenv for pip installed user package to not ever clash with site-packages where all/most of things is rpm managed --- install-fedora.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 install-fedora.sh diff --git a/install-fedora.sh b/install-fedora.sh new file mode 100755 index 0000000..bdaa699 --- /dev/null +++ b/install-fedora.sh @@ -0,0 +1,38 @@ +#! /bin/bash +set -ex + +YMPV_DIR="$(readlink -f "$(dirname "$0")")" +VENV="${XDG_DATA_HOME:-$YMPV_DIR}/.youtube-mpv-venv" +CFGDIR="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user" + + +# install dependencies + +if ! (which pip && which virtualenv) > /dev/null; then + sudo dnf install -y python-pip python-virtualenv +fi +[[ -e "$VENV/bin/activate" ]] || virtualenv "$VENV" +source "$VENV/bin/activate" +python -m youtube_dl --help &> /dev/null || pip install youtube_dl + + +# register as systemd service + +mkdir -p "$CFGDIR" +cat > "$CFGDIR/youtube-mpv.service" <