echo " "
oscam restart
;;
*)
sleep 1
;;
esac
echo " "
echo "---------------------------------------------------------- ---------------------"
echo " "
else
oscam restart
fi
}
WhichRevision() {
echo "------------------------------------------------------------------ -------------"
echo ""
echo "Moechten Sie eine bestimmte svn Revisionsnummer kompilieren oder d ie aktuelle?"
echo -en "\033[1;33m[4801] | []Aktuelle \033[0m"
read key
case $key in
[0-9][0-9][0-9][0-9])
echo " "
revision_num=$key
;;
"")
revision_num=""
;;
*)
echo -e " \033[1;31mUngueltige Eingabe!\033[0m"
sleep 1 ; WhichRevision
;;
esac
echo " "
echo "------------------------------------------------------------------ -------------"
echo " "
}
#### vars
CheckInstalledFile="/tmp/.oscam_compile_check.OK"
NP_old="build-essential cmake gcc subversion libusb-dev libssl-dev tar bzip2 gzi p wget gettext"
NP1="build-essential autoconf automake cmake make patch gcc g++ pkg-config subve rsion"
NP2="libccid libtool libglib2.0-dev libssl-dev libssl0.9.8 libpcsclite1 libpcscl ite-dev libusb-dev"
NP3="gettext tar bzip2 gzip ncurses-bin flex bison wget libpng3 zlib1g-dev sudo"
needpacks=("$NP1" "$NP2" "$NP3")
oscamBUILD="oscam-svn"
WGETLOG="/tmp/.wget.log"
filedir_tmp_tool="/tmp/compile/toolchains"
filedir_tmp="/tmp/compile"
ScriptName=$(basename $0)
svnABLE="trunk"
AutoCompileIT=0
#### main
$NORM
echo "$ScriptName v$ScriptVer"
case "$1" in
[hH][eE][lL][pP]|[hH][iI][lL][fF][eE]|\?)
echo "Usage: $0"
echo "or: $0 <revision>"
echo "or: $0 -auto"
echo "or: $0 -tags"
echo "or: $0 -tags -auto"
exit 0
;;
-tag*|--tag*)
svnABLE="tags"
oscamBUILD="oscam-tags"
;;
-auto|--auto)
AutoCompileIT=1
;;
esac
case "$2" in
-auto|--auto)
AutoCompileIT=1
;;
esac
[ ! -d "$filedir_tmp" ] && mkdir -p $filedir_tmp
cd $filedir_tmp
CheckInstalledPacks
[ "$AutoCompileIT" = "0" ] && WhichRevision || revision_num=""
if [ -z "$revision_num" ]; then
if [ "$svnABLE" = "tags" ]; then
revision_num=$(svn info $svnURLtags/$svnTAGSver | grep '^Revisio n:' | sed -e 's/^Revision: //')
echo "Lade aktuelle $oscamBUILD $svnTAGSver Revision ${revision_ num}..."
svn co $svnURLtags/$svnTAGSver ${filedir_tmp}/${oscamBUILD}
if [ $? -ne "0" ]; then
echo -e " \033[1;31mVerbindungsfehler! Versuche Mirror.. \033[0m"
svn co $svnURLtags2/$svnTAGSver ${filedir_tmp}/${oscamBU ILD}
[ $? -ne "0" ] && echo -e " \033[1;31mVerbindungsfehler! Abbruch!\033[0m" && exit 1
fi
else
revision_num=$(svn info $svnURL | grep '^Revision:' | sed -e 's/ ^Revision: //')
echo "Lade aktuelle $oscamBUILD Revision ${revision_num}..."
svn co $svnURL ${filedir_tmp}/${oscamBUILD}
if [ $? -ne "0" ]; then
echo -e " \033[1;31mVerbindungsfehler! Versuche Mirror.. \033[0m"
svn co $svnURL2 ${filedir_tmp}/${oscamBUILD}
[ $? -ne "0" ] && echo -e " \033[1;31mVerbindungsfehler! Abbruch!\033[0m" && exit 1
fi
fi
else
if [ "$svnABLE" = "tags" ]; then
echo "Lade $oscamBUILD $svnTAGSver Revision ${revision_num}..."
svn co -r $revision_num $svnURLtags/$svnTAGSver ${filedir_tmp}/$ {oscamBUILD}
if [ $? -ne "0" ]; then
echo -e " \033[1;31mVerbindungsfehler! Versuche Mirror.. \033[0m"
svn co -r $revision_num $svnURLtags2/$svnTAGSver ${filed ir_tmp}/${oscamBUILD}
[ $? -ne "0" ] && echo -e " \033[1;31mVerbindungsfehler! Abbruch!\033[0m" && exit 1
fi
else
echo "Lade $oscamBUILD Revision ${revision_num}..."
svn co -r $revision_num $svnURL ${filedir_tmp}/${oscamBUILD}
if [ $? -ne "0" ]; then
echo -e " \033[1;31mVerbindungsfehler! Versuche Mirror.. \033[0m"
svn co -r $revision_num $svnURL2 ${filedir_tmp}/${oscamB UILD}
[ $? -ne "0" ] && echo -e " \033[1;31mVerbindungsfehler! Abbruch!\033[0m" && exit 1
fi
fi
fi
if [ $? -ne "0" ]; then
echo " "
echo -e " \033[1;31mVerbindungsfehler! Abbruch!\033[0m"
exit 1
fi
echo " "
if [ ! -d "${filedir_tmp}/${oscamBUILD}" ]; then
echo $ROT "ERROR: ${filedir_tmp}/${oscamBUILD} existiert nicht. Download fehlgeschlagen? Abbruch!" ; $NORM
exit 1
else
if [ "$AutoCompileIT" = "0" ]; then
echo " "
echo "Im folgenden Menue koennen Sie einstellen was OScam unters tuetzen soll "
echo "Mit der <Leer-taste> waehlen sie was aus.."
echo "Mit der <Enter-taste> bestaetigen sie.."
echo "Mit der <ESC-taste> kehren sie ein Menue zurueck.."
echo " "
read -p "Druecken Sie bitte <Enter> um fortzufahren..."
else
if [ -f "$filedir_tmp/oscam-config.h" ]; then
cp -f $filedir_tmp/oscam-config.h ${filedir_tmp}/${oscam BUILD}/
fi
fi
fi
cd ${filedir_tmp}/${oscamBUILD}
[ "$AutoCompileIT" = "0" ] && ./config.sh
echo " "
echo "Bereite ${SYSBIT}bit Kompilierung vor.."
echo " "
sleep 3
#read -p "Druecken Sie bitte <Enter> um fortzufahren..."
mkdir -p build_dir ; cd build_dir ; make clean >/dev/null 2>&1
cmake ..
echo " "
echo "Folgendes kompilieren kann einige Zeit in Anspruch nehmen... "
echo " "
[ "$AutoCompileIT" = "0" ] && read -p "Druecken Sie bitte <Enter> um fortzufahre n..."
make
if [ ! -f "$filedir_tmp/$oscamBUILD/build_dir/oscam" ]; then
echo $ROT "ERROR: compile fehlgeschlagen? Abbruch!" ; $NORM
exit 1
else
echo " "
renewbinary
sleep 1
echo " "
# beep
echo -en "\007"
echo $GRUEN "Neue ${oscamBUILD} build $revision_num erfolgreich erstellt !" ; $NORM
fi
rm -rf ${filedir_tmp}/${oscamBUILD}
echo " "
OScamRestart
echo $GRUEN "Fertig!
" ; $NORM
echo " "
exit 0