Scripts to retrieve latest MSE version for newbies (by Minoshi), may
be placed on MSEGUI.ORG :

### LINUX
-------------------------------------
#!/bin/sh
echo "Script for get and compile mseide+msegui from gitorious.org"
echo "=============================="
echo "Let's start!"
echo "=============================="

#VARs
#Path to git utility
gitprog=git

#Path to freepascal compiler
fpcprog=fpc

#Path where mseide will be placed
mseroot=/mnt/projects/mseide/1/mse

#Path where mse universe will be placed
mseuni=/mnt/projects/mseide/1/uni

#Path where binary will be placed
outputdir=/mnt/projects/mseide/1/mse_bingit

stripprog=strip


echo "===> Check needed files ..."
which $gitprog
if [ "$?" != "0" ]
then
     echo "===> Git client NOT found :( Exit"
     exit
fi

which $fpcprog
if [ "$?" != "0" ]
then
     echo "===> Free pascal compiler NOT found :( Exit"
     exit
fi

which $stripprog
if [ "$?" != "0" ]
then
     echo "===> Strip utility (used if exists)  NOT found. Contining ..."
     stripprog=""
fi

echo "===> All needed utilities found. Contining ..."




echo "===> Create direcroties ..."
mkdir -p $mseroot
if [ "$?" != "0" ]
then
     echo "===> Error while create directory $mseroot :( Exit"
     exit
fi

mkdir -p $mseuni
if [ "$?" != "0" ]
then
     echo "===> Error while create directory $mseuni :( Exit"
     exit
fi



echo "===> Cloning MSE universe to $mseuni"
$gitprog clone git://gitorious.org/mseuniverse/mseuniverse.git $mseuni

if [ "$?" != "0" ]
then
    echo "===> clone failed. Start pull"
    pushd $mseuni
    G_RESULT=`git pull | grep "up-to-date"`
    popd
    if [ "$G_RESULT" != "" ]
    then
    echo "===> Result:" $G_RESULT
    fi
fi
if [ "$?" != "0" ]
then
     echo "===> Update from GIT server FAILED :("
     exit
else
     echo "===> Update from GIT server OK :)"
fi


echo "===> Cloning MSEIDE to $mseroot"
$gitprog clone git://git.gitorious.org/mseide-msegui/mseide-msegui.git $mseroot

if [ "$?" != "0" ]
then
    echo "===> clone failed. Start pull"
    pushd $mseroot
    G_RESULT=`git pull | grep "up-to-date"`
    popd
    if [ "$G_RESULT" != "" ]
    then
    echo "===> Result:" $G_RESULT
    fi
fi
if [ "$?" != "0" ]
then
     echo "===> Update from GIT server FAILED :("
     exit
else
     echo "===> Update from GIT server OK :)"
fi


echo "===> Now start compile MSE"
echo "===> Command line:"$fpcprog -omseide_git
-Fu$mseroot/lib/addon/*/ -Fi$mseroot/lib/addon/*/
-Fu$mseroot/lib/common/kernel/linux/ -Fu$mseroot/lib/common/kernel/
-Fi$mseroot/lib/common/kernel/ -Fu$mseroot/lib/common/*/ -l -Mobjfpc
-Sh -Fcutf8 -gl -O- $mseroot/apps/ide/mseide.pas
-dmse_with_showsourceitems
cd $mseroot/apps/ide/
$fpcprog -omseide_git -Fu$mseroot/lib/addon/*/
-Fi$mseroot/lib/addon/*/ -Fu$mseroot/lib/common/kernel/linux/
-Fu$mseroot/lib/common/kernel/ -Fi$mseroot/lib/common/kernel/
-Fu$mseroot/lib/common/*/ -l -Mobjfpc -Sh -Fcutf8 -gl -O-
$mseroot/apps/ide/mseide.pas -dmse_with_showsourceitems

if [ "$?" != "0" ]
then
     echo "===> Compile FAILED :( . Exit"
     exit
fi


if [ "$stripprog" != "" ]
then
echo "===> Now strip binary"
$stripprog $mseroot/apps/ide/mseide_git
fi


echo "===> Now moving binary to $outputdir"
mv -f $mseroot/apps/ide/mseide_git $outputdir
if [ "$?" != "0" ]
then
     echo "===> Moving FAILED :( . Exit"
     exit
fi

echo "All OK :)"
------------------------------------

REM WIN-32

@echo off
echo "Script for get and compile mseide+msegui from gitorious.org"
echo "=============================="
echo "Let's start!"
echo "=============================="

REM PATH OF GIT CLIENT
SET gitpath=F:\bin\Git\cmd\git.exe
REM PATH OF FREE PASCAL COMPILER
SET fpcpath=F:\bin\fpc\bin\i386-win32\ppc386.exe

REM PATH WHERE MSEIDE WILL BE PLACED
SET msepath=F:\1\msegit
REM PATH WHERE MSE UNIVERSE WILL BE PLACED
SET unipath=F:\1\mseuni

REM PATH WHERE BINARY WILL BE PLACED
SET binpath=F:\bin\mseide\bin\mseIDE_git.exe


echo Creating %unipath% ...
IF NOT EXIST %unipath% mkdir %unipath%
IF %ERRORLEVEL%==1 goto ERRORMAKEDIR
chdir /D %unipath%
SET PP=%unipath%\.git
IF NOT EXIST %PP% GOTO CLONE
echo === Start pull
call %gitpath% pull
goto EXECGIT
:CLONE
echo === Start clone
call %gitpath% clone  git://gitorious.org/mseuniverse/mseuniverse.git %unipath%
:EXECGIT
IF %ERRORLEVEL%==1 goto ERRORGIT
echo === Update Universe from GIT server OK :)

echo Creating %msepath% ...
IF NOT EXIST %msepath% mkdir %msepath%
IF %ERRORLEVEL%==1 goto ERRORMAKEDIR
chdir /D %msepath%
SET PP=%msepath%\.git
IF NOT EXIST %PP% GOTO CLONE
echo === Start pull
call %gitpath% pull
goto EXECGIT
:CLONE
echo === Start clone
call %gitpath% clone
git://git.gitorious.org/mseide-msegui/mseide-msegui.git %msepath%
:EXECGIT
IF %ERRORLEVEL%==1 goto ERRORGIT
echo === Update MSEide from GIT server OK :)

echo === Now start compile MSE
echo === Command line:%fpcpath% -omseide_git -Fu%msepath%\lib\addon\*\
-Fi%msepath%\lib\addon\*\ -Fu%msepath%\lib\common\kernel\windows\
-Fu%msepath%\lib\common\kernel\ -Fi%msepath%\lib\common\kernel\
-Fu%msepath%\lib\common\*\ -l -Mobjfpc -Sh -Fcutf8 -gl -O-
%msepath%\apps\ide\mseide.pas -dmse_with_showsourceitems
chdir /D %msepath%\apps\ide
%fpcpath% -omseide_git -Fu%msepath%\lib\addon\*\
-Fi%msepath%\lib\addon\*\ -Fu%msepath%\lib\common\kernel\windows\
-Fu%msepath%\lib\common\kernel\ -Fi%msepath%\lib\common\kernel\
-Fu%msepath%\lib\common\*\ -l -Mobjfpc -Sh -Fcutf8 -gl -O-
%msepath%\apps\ide\mseide.pas -dmse_with_showsourceitems

IF %ERRORLEVEL%==1 goto ERRORCOMPILE
echo === Compile OK :)
echo === Now moving binary to %binpath%
cp -f %msepath%\apps\ide\mseide_git %binpath%

echo === All OK :)
GOTO EXIT
:ERRORCOMPILE
echo === Compile FAILED :(. Exit
GOTO EXIT
:ERRORMAKEDIR
echo === Can not create directory. Exit
GOTO EXIT
:ERRORGIT
echo === Update from GIT server FAILED :( Exit
:EXIT

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to