1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
#!/bin/bash
#
# Author: Mattias Gaertner
#
# Usage: ./create_lazarus_export_tgz.sh [chmhelp] [download] outputfilename
#
# Options:
# chmhelp add chm,kwd files in docs/chm
# download download instead of using the current files
#
Download=
UseCHMHelp=
OutputFile=
TmpDir=~/tmp
LastParam=
while [ $# -gt 0 ]; do
echo "param=$1"
case "$1" in
chmhelp)
echo "using files in docs/chm"
UseCHMHelp=1
;;
download)
Download=yes
;;
*)
if [ -n "$OutputFile" ]; then
echo "invalid parameter $LastParam"
exit 1
fi
OutputFile=$1
;;
esac
LastParam=$1
shift
done
set -e
if [ "x$OutputFile" = "x" ]; then
echo "Usage: ./create_lazarus_export_tgz.sh [chmhelp] [download] outputfilename"
exit 1
fi
TmpLazDir=$TmpDir/lazarus
mkdir -p $TmpDir
rm -rf $TmpLazDir
if [ "x$Download" = "xyes" ]; then
echo "downloading lazarus svn ..."
mkdir -p $TmpLazDir
Revision=Exported
cd $TmpDir
svn export http://svn.freepascal.org/svn/lazarus/trunk $TmpLazDir
cd -
else
echo "extracting lazarus from local svn ..."
LazSrcDir=$(pwd | sed -e 's#/tools/install.*$##')
Revision=$(svnversion $LazSrcDir)
cd $TmpDir
svn export $LazSrcDir $TmpLazDir
cd -
if [ "$UseCHMHelp" = "1" ]; then
echo
echo "Copying chm files"
cd $LazSrcDir/docs/chm
cp -v *.kwd *.chm $TmpLazDir/docs/chm/
cd -
fi
fi
# add ide/revision.inc
echo "const RevisionStr = '$Revision';" > $TmpLazDir/ide/revision.inc
cd $TmpDir
echo "packing ..."
tar cvzf lazarus.tgz lazarus
cd -
mv $TmpDir/lazarus.tgz $OutputFile
rm -rf $TmpLazDir
# end.
|