Added PyPi to local installer

This commit is contained in:
Geoffrey Frogeye 2015-10-09 23:29:27 +02:00
parent a1fedcb5c0
commit 59b07f768b

View file

@ -16,6 +16,7 @@ export LD_LIBRARY_PATH="$LOCINST_DIR/lib:$LOCINST_DIR/usr/lib:$LD_LIBRARY_PATH"
# Dir set # Dir set
if [ ! -d "$LOCINST_DIR" ]; then if [ ! -d "$LOCINST_DIR" ]; then
mkdir -p "$LOCINST_DIR" mkdir -p "$LOCINST_DIR"
# TODO Add symbolic links and stuff
fi fi
if [ ! -d "$LOCINST_TMP" ]; then if [ ! -d "$LOCINST_TMP" ]; then
mkdir -p "$LOCINST_TMP" mkdir -p "$LOCINST_TMP"
@ -105,6 +106,22 @@ function locinst_arch {
return 0 return 0
} }
function locinst_pypi {
dest=$1
shift
tar=$LOCINST_TMP/$1.tar.gz
char=`echo $1 | cut -c1-1`
wget "https://pypi.python.org/packages/source/$char/$1/$1-$2.tar.gz" -O $tar --no-check-certificate
preinst=$LOCINST_TMP/$1-$2/
tar xf $tar -C $LOCINST_TMP
mkdir -p $dest/lib/python
export PYTHONPATH="$dest/lib/python:$PYTHONPATH"
(cd $preinst; python3 setup.py install --home=$dest)
rm -rf $tar $preinst
}
# Master function # Master function
function locinst { # action package [other_info]* function locinst { # action package [other_info]*
@ -135,6 +152,10 @@ function locinst { # action package [other_info]*
locinst_arch $dest $package $* locinst_arch $dest $package $*
code=$? code=$?
;; ;;
"pypi")
locinst_pypi $dest $package $*
code=$?
;;
*) *)
error "I don't know what to do. And don't beg for help with the commands." error "I don't know what to do. And don't beg for help with the commands."
return 1 return 1