父節點
d0d2dce743
當前提交
a9098a3b3e
@ -0,0 +1,4 @@ |
||||
from fltk import * |
||||
|
||||
def main () : |
||||
return 0; |
@ -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 |
Reference in new issue