Browse Source

added setup-file

master
Stefan Naumann 5 years ago
parent
commit
a9098a3b3e
  1. 4
      fltk_exists.py
  2. 65
      setup.sh
  3. 2
      src/piplayer.py

4
fltk_exists.py

@ -0,0 +1,4 @@
from fltk import *
def main () :
return 0;

65
setup.sh

@ -0,0 +1,65 @@
#! /bin/bash
#
# please set the folders, archive and link accordingly
# should download this file for building pyFLTK
pyFLTKFolder=pyFltk-1.3.4.1
pyFLTKFile=pyFltk-1.3.4.1_py3.tar.gz
pyFLTKLink=https://downloads.sourceforge.net/project/pyfltk/pyfltk/pyFltk-1.3.4.1/pyFltk-1.3.4.1_py3.tar.gz
# installation places for dbusconfig.sh and piplayer source files
dbusconfig=/opt/piplayerdbus.sh
piplayer=/opt/piplayer/
function help ()
{
echo "Usage: bash setup.sh [install|prepare]"
echo "----"
echo " * install: copies dbuscontrol.sh and PiPlayer to a common place (needs root)"
echo " * prepare: install prerequisites (pyFLTK); GCC required"
}
case $1 in
# install piplayer to a common place
install)
name=$(whoami)
#if [ "$name" != "root" ]
if [ 0 -eq 1 ]
then
echo "Please start as root"
echo ""
help
exit
fi
if [ ! -f $dbusconfig ]
then
cp dbusconfig.sh $dbusconfig
fi
if [ ! -f $piplayer ]
then
mkdir $piplayer
cp src/* $piplayer
fi
;;
# build and setup pyFLTK
prepare)
python fltk_exists.py &> /dev/null
val=$?
if [ $val -eq 0 ]
then
curl -L $pyFLTKLink > $pyFLTKFile
tar -xvf $pyFLTKFile
pushd .
cd $pyFLTKFolder
python setup.py build
sudo python setup.py install
popd
rm -rf $pyFLTKFolder
rm $pyFLTKFile
fi
;;
*)
help
;;
esac

2
piplayer.py → src/piplayer.py

@ -42,7 +42,7 @@ def startOMX ( argv ):
def callDBus ( param ):
try:
param.insert ( 0, "dbuscontrol.sh" );
param.insert ( 0, "/opt/dbuscontrol.sh" );
param.insert ( 0, "bash" );
out = subprocess.check_output ( param )
return out;