Commit 8d60b3ea authored by seth's avatar seth

install path fixes. default config set with $USER first in path

parent 3e9d29ef
#!/usr/bin/env python
#!/usr/bin/env python3
# by klaatu
# gpl 3 appears here
import sys
import os
import site
# Get launch script dir
launch_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
#print("Launch script dir: ", launch_dir)
PYTHONDIR = site.getsitepackages()[0]
# Update sys.path to include modules
d = 'planterlibs'
if launch_dir == "/usr/bin":
print("Running from installation...")
modules_path = "/usr/lib64/python2.7/site-packages/" + d
modules_path = PYTHONDIR + '/' + d
else:
print("Running from filesystem...")
modules_path = launch_dir + "/usr/share/pyshared/" + d
......@@ -24,7 +28,6 @@ try:
import app
except Exception:
print("Failed to import module app.py to launch Planter")
print("ERROR: " + err)
print("Installation was assumed to be at:", modules_path)
sys.exit(1)
......
#!/bin/sh
# Slackware build script for Planter
# Copyright 2014 Klaatu @member.fsf.org
# Copyright 2014-7 Klaatu @member.fsf.org
# GNU All-Permissive License
# Copying and distribution of this file, with or without modification,
......@@ -9,10 +9,10 @@
# without any warranty.
PRGNAM=planter
VERSION=${VERSION:-1.2}
BUILD=${BUILD:-2}
VERSION=${VERSION:-1.4}
BUILD=${BUILD:-3}
TAG=${TAG:-_SMi}
PYTHONDIR=$(python -c "import sys, os; print os.path.join('/usr/lib${LIBDIRSUFFIX}', 'python%s' % sys.version[:3], 'site-packages')")
PYTHONDIR=$(python3 -c "import site; print(site.getsitepackages()[0])")
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
......@@ -59,8 +59,8 @@ cp -rv $CWD/usr .
cp -rv $CWD/etc .
mkdir -p $PKG/usr/bin
cp -v $CWD/$PRGNAM ./usr/bin/$PRGNAM
mkdir -p $PKG/usr/lib64/python2.7/site-packages/
mv ./usr/share/pyshared/planterlibs $PKG/usr/lib64/python2.7/site-packages/
mkdir -p $PKG/$PYTHONDIR
mv ./usr/share/pyshared/planterlibs $PKG/$PYTHONDIR
sed -i "s|/usr/share/pyshared|$PYTHONDIR|" $PKG/usr/bin/$PRGNAM
......
PRGNAM="planter"
VERSION="1.2"
VERSION="1.4"
HOMEPAGE="http://slackermedia.info/planter"
DOWNLOAD="https://gitlab.com/planter/planter/repository/archive.tar.gz?ref=1.2"
DOWNLOAD="https://gitlab.com/planter/planter/repository/archive.tar.gz"
MD5SUM="theMd5SumWillFail"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
......
......@@ -28,6 +28,12 @@ def getOptions():
if not opts.get('destination'):
opts['destination'] = getcwd()
if not opts.get('config'):
try:
opts['config'] = os.path.join(os.expanduser('~') + '.config' + 'planter' + 'tree.list')
except:
opts['config'] = '/etc/planter/tree.list'
if opts.get('destination'):
opts['destination'] = expanduser(opts['destination'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment