From 0fc638e7c231c9024664bd51e990a597121f04c0 Mon Sep 17 00:00:00 2001 From: kaliko Date: Wed, 8 Jan 2014 21:12:46 +0100 Subject: [PATCH] Improved virtualenv install helper --- INSTALL | 11 ++++++++--- vinstall.sh | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/INSTALL b/INSTALL index 1ef95d1..337766e 100644 --- a/INSTALL +++ b/INSTALL @@ -1,12 +1,17 @@ Virtualenv installation: Run ./vinstall.sh to generate the python virtualenv and install requirements. -You might specify a python3 interpreter if the binary name defers from python3.3 : - - PY3=/usr/bin/python ./vinstall.sh +Default looks for python3 on the system. +It will setup a virtualenv within a "venv" directory (same level as vinstall.sh file). It should also write a shell wrapper to run mpd-sima within the virtualenv. ./vmpd-sima --help +You might specify a python3 interpreter if the binary name differs from python3: + + PY3=/usr/bin/python ./vinstall.sh + +You can locate the virtalenv somewhere else: + INSTALL_DIR=/tmp/crap_test/ ./vinstall.sh diff --git a/vinstall.sh b/vinstall.sh index 143e885..b90dbbb 100755 --- a/vinstall.sh +++ b/vinstall.sh @@ -37,21 +37,26 @@ PIP_OPTIONS="" pip $PIP_OPTIONS install --pre python-musicpd || exit 1 -echo Installing mpd-siuma +echo Installing mpd-sima $(dirname $0)/setup.py --quiet install || exit 1 deactivate SIMA_LAUNCHER=mpd-sima -SIMA_VLAUNCHER=$(readlink -f $(dirname $0))/vmpd-sima +SIMA_VLAUNCHER=$INSTALL_DIR/vmpd-sima -cat << EOF > $SIMA_VLAUNCHER +cat << EOF > "$SIMA_VLAUNCHER" #!/bin/sh . $INSTALL_DIR/venv/bin/activate $SIMA_LAUNCHER "\$@" EOF chmod +x $SIMA_VLAUNCHER +echo Cleaning up +rm -rf $(dirname $0)/dist +rm -rf $(dirname $0)/build +rm -rf $(dirname $0)/sima.egg-info + echo # vim: fileencoding=utf8 -- 2.39.2