Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
81 lines
1.8 KiB
81 lines
1.8 KiB
#! /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/ |
|
|
|
piplayer_config=../config.json |
|
|
|
function help () |
|
{ |
|
echo "Usage: bash setup.sh (install|prepare|doc)" |
|
echo "----" |
|
echo " * install: copies dbuscontrol.sh and PiPlayer to a common place (needs root)" |
|
echo " * prepare: install prerequisites (pyFLTK); GCC required" |
|
echo " * doc: generate doxygen documentation from the sources" |
|
} |
|
|
|
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 -r * $piplayer |
|
fi |
|
|
|
echo "dbusconfig=\"$dbusconfig\" |
|
configfile=\"$piplayer_config\"" > src/config.py |
|
;; |
|
# 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 |
|
bash setup.sh livestreamer |
|
;; |
|
# install only the livestreamer python-skript |
|
livestreamer) |
|
sudo pip install livestreamer |
|
;; |
|
# create documentation from the python doxygen comments |
|
doc) |
|
mkdir doc |
|
doxygen Doxyfile |
|
;; |
|
*) |
|
help |
|
;; |
|
esac
|
|
|