changed svn layout

git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
mdelfede 2008-06-07 22:31:27 +00:00
commit 263ff5f895
2665 changed files with 642923 additions and 0 deletions

37
linux_scripts/README Normal file
View file

@ -0,0 +1,37 @@
###################################################################
SCRIPTS TO BUILD DEBIAN PACKAGES FROM VARIOUS UPP REPOSITORIES
By Massimo Del Fedele (max@veneto.com)
###################################################################
User scripts are :
dosvn to build a debian from a local SVN repository
dodev to build a debian from a local upp development tree
dobeta to build a debian from a local upp beta tree
dostable to build a debian from a local upp stable tree
Other scripts are just helpers for main scripts.
USAGE :
1) Prepare local source repositories.
For svn, you'll need to do an 'svn checkout'. See svn user guide and/or sourceforge instructions
For beta/devel/stable packages, just download source tarball from upp site and unpack in a local folder
2) You MUST have Upp executables installed. It doesn't matter if from stable, beta or svn packages,
but a working IDE is needed. If you still don't have it, just install a debian svn package
downloadable from forum.
3) Edit doXXX scripts to adjust your local paths and personal data
(repositories, destination path, mantainer name and email)
Paths are set on scripts beginning -- see comments
4) Just run the requested script
The debian package(s) are put in your selected destination folder.
On errors, you'll get some error messages from scripts.
Enjoy !
Max

52
linux_scripts/dobeta Executable file
View file

@ -0,0 +1,52 @@
#!/bin/bash
# dobeta
# quick go to create deb package from beta sources
#
#################################################################
# REPLACE VALUES WITH YOUR OWN #
# SVN repository full path
BETA_PATH="/home/massimo/sources/uppbeta"
#
# Destination path for generated debian
DEST_PATH="/home/massimo/sources/uppdeb"
#
# Mantainer name and email
export MAINTAINER="Massimo Del Fedele"
#
export EMAIL="max@veneto.com"
#################################################################
#
# checks if beta repo and destination path are ok
if [ ! -d $BETA_PATH/uppsrc ]
then
echo "ERROR - UPP path not found in '$BETA_PATH'"
echo "Please modify current script to fit your Upp beta repository path"
exit 1
fi
if [ ! -d $DEST_PATH ]
then
echo "ERROR - Invalid destinatio path '$DEST_PATH'"
echo "Please modify current script to fit your destination path"
exit 1
fi
#locates 'uppbeta2deb' script - first try on path
uppbeta2deb="`which uppbeta2deb`"
if [ x$uppbeta2deb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppbeta2deb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppbeta2deb=$(dirname $uppbeta2deb)/uppbeta2deb
fi
if [ ! -f $uppbeta2deb ]
then
echo "ERROR - Could not find 'uppbeta2deb' script"
echo "Please check if it's on current path"
exit 1
fi
#just run uppbeta2deb with my params
$uppbeta2deb $BETA_PATH $DEST_PATH

53
linux_scripts/dodev Executable file
View file

@ -0,0 +1,53 @@
#!/bin/bash
# dodev
# quick go to create deb package from my dev repo
#
#################################################################
# REPLACE VALUES WITH YOUR OWN #
# SVN repository full path
DEV_PATH="/home/massimo/sources/uppbeta"
#
# Destination path for generated debian
DEST_PATH="/home/massimo/sources/uppdeb"
#
# Mantainer name and email
export MAINTAINER="Massimo Del Fedele"
#
export EMAIL="max@veneto.com"
#################################################################
#
# checks if dev repo and destination path are ok
if [ ! -d $DEV_PATH/uppsrc ]
then
echo "ERROR - UPP path not found in '$DEV_PATH'"
echo "Please modify current script to fit your Upp development path"
exit 1
fi
if [ ! -d $DEST_PATH ]
then
echo "ERROR - Invalid destinatio path '$DEST_PATH'"
echo "Please modify current script to fit your destination path"
exit 1
fi
#locates 'uppdev2deb' script - first try on path
uppdev2deb="`which uppdev2deb`"
if [ x$uppdev2deb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppdev2deb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppdev2deb=$(dirname $uppdev2deb)/uppdev2deb
fi
if [ ! -f $uppdev2deb ]
then
echo "ERROR - Could not find 'uppdev2deb' script"
echo "Please check if it's on current path"
exit 1
fi
#just run uppdev2deb with my params
$uppdev2deb $DEV_PATH $DEST_PATH

52
linux_scripts/dostable Executable file
View file

@ -0,0 +1,52 @@
#!/bin/bash
# dostable
# quick go to create deb package from my stable repo
#
#################################################################
# REPLACE VALUES WITH YOUR OWN #
# SVN repository full path
STABLE_PATH="/home/massimo/sources/uppbeta"
#
# Destination path for generated debian
DEST_PATH="/home/massimo/sources/uppdeb"
#
# Mantainer name and email
export MAINTAINER="Massimo Del Fedele"
#
export EMAIL="max@veneto.com"
#################################################################
#
# checks if stable repo and destination path are ok
if [ ! -d $STABLE_PATH/uppsrc ]
then
echo "ERROR - UPP path not found in '$STABLE_PATH'"
echo "Please modify current script to fit your Upp development path"
exit 1
fi
if [ ! -d $DEST_PATH ]
then
echo "ERROR - Invalid destinatio path '$DEST_PATH'"
echo "Please modify current script to fit your destination path"
exit 1
fi
#locates 'uppstable2deb' script - first try on path
uppstable2deb="`which uppstable2deb`"
if [ x$uppstable2deb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppstable2deb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppstable2deb=$(dirname $uppstable2deb)/uppstable2deb
fi
if [ ! -f $uppstable2deb ]
then
echo "ERROR - Could not find 'uppstable2deb' script"
echo "Please check if it's on current path"
exit 1
fi
#just run uppstable2deb with my params
$uppstable2deb $STABLE_PATH $DEST_PATH

52
linux_scripts/dosvn Executable file
View file

@ -0,0 +1,52 @@
#!/bin/bash
# dosvn
# quick go to create deb package from local svn repo
#
#################################################################
# REPLACE VALUES WITH YOUR OWN #
# SVN repository full path
SVN_REPO="/home/massimo/sources/uppsvn"
#
# Destination path for generated debian
DEST_PATH="/home/massimo/sources/uppdeb"
#
# Mantainer name and email
export MAINTAINER="Massimo Del Fedele"
#
export EMAIL="max@veneto.com"
#################################################################
#
# checks if svn repo and destination path are ok
if [ ! -d $SVN_REPO/.svn ]
then
echo "ERROR - SVN repository not found in '$SVN_REPO'"
echo "Please modify current script to fit your Upp SVN repository path"
exit 1
fi
if [ ! -d $DEST_PATH ]
then
echo "ERROR - Invalid destinatio path '$DEST_PATH'"
echo "Please modify current script to fit your destination path"
exit 1
fi
#locates 'uppsvn2deb' script - first try on path
uppsvn2deb="`which uppsvn2deb`"
if [ x$uppsvn2deb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppsvn2deb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppsvn2deb=$(dirname $uppsvn2deb)/uppsvn2deb
fi
if [ ! -f $uppsvn2deb ]
then
echo "ERROR - Could not find 'uppsvn2deb' script"
echo "Please check if it's on current path"
exit 1
fi
#just run uppsvn2deb with my params
$uppsvn2deb $SVN_REPO $DEST_PATH

177
linux_scripts/idebuild Executable file
View file

@ -0,0 +1,177 @@
#!/bin/bash
# idebuild
# Batch builds TheIDE in optimal mode
#
######################################################################
#convert a path to absolute one
rel2abs()
{
# make sure file is specified
if [ -z "$1" ]
then
echo "$0 <path>"
return 1
fi
# already absolute case
if [ "${1:0:1}" = "/" ] || [ "$PWD" = "/" ]
then
ABS=""
else
ABS="$PWD"
fi
# loop thru path
IFS="/"
for DIR in $1
do
if [ -n "$DIR" ]
then
if [ "$DIR" = ".." ]
then
ABS="${ABS%/*}"
elif [ "$DIR" != "." ]
then
ABS="$ABS/$DIR"
fi
fi
done
IFS=":"
echo $ABS
return 0
}
######################################################################
echo
echo "UPP ide BATCH BUILDER"
echo "CopyRight(c) 2008 By Massimo Del Fedele"
echo
# checks for parameters
if [ x"$1" = x -o x"$2" = x ]
then
echo "idebuild <upp base folder> <out file full path>"
exit 1
fi
# sets up source and dest folder names
src=$(rel2abs $1)
dst=$(rel2abs $2)
# checks if source folder exists
if [ -d $src ]
then
true
else
echo "source folder '$src' does not exist"
exit 1
fi
# sets up subfolders
uppsrc="uppsrc"
#common="Common"
#subfolders="$uppsrc $common"
subfolders="$uppsrc"
# checks if upp subfolder are in source folder
for name in $subfolders
do
if [ ! -d $src/$name ]
then
echo "bad source folder '$src'"
echo "missing '$src/$name' subfolder"
exit 1
fi
done
#trivial check of dest file name...
if [ -d $dst ]
then
echo "'dst' is a directory"
exit 1
fi
if [ -f $dst ]
then
rm $dst
if [ -f $dst ]
then
echo "'dst' exists and can't be erased"
exit 1
fi
fi
touch $dst
if [ -f $dst ]
then
rm $dst
else
echo "'dst' is not a valid executable name"
exit 1
fi
#now finds ide executable - prefers newest versions rather than 'theide' stable
#as if it's possible uses latest devel to build stuffs
#gathers also the ide cfg folder - new way, subfolder of ~/.Upp
executables="theide-svn theide-dev theide ide"
idecfgfolder=""
for executable in $executables
do
ideexec="`which $executable`"
if [ x$ideexec != x ]
then
idecfgfolder="$HOME/.upp/$executable"
break
fi
done
if [ x$idecfgfolder = x ]
then
echo "Error -- Ide executable not found"
exit 1
fi
# checks if ide cfg folder is ok
if [ -d $idecfgfolder ]
then
true
else
echo "Error -- Ide configuration folder '$idecfgfolder' not found"
exit 1
fi
#creates a temporary folder for ide output stuffs
outtmp="`mktemp -t -d idebuild.XXXXXXX`"
#creates a temporary assembly on ide cfg folder, just to build ide
tmpassembly="$idecfgfolder/idebuild.var"
echo UPP = "$src/uppsrc" > $tmpassembly
echo OUTPUT = "$outtmp" >> $tmpassembly
echo COMMON = "$src/uppsrc/Common" >> $tmpassembly
#forks ide to build release executable
$ideexec idebuild ide GCC -abrs theide
#$ideexec idebuild ide GCC -absl theide
ideresult=$?
#checks the result code
if [ $ideresult = 0 ]
then
echo "BUILD OK"
#moves the result to dest name
# mv "$outtmp/GCC.Gui.Shared/theide" $dst
mv "$outtmp/GCC.Blitz.Gui.Shared/theide" $dst
# mv "$outtmp/GCC.Debug_full.Gui.Shared/theide" $dst
else
echo "ERROR - TheIDE returned '$ideresult' error code"
fi
#deletes the temporary assembly
if [ -f $tmpassembly ]
then
rm $tmpassembly
fi
#deletes temporary folder
rm -rf $outtmp

132
linux_scripts/uppbeta2deb Executable file
View file

@ -0,0 +1,132 @@
#!/bin/bash
# uppbeta2deb
# From a beta source tree, batch builds theide and creates .deb package
#
######################################################################
#convert a path to absolute one
rel2abs()
{
# make sure file is specified
if [ -z "$1" ]
then
echo "$0 <path>"
return 1
fi
# already absolute case
if [ "${1:0:1}" = "/" ] || [ "$PWD" = "/" ]
then
ABS=""
else
ABS="$PWD"
fi
# loop thru path
IFS="/"
for DIR in $1
do
if [ -n "$DIR" ]
then
if [ "$DIR" = ".." ]
then
ABS="${ABS%/*}"
elif [ "$DIR" != "." ]
then
ABS="$ABS/$DIR"
fi
fi
done
IFS=":"
echo $ABS
return 0
}
######################################################################
echo
echo "UPP BETA2DEB BUILDER"
echo "CopyRight(c) 2008 By Massimo Del Fedele"
echo
# checks for parameters
if [ x"$1" = x -o x"$2" = x ]
then
echo "uppbeta2deb <upp root> <dest folder>"
exit 1
fi
#sets up source and dest folder names
src=$(rel2abs $1)
dst=$(rel2abs $2)
#locates 'uppdeb' and 'idebuild' scripts
uppdeb="`which uppdeb`"
if [ x$uppdeb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppdeb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppdeb=$(dirname $uppdeb)/uppdeb
fi
if [ ! -f $uppdeb ]
then
echo "ERROR - Could not find 'uppdeb' script"
echo "Please check if it's on current path"
exit 1
fi
idebuild="`which idebuild`"
if [ x$idebuild = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
idebuild=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
idebuild=$(dirname $idebuild)/idebuild
fi
if [ ! -f $idebuild ]
then
echo "ERROR - Could not find 'idebuild' script"
echo "Please check if it's on current path"
exit 1
fi
#checks if source folder is an upp folder
for name in uppsrc Common examples tutorial reference bazaar
do
if [ ! -d $src/$name ]
then
echo "bad source folder '$src'"
echo "missing '$src/$name' subfolder"
exit 1
fi
done
#gets release number from uppsrc/ide/version.h
release="`cat $src/uppsrc/ide/version.h`"
release=${release#*\"}
release=${release%%\"*}
echo "building .deb for release $release"
#creates a temporary folder for executable file
outtmp="`mktemp -t -d uppbeta2deb.XXXXXXX`"
#build theide
echo "building TheIDE......"
$idebuild $src $outtmp/theide-beta
if [ $? = 0 ]
then
true
else
echo "Error building TheIDE"
echo "Please check executables for errors"
exit 1
fi
#creates the deb package
echo "Creating package......"
$uppdeb $src $outtmp/theide-beta $dst $release
result=$?
#remove temporary folder
rm -rf $outtmp

423
linux_scripts/uppdeb Executable file
View file

@ -0,0 +1,423 @@
#!/bin/bash
# uppdeb
# Creates .deb packages for Ultimate++
#
######################################################################
#convert a path to absolute one
rel2abs()
{
# make sure file is specified
if [ -z "$1" ]
then
echo "$0 <path>"
return 1
fi
# already absolute case
if [ "${1:0:1}" = "/" ] || [ "$PWD" = "/" ]
then
ABS=""
else
ABS="$PWD"
fi
# loop thru path
IFS="/"
for DIR in $1
do
if [ -n "$DIR" ]
then
if [ "$DIR" = ".." ]
then
ABS="${ABS%/*}"
elif [ "$DIR" != "." ]
then
ABS="$ABS/$DIR"
fi
fi
done
IFS=":"
echo $ABS
return 0
}
######################################################################
echo
echo "UPP .deb PACKAGE GENERATOR"
echo "CopyRight(c) 2008 By Massimo Del Fedele"
echo
# checks for parameters
if [ x"$1" = x -o x"$2" = x -o x"$3" = x -o "$4"x = x ]
then
echo "uppdeb <upp base folder> <executable full path> <dest folder> <version>"
exit 1
fi
#gets architecture (i386 or x86_64)
architecture="`uname -m`"
if [ "$architecture" = "x86_64" ]
then
architecture="amd64"
elif [ "$architecture" = "i386" -o "$architecture" = "i686" ]
then
architecture="i386"
else
echo "wrong architecture '$architecture'"
exit 1
fi
# sets up source and dest folder names
src=$(rel2abs $1)
executable=$(rel2abs $2)
dst=$(rel2abs $3)
ver="$4"
# checks if source folder exists
if [ -d $src ]
then
true
else
echo "source folder '$src' does not exist"
exit 1
fi
# checks if destination folder exists
if [ -d $dst ]
then
true
else
echo "dest folder '$dst' does not exist"
exit 1
fi
# sets up subfolders
uppsrc="uppsrc"
examples="examples"
tutorial="tutorial"
reference="reference"
bazaar="bazaar"
subfolders="$uppsrc $examples $tutorial $reference $bazaar"
# checks if upp subfolder are in source folder
for name in $subfolders
do
if [ ! -d $src/$name ]
then
echo "bad source folder '$src'"
echo "missing '$src/$name' subfolder"
exit 1
fi
done
# checks for executable
if [ -f $executable ]
then
true
else
echo "missing executable file... please compile before packaging"
exit 1
fi
# removes dest file if exist
if [ -f $dst ]
then
rm $dst
fi
# gets basename from ide executable full path
# it's used to set up proper ide exec name and launcher
# in package
file=${executable##*/}
base=${file%%.*}
# depending on base name, gets Icon name and Package name
if [[ $base =~ [sS][vV][nN] ]]
then
iconname="TheIDE-SVN"
packagename="upp-svn"
elif [[ $base =~ [dD][eE][vV] ]]
then
iconname="TheIDE-DEV"
packagename="upp-dev"
elif [[ $base =~ [bB][eE][tT][aA] ]]
then
iconname="TheIDE-BETA"
packagename="upp-beta"
else
iconname="TheIDE"
packagename="upp"
fi
#tmp="/tmp/uppdeb"
#rm -rf $tmp
tmp="`mktemp -t -d uppdeb.XXXXXXX`"
#mkdir $tmp
echo "Building package '$packagename' from folder '$src'"
echo "Dest package path is '$dst'"
echo "IDE executable is '$executable'"
#creates package tree
mkdir $tmp/DEBIAN
mkdir $tmp/usr
mkdir $tmp/usr/bin
mkdir $tmp/usr/sbin
mkdir $tmp/usr/share
mkdir $tmp/usr/share/applications
mkdir $tmp/usr/share/doc
mkdir $tmp/usr/share/doc/$packagename
mkdir $tmp/usr/share/pixmaps
mkdir $tmp/usr/share/$packagename
#creates GCC.bm file
cat > $tmp/usr/share/$packagename/GCC.bm << EOF
BUILDER = "GCC";
COMPILER = "g++-4.1";
DEBUG_INFO = "2";
DEBUG_BLITZ = "1";
DEBUG_LINKMODE = "1";
DEBUG_OPTIONS = "-O0";
RELEASE_BLITZ = "0";
RELEASE_LINKMODE = "1";
RELEASE_OPTIONS = "-O3 -ffunction-sections";
RELEASE_SIZE_OPTIONS = "-Os -finline-limit=20";
DEBUGGER = "gdb";
PATH = "";
INCLUDE = "/usr/include/freetype2;/usr/include/gtk-2.0;/usr/include/glib-2.0;/usr/lib/glib-2.0/include;/usr/lib/gtk-2.0/include;/usr/include/cairo;/usr/include/pango-1.0;/usr/include/atk-1.0";
LIB = "/usr/X11R6/lib";
REMOTE_HOST = "";
REMOTE_OS = "";
REMOTE_TRANSFER = "";
REMOTE_MAP = "";
EOF
#creates theide.png file (actually, $base.png)
shopt -s xpg_echo
echo "\
\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\
\x00\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x00\x57\x02\xf9\
\x87\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\
\xbd\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\
\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\
\x07\xd6\x0b\x1a\x0b\x0d\x24\xc5\x3f\xa6\x05\x00\x00\x08\x51\x49\
\x44\x41\x54\x68\xde\xed\x99\xcb\x6f\x1b\xd7\x15\xc6\x7f\x77\x1e\
\xe4\x90\x94\x25\xd7\x2f\x24\x41\x51\x64\x23\xe4\x81\x28\x36\xe4\
\x56\x90\x03\xa7\x28\x10\x08\x05\x02\x74\x91\x5d\xff\x84\x6e\xea\
\xa0\x05\xb4\x6b\x37\x6d\xa5\xa5\xb3\xb1\x90\xbf\xa1\xf1\xc6\x8b\
\xc6\x5d\x15\x30\xdc\x4d\xd0\xa2\x89\x8d\x00\x8e\x64\x14\x68\x1d\
\x40\x76\x40\x3d\x39\x22\x39\x9c\xc7\x9d\xd3\xc5\x3c\x38\xa4\x86\
\x12\x29\xa9\xc9\xa2\xbd\x02\x21\x72\xc8\x39\xf7\x9c\x7b\xbe\xfb\
\x9d\xef\x9e\x81\xff\x8f\xef\x76\xa8\x33\xb2\x63\x00\x53\x40\xa5\
\x70\x4d\x0a\xf6\x47\xbd\x07\x88\x81\x03\x20\x3c\xc9\xc4\xd6\x19\
\x05\x30\x05\xfc\x06\x58\x4c\x1d\x91\x31\xef\xb3\x81\x3d\xe0\x77\
\xc0\xe7\xdf\x65\x00\x26\xb0\x00\xbc\x7b\x7c\xce\x15\x88\xe4\xe9\
\x17\xd8\x07\xce\x9f\x74\x62\xeb\x0c\x20\x11\x01\x17\xfa\xfe\x29\
\x1c\xc7\xc1\x34\x4d\x24\x75\x14\x95\xfc\xd4\xf0\x3c\x0c\xad\x11\
\xa0\x03\xe8\x3e\x84\xa6\x81\x99\xd4\x1f\x35\x09\xcc\x46\xed\x81\
\xe9\x09\x20\xa1\x81\x2a\x30\x07\x5c\xa8\xd5\x6a\x2c\x2f\x2f\x33\
\x3f\x3f\x8f\xeb\xba\x28\x11\xb4\xe3\x60\xf8\x3e\xaf\xac\xac\xf0\
\xbd\x8d\x0d\xba\xc0\x2f\x81\x47\xc9\xfd\x21\xf0\x25\xb0\x95\x66\
\x52\x9d\x05\xcc\x2e\x01\x0f\x53\xc7\x27\x79\xc5\x53\x53\x53\x72\
\xef\xde\x3d\xe9\xb4\xdb\xf2\xec\xeb\xaf\xe5\xdf\xdf\x7c\x23\xff\
\xec\x76\xe5\x5f\xcd\xa6\xe8\x1b\x37\x44\x40\x42\x90\xf7\xc6\xb4\
\xa9\x94\x12\x12\x98\xfd\x74\xd2\x3d\x10\x66\x90\xa8\xd7\xeb\x58\
\x96\x45\x1c\xc7\x25\x90\x4e\x16\xac\xd3\xe9\xa0\xb5\x56\x22\x82\
\xeb\xba\x6c\xef\xee\xb2\xb3\xb3\x93\x64\xc0\x75\x31\x3c\x8f\x4b\
\x41\xc0\x14\xe0\x01\x41\xe1\xfe\xcc\xbe\x88\xa0\xb5\xce\xaf\x7b\
\x9e\x97\x7d\x8e\xfa\x88\x1b\x2f\x80\x6c\x05\xa8\xd7\xeb\xdc\xbe\
\x7d\x9b\x85\x85\x05\x0e\x0e\x0e\x0e\xfd\xd0\x71\x1c\x7a\xbd\x1e\
\xb7\x6e\xdd\xe2\xd1\xa3\x04\x14\x4a\x04\xa9\x54\x50\x22\x7c\x7f\
\x65\x85\xfa\x93\x27\xc4\xf5\x3a\xb5\x8d\x8d\x43\x1b\x28\xb3\xbf\
\xb8\xb8\x88\xeb\xba\xbc\x78\xf1\x82\x28\x8a\x88\xa2\x88\xd5\xd5\
\x55\xd6\xd7\xd7\x07\xfc\x19\x37\x80\x1c\x87\x96\x65\xb1\xb0\xb0\
\xc0\xb5\x6b\xd7\x46\xa6\x2a\x8a\x84\x8b\x17\xaf\xe4\x1b\x56\x3b\
\x0e\xd1\xf4\x34\xda\x75\xa9\x3f\x79\x42\xfd\xab\xaf\x86\x4c\xf7\
\x7d\xb1\x2c\x9b\x85\x85\x9b\xbc\xfd\xf6\x9b\x00\xec\xed\xb5\xd0\
\x3a\x20\x0c\x23\xd6\xd6\xd6\x8a\x37\xa9\x13\xd1\x68\x1c\xc7\x85\
\x95\x17\xa0\x9b\x66\x34\xb3\x57\xc5\xf3\x7c\x82\xa0\xd7\xa7\x30\
\xdf\xc7\x6c\xb7\x31\x3c\x8f\xb8\x5e\xef\xbb\x50\x07\x6c\x49\x38\
\x25\xa5\xa1\xc4\xfe\x0e\xa0\x89\xe3\x2e\xcd\xe6\x16\x5a\x87\x44\
\x51\x48\x18\x86\x27\xa6\x51\x19\xc6\x78\x32\xba\xc0\xaf\x81\xbf\
\xa5\x44\x95\x30\xae\x48\x8c\x52\x8f\x73\xaa\x7c\x65\x65\x85\x1f\
\x7c\xfc\x31\x97\x82\x20\x87\x0d\x75\xe0\x36\x70\x13\xd8\x01\x6e\
\x25\x34\xa4\x54\x07\xf8\x10\x98\x46\x6b\xcd\xd3\xa7\xef\xd3\x6c\
\xbe\x86\x69\xba\xb4\xdb\xed\x43\x90\x3e\x65\x21\x8b\x52\xe7\x1f\
\x8d\x2c\x1f\x4a\x6b\x6a\x1b\x1b\x79\x21\xc9\x97\x3f\x16\xf8\x21\
\xf0\x66\x6a\xe6\x62\x96\x16\x0d\x7c\x91\x66\x5b\xd1\x6a\xbd\x41\
\xb3\xf9\x12\xb6\xbd\x73\xaa\x0c\xe4\xcb\x9e\x17\xa3\xfc\xf2\xb9\
\xa3\x00\x87\x14\xe9\x22\x83\x4d\x2c\x09\x9b\x67\x0b\x9a\xd3\x90\
\x50\x34\xaf\x54\x05\xcb\x6a\x50\xa9\xd8\xd8\xb6\x8d\x61\x18\xa7\
\xdf\x03\xa7\xd2\x7f\x75\xe0\x23\xe0\x7a\xea\xfc\xd5\x11\x72\xae\
\x88\x5d\x91\xf4\x35\xb0\x78\x32\x69\x06\x72\xde\xcd\xa4\x41\xb6\
\x61\x13\x95\x31\x38\xaa\x55\xc8\x16\x4b\x31\x24\x00\xae\x83\xcc\
\x0f\x5e\x2f\x5a\x51\x0a\x32\xf3\x96\xa5\xa8\xd5\x2a\x38\x4e\x0d\
\xdb\xae\x16\x33\x40\xa1\x74\x8c\x0c\x20\x83\xad\x99\x6a\x9b\x6a\
\xf6\x45\xaf\xd7\x23\x8a\x04\xcf\xf3\x11\x89\x0f\x39\xdf\xeb\x41\
\x5e\xe3\x72\xd8\x90\xc3\x46\x15\xf8\xcb\x48\x2b\x64\xd1\x4a\xaf\
\x97\xe8\xbb\x6e\x17\x82\x20\x24\x0c\x7d\xe2\x38\x28\x66\xc0\x48\
\x7d\x3a\x9f\xbe\xcf\x75\x91\x2a\xd1\x3f\x0b\xe9\xe7\x39\xe0\x82\
\x69\x9a\xcc\xcd\xcd\x71\xf1\xe2\x15\x82\xa0\x97\xb2\x4d\xab\x1f\
\xb5\x91\x38\xff\xf8\x31\xb4\x5a\x30\xdd\x80\x3f\x7d\x04\xef\x16\
\x61\x33\x93\xb0\xe6\xaf\x52\x31\xd3\x70\xe1\xf1\xcf\xa0\xf5\x10\
\x4c\x13\xe6\xe6\xe0\xf2\x65\xf0\x7d\x83\x66\xf3\x65\x7c\x7f\x0a\
\xc3\x88\xd8\xdc\xdc\xa4\xd7\xeb\x15\xf5\xd2\x3e\xe0\x02\xbf\x2f\
\xd3\x45\x65\xfa\x27\x9e\x4c\x0b\x29\x99\x9e\x41\x1e\x7e\x51\x80\
\xb2\x20\x12\x23\x5d\x41\xae\x0b\xc9\x5f\x0b\xe1\xc7\x88\x09\xa2\
\x26\xb0\x5f\xa6\x8b\xac\x51\xfa\x27\x95\xc4\x6a\x90\x85\x18\xa9\
\x85\x72\xdd\x92\x09\xdf\x22\x6c\x54\x62\xb8\x71\x88\xb3\x92\x4d\
\x50\x1b\x96\xdf\x47\xd9\x1f\xd2\x45\x56\x59\x01\x73\x1c\x67\x40\
\x12\x1f\x35\x1c\xc7\xc1\xf7\x7d\x56\x56\x56\x58\x5f\x5f\x1f\xa0\
\x8b\x6e\x11\x36\xc0\xe3\x92\xc9\x6a\xc7\xcc\x35\x6c\xff\xa8\x4d\
\x9c\xcf\x6d\x9a\x26\xf3\xf3\xf3\x2c\x2d\x2d\xb1\xbd\xbd\x3d\x54\
\x8d\x07\x29\xaf\xd1\x68\xe0\x79\x1e\x77\xee\xdc\xe9\xb3\x4a\x61\
\xe7\x7d\x0e\xfc\x63\xa4\x12\x3a\x7a\xae\x32\xfb\xc3\x55\xd9\x1a\
\x55\xbc\x5c\xd7\x65\x7b\x7b\x3b\x91\xc4\x47\x04\xd0\xeb\xf5\xe8\
\xf5\x7a\x03\x55\xb3\x97\xce\x30\x08\x9b\x84\x9e\x04\x9b\xa2\x18\
\x3a\x6a\xae\x11\xf6\x07\x8a\x5a\x69\x06\x8a\xf8\x1b\xe5\xfc\xa8\
\xd1\x49\x65\xce\x95\x34\x90\xc7\x03\x55\xad\x44\x0c\x4d\x3e\xd7\
\xc8\x0c\x9c\xc9\xd0\x25\x4a\x29\x81\x4d\x4c\x89\x18\x3a\xf5\xb0\
\xce\xbc\x47\x24\xc3\xae\xd7\x53\xe7\x4b\xc5\xd0\x49\x7b\x59\xe3\
\x41\x28\x23\xf2\x91\xbe\x1e\xf3\xfd\x24\x62\xa8\xcc\xd6\x08\xfb\
\xc7\x43\x28\xab\x03\x8d\x46\x23\xab\x84\x23\x03\x98\x9a\x9a\xc2\
\x34\xcd\xbe\x6e\x99\x50\x0c\x1d\x35\x57\xa9\xfd\x71\x21\xe4\xfb\
\x3e\x9e\xe7\x1d\x19\x40\x46\x83\x9e\xe7\xf5\x57\x4a\x26\x17\x43\
\x47\xcd\x75\xc8\xfe\x10\x84\x8a\x4e\x5f\x04\xfe\x08\xbc\x67\x9a\
\x26\xb3\xb3\xb3\xcc\xcc\xcc\x1c\x7b\xa8\x30\x0c\x03\x11\x61\x63\
\x63\x23\x39\x41\x4d\x28\x86\x8e\x9b\xeb\x90\x7d\xd8\x06\x7e\x0e\
\xfc\xa5\x2c\x03\xb6\x52\x0a\xad\x75\x69\xd5\x1b\xa7\xc3\x1b\x63\
\x01\x3f\x02\xae\x0d\xc2\xd6\x50\x87\xaa\x9a\x32\x21\x8e\xc7\x9f\
\x4b\x29\x85\x88\x58\xa9\x62\x3e\x04\xa1\x18\xd8\x13\x91\xfd\xf4\
\xfd\xb9\x2c\xa0\xa4\x6f\x63\xa7\x7d\xa1\xce\x40\x8b\x26\xa3\xee\
\x4e\x07\x62\x5d\xec\x02\x1e\x2f\x86\x24\x4e\x56\xad\xd1\x00\xcb\
\x4a\x24\x75\x10\x54\x10\x31\x51\x4a\x08\x82\x20\xeb\x45\xc5\x40\
\x5b\x44\x34\xb0\x0b\xf8\x65\x01\x1c\xa4\xed\xbb\xf3\xa9\xb4\xfe\
\x2d\x30\xdf\xef\x0b\xdd\x4c\xbb\x07\x1f\xe6\x67\xd8\x44\xab\x24\
\x7a\xfe\xd6\x2d\x78\xf4\x28\xdb\x03\xe3\x8b\xa1\x7a\x03\x6e\xdf\
\x86\x77\xde\x81\xfd\xfd\x0a\x0f\x1e\x7c\x40\xb3\xf9\x3a\xa6\xd9\
\xe2\xee\xdd\xbb\x6c\x6e\x6e\x92\x62\xf1\x0f\xc0\xdf\xd3\x65\xf9\
\xb2\x2c\x80\xb0\xa0\xb1\x67\x80\x5f\x64\x7d\xa1\xc5\xc5\xc5\xb4\
\x6f\xa3\x0b\xdd\x88\x22\x5b\x24\x7a\x3e\x07\xe2\x51\x62\x28\xff\
\x22\x3b\x85\x25\xce\xbf\xf5\x56\x12\x51\xa7\xf3\x2a\xcf\x9e\x5d\
\xc7\xb2\x9a\xdc\xbf\x7f\xbf\x78\x1a\xfb\x0c\xf8\xeb\x70\x7d\xb4\
\x8e\x28\x70\x56\x51\x17\x25\x5d\x83\x2e\x5a\x6b\xe2\x58\xa1\x54\
\x25\x3f\x06\x76\xbb\xe0\xfb\x41\x9f\x5a\x4a\xc4\x50\x72\x74\xd4\
\x58\x56\xb2\x29\x3d\x0f\xb4\x4e\x82\xdf\xdf\xaf\x00\x82\xef\x9b\
\xec\xed\x79\x1c\x1c\xec\x63\x59\x6d\xa2\x28\x2a\xfa\x54\x29\x2b\
\x99\xc7\x4a\x09\xad\x35\x2f\x5e\xbc\x60\x6f\xaf\x45\xb3\xb9\xc5\
\xd3\xa7\xef\xd3\x6a\xbd\x81\x65\x35\x10\x11\x6a\xb5\x0a\x41\x10\
\xd2\x6c\xde\x05\x36\x47\x8a\x21\xc7\x89\x59\x5e\xde\xe4\xc6\x0d\
\xd8\xda\x0a\x59\x5d\xed\xb2\xbe\x9e\x60\xfe\xc1\x83\x0f\xe8\x74\
\x5e\x65\x6f\xcf\x63\x7b\xfb\x65\xaa\xd5\x2e\x5a\x9f\xee\xf9\x80\
\x1a\x6c\x1d\x46\x68\x1d\xa0\x75\x48\xb3\xf9\x1a\xcd\xe6\x4b\x54\
\x2a\x36\x22\x82\xe3\xd4\x08\x43\x1f\xdf\xff\xf3\x68\x31\x44\x72\
\xec\xbc\x7a\xb5\xc3\xd2\x52\xc0\xf3\xe7\x9a\xb5\xb5\x28\x85\x9f\
\x49\xb3\xf9\x3a\xcf\x9e\x5d\xe7\xe0\x60\x9f\x6a\xb5\x4b\xa3\x61\
\x11\x04\xd5\xb3\x69\xab\x28\xa5\x88\xa2\x88\x30\x8c\x88\xa2\x10\
\xd3\x74\xb1\xed\x1d\x6c\xdb\x46\x04\x6c\xbb\x4a\x1c\x07\x18\x46\
\x54\xfa\x30\xc6\x71\x62\xe2\x18\x2c\x4b\x70\x5d\x93\xbd\x3d\x9b\
\xdd\x5d\x45\x18\x1a\xe9\x6f\x04\xcb\x6a\x61\x59\x4d\x2c\xab\x8d\
\xd6\x10\x04\x55\x7c\x3f\xe0\xb8\xd3\xe0\x58\xad\x45\xcf\xf3\x58\
\x5d\x5d\x65\x6d\x6d\x8d\x30\x0c\x69\xb7\xdb\x84\x61\x98\x17\x98\
\xec\x7f\xca\x16\x03\x92\xca\x71\x34\xcb\xcb\x9b\x5c\xbd\xda\xc1\
\x75\x4d\x66\x67\x3d\x5c\xb7\x4a\x51\x35\x07\x41\xc0\x27\x9f\xdc\
\xe5\xd3\x4f\xef\xe7\x98\x3f\x6c\xf3\x64\xdd\xe9\x89\x8b\x5a\xf2\
\xf8\xab\x4f\x43\x96\x65\x70\xe3\x06\x2c\x2d\x05\xec\xee\xda\x1c\
\x1c\x54\xa9\x54\xce\x51\xaf\x7b\x39\x3c\xe2\x38\x2e\x3a\x3a\x56\
\xf1\x1a\x27\x80\xac\xa8\xb5\x52\xf1\x7e\x9c\x80\x36\x80\x73\x92\
\x1c\xb7\xd2\xdd\xab\x11\xe9\xb2\xb5\x15\xf2\xfc\xb9\x66\x77\x57\
\xa1\x14\xd4\xeb\xde\xb0\xb6\x89\x53\x9e\x0f\xca\xf6\x9f\x88\x98\
\xe9\x09\xc8\x9f\xa4\x4f\x68\xa7\x7d\xa1\xcb\xa3\x9e\x8c\x0c\x75\
\xcc\x2e\x64\x85\x2f\x59\xa8\x39\xe0\x12\xa6\x19\x30\x3b\xdb\x65\
\x66\x26\xca\x31\x5f\xa2\x6d\xdc\xb4\x48\x7d\x96\x52\xa5\x2a\x29\
\x1a\x7e\x5a\xbc\x76\xff\x5b\x0f\xcc\xcf\x27\xe2\x4a\x15\x7a\x38\
\x63\xf7\x79\x76\x81\x9f\x9c\xb4\x31\x7b\x56\x47\x4a\x23\x59\xc9\
\x3e\xe4\xc6\x20\x90\x0c\x1e\xbb\x13\x3c\x18\x97\x53\xb4\x9a\x8f\
\x7d\xe2\x3e\x2e\xe4\xbe\x75\x78\x7c\x5b\x43\xf1\xbf\x38\xfe\x03\
\xb3\x05\xe4\x47\x8e\x1e\xd0\xe3\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82" > $tmp/usr/share/pixmaps/$base.png
#copies source files to tmp folder
for name in $subfolders
do
# rsync -av --exclude '.svn' $src/$name $tmp/usr/share/$packagename > /dev/null
rsync -rl --chmod=ugo+r,Dugo+x --exclude '.svn' $src/$name $tmp/usr/share/$packagename > /dev/null
done
#copies the executable file
cp -a $executable $tmp/usr/bin/$base
#creates launcher
cat > $tmp/usr/share/applications/$base.desktop << EOF
[Desktop Entry]
Version=1.0
Encoding=UTF-8
EOF
echo "Name=$iconname" >> $tmp/usr/share/applications/$base.desktop
echo "GenericName=$iconname" >> $tmp/usr/share/applications/$base.desktop
cat >> $tmp/usr/share/applications/$base.desktop << EOF
Comment=IDE for cross-platform C++ development
MimeType=application/x-upp;
EOF
echo "Exec=$base" >> $tmp/usr/share/applications/$base.desktop
echo "Icon=$base.png" >> $tmp/usr/share/applications/$base.desktop
cat >> $tmp/usr/share/applications/$base.desktop << EOF
Terminal=false
Type=Application
Categories=Application;Development;C++
StartupNotify=false
EOF
echo "GenericName[de_DE]=$iconname" >> $tmp/usr/share/applications/$base.desktop
echo "GenericName[it_IT]=$iconname" >> $tmp/usr/share/applications/$base.desktop
#creates md5sums file
md5tmp="`mktemp -t -d uppdebMD5.XXXXXXX`"
cd $tmp
find ./ -type f -exec md5sum {} \; | sed s/.[/]// | sed /[.]svn/d >> $md5tmp/md5sums
mv $md5tmp/md5sums $tmp/DEBIAN
rmdir $md5tmp
#gets the installed size (approx...)
#sigh... there must be a nicer way
szline="`du -s $tmp/`"
for sz in $szline
do
size=$sz
break
done
# removed... should not be necessary anymore
#Conflicts: ultimate++, upp-dev
#creates control file
echo "Package: $packagename" > $tmp/DEBIAN/control
echo "Version: $ver" >> $tmp/DEBIAN/control
cat >> $tmp/DEBIAN/control << EOF
Section: devel
Priority: optional
EOF
echo "Architecture: $architecture" >> $tmp/DEBIAN/control
cat >> $tmp/DEBIAN/control << EOF
Depends: gcc (>= 3.4.0), g++ (>= 3.4.0), libc6-dev (>= 2.3.6), libstdc++6-dev (>= 3.4.6), libx11-dev (>= 1.0.0), libxft-dev (>= 2.1.8), zlib1g-dev (>= 1.2.3), libpng12-dev (>= 1.2.8), libfontconfig1-dev (>= 2.3.2), libxrender-dev (>= 0.9.0), libfreetype6-dev (>= 2.1.10), libexpat1-dev (>= 1.95.8), libxau-dev (>= 1.0.0), libxdmcp-dev (>= 1.0.0), libgtk2.0-dev (>= 2.8.17), libglib2.0-dev (>= 2.10.2), g++-4.1
EOF
echo "Installed-Size: $size" >> $tmp/DEBIAN/control
echo "Maintainer: $MAINTAINER <$EMAIL>" >> $tmp/DEBIAN/control
cat >> $tmp/DEBIAN/control << EOF
Description: C++ library for cross-platform development with IDE
Ultimate++ is a radical and innovative GUI toolkit whose number one priority
is programmer productivity. C++ is a great programming language but
C++ programmers are sometimes hampered by the lack of effective libraries.
U++ libraries enable genuine productivity gains with shorter development
times and greatly reduced application source code size.
EOF
#creates final .deb package
dpkg-deb -b $tmp $dst
result=$?
#wipes temporary folder
rm -rf $tmp

132
linux_scripts/uppdev2deb Executable file
View file

@ -0,0 +1,132 @@
#!/bin/bash
# uppdev2deb
# From a devel source tree, batch builds theide and creates .deb package
#
######################################################################
#convert a path to absolute one
rel2abs()
{
# make sure file is specified
if [ -z "$1" ]
then
echo "$0 <path>"
return 1
fi
# already absolute case
if [ "${1:0:1}" = "/" ] || [ "$PWD" = "/" ]
then
ABS=""
else
ABS="$PWD"
fi
# loop thru path
IFS="/"
for DIR in $1
do
if [ -n "$DIR" ]
then
if [ "$DIR" = ".." ]
then
ABS="${ABS%/*}"
elif [ "$DIR" != "." ]
then
ABS="$ABS/$DIR"
fi
fi
done
IFS=":"
echo $ABS
return 0
}
######################################################################
echo
echo "UPP STABLE2DEB BUILDER"
echo "CopyRight(c) 2008 By Massimo Del Fedele"
echo
# checks for parameters
if [ x"$1" = x -o x"$2" = x ]
then
echo "uppstable2deb <upp root> <dest folder>"
exit 1
fi
#sets up source and dest folder names
src=$(rel2abs $1)
dst=$(rel2abs $2)
#locates 'uppdeb' and 'idebuild' scripts
uppdeb="`which uppdeb`"
if [ x$uppdeb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppdeb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppdeb=$(dirname $uppdeb)/uppdeb
fi
if [ ! -f $uppdeb ]
then
echo "ERROR - Could not find 'uppdeb' script"
echo "Please check if it's on current path"
exit 1
fi
idebuild="`which idebuild`"
if [ x$idebuild = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
idebuild=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
idebuild=$(dirname $idebuild)/idebuild
fi
if [ ! -f $idebuild ]
then
echo "ERROR - Could not find 'idebuild' script"
echo "Please check if it's on current path"
exit 1
fi
#checks if source folder is an upp folder
for name in uppsrc Common examples tutorial reference bazaar
do
if [ ! -d $src/$name ]
then
echo "bad source folder '$src'"
echo "missing '$src/$name' subfolder"
exit 1
fi
done
#gets release number from uppsrc/ide/version.h
release="`cat $src/uppsrc/ide/version.h`"
release=${release#*\"}
release=${release%%\"*}
echo "building .deb for release $release"
#creates a temporary folder for executable file
outtmp="`mktemp -t -d uppstable2deb.XXXXXXX`"
#build theide
echo "building TheIDE......"
$idebuild $src $outtmp/theide
if [ $? = 0 ]
then
true
else
echo "Error building TheIDE"
echo "Please check executables for errors"
exit 1
fi
#creates the deb package
echo "Creating package......"
$uppdeb $src $outtmp/theide-dev $dst $release
result=$?
#remove temporary folder
rm -rf $outtmp

132
linux_scripts/uppstable2deb Executable file
View file

@ -0,0 +1,132 @@
#!/bin/bash
# uppstable2deb
# From a 'stable' source tree, batch builds theide and creates .deb package
#
######################################################################
#convert a path to absolute one
rel2abs()
{
# make sure file is specified
if [ -z "$1" ]
then
echo "$0 <path>"
return 1
fi
# already absolute case
if [ "${1:0:1}" = "/" ] || [ "$PWD" = "/" ]
then
ABS=""
else
ABS="$PWD"
fi
# loop thru path
IFS="/"
for DIR in $1
do
if [ -n "$DIR" ]
then
if [ "$DIR" = ".." ]
then
ABS="${ABS%/*}"
elif [ "$DIR" != "." ]
then
ABS="$ABS/$DIR"
fi
fi
done
IFS=":"
echo $ABS
return 0
}
######################################################################
echo
echo "UPP STABLE2DEB BUILDER"
echo "CopyRight(c) 2008 By Massimo Del Fedele"
echo
# checks for parameters
if [ x"$1" = x -o x"$2" = x ]
then
echo "uppstable2deb <upp root> <dest folder>"
exit 1
fi
#sets up source and dest folder names
src=$(rel2abs $1)
dst=$(rel2abs $2)
#locates 'uppdeb' and 'idebuild' scripts
uppdeb="`which uppdeb`"
if [ x$uppdeb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppdeb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppdeb=$(dirname $uppdeb)/uppdeb
fi
if [ ! -f $uppdeb ]
then
echo "ERROR - Could not find 'uppdeb' script"
echo "Please check if it's on current path"
exit 1
fi
idebuild="`which idebuild`"
if [ x$idebuild = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
idebuild=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
idebuild=$(dirname $idebuild)/idebuild
fi
if [ ! -f $idebuild ]
then
echo "ERROR - Could not find 'idebuild' script"
echo "Please check if it's on current path"
exit 1
fi
#checks if source folder is an upp folder
for name in uppsrc Common examples tutorial reference bazaar
do
if [ ! -d $src/$name ]
then
echo "bad source folder '$src'"
echo "missing '$src/$name' subfolder"
exit 1
fi
done
#gets release number from uppsrc/ide/version.h
release="`cat $src/uppsrc/ide/version.h`"
release=${release#*\"}
release=${release%%\"*}
echo "building .deb for release $release"
#creates a temporary folder for executable file
outtmp="`mktemp -t -d uppstable2deb.XXXXXXX`"
#build theide
echo "building TheIDE......"
$idebuild $src $outtmp/theide
if [ $? = 0 ]
then
true
else
echo "Error building TheIDE"
echo "Please check executables for errors"
exit 1
fi
#creates the deb package
echo "Creating package......"
$uppdeb $src $outtmp/theide $dst $release
result=$?
#remove temporary folder
rm -rf $outtmp

162
linux_scripts/uppsvn2deb Executable file
View file

@ -0,0 +1,162 @@
#!/bin/bash
# uppsvn2deb
# Updates svn, batch builds theide and creates .deb package
#
######################################################################
#convert a path to absolute one
rel2abs()
{
# make sure file is specified
if [ -z "$1" ]
then
echo "$0 <path>"
return 1
fi
# already absolute case
if [ "${1:0:1}" = "/" ] || [ "$PWD" = "/" ]
then
ABS=""
else
ABS="$PWD"
fi
# loop thru path
IFS="/"
for DIR in $1
do
if [ -n "$DIR" ]
then
if [ "$DIR" = ".." ]
then
ABS="${ABS%/*}"
elif [ "$DIR" != "." ]
then
ABS="$ABS/$DIR"
fi
fi
done
IFS=":"
echo $ABS
return 0
}
######################################################################
echo
echo "UPP SVN2DEB BUILDER"
echo "CopyRight(c) 2008 By Massimo Del Fedele"
echo
# checks for parameters
if [ x"$1" = x -o x"$2" = x ]
then
echo "uppsvn2deb <upp svn root> <dest folder>"
exit 1
fi
#sets up source and dest folder names
src=$(rel2abs $1)
dst=$(rel2abs $2)
#locates 'uppdeb' and 'idebuild' scripts
uppdeb="`which uppdeb`"
if [ x$uppdeb = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
uppdeb=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
uppdeb=$(dirname $uppdeb)/uppdeb
fi
if [ ! -f $uppdeb ]
then
echo "ERROR - Could not find 'uppdeb' script"
echo "Please check if it's on current path"
exit 1
fi
idebuild="`which idebuild`"
if [ x$idebuild = x ]
then
# couldn't find it on path, just try on this script's path
LSOF=$(lsof -p $$ 2>/dev/null | grep -E "/"$(basename $0)"$")
idebuild=$(echo $LSOF | sed -r s/'^([^\/]+)\/'/'\/'/1 2>/dev/null)
idebuild=$(dirname $idebuild)/idebuild
fi
if [ ! -f $idebuild ]
then
echo "ERROR - Could not find 'idebuild' script"
echo "Please check if it's on current path"
exit 1
fi
#checks if source folder is an upp svn folder
if [ -d $src/.svn ]
then
true
else
echo "Source folder is not an SVN one."
exit 1
fi
for name in uppsrc examples tutorial reference bazaar
do
if [ ! -d $src/$name ]
then
echo "bad source folder '$src'"
echo "missing '$src/$name' subfolder"
exit 1
fi
done
#do an svn update in svn folder, just to be sure that's the latest
cd $src
#gets svn release
if [ -e ./.svn/entries ]
then
while read release
do
if [ "$release" = "dir" ]
then
read release
break
fi
done < ./.svn/entries
else
echo "$0: error: file not found!"
exit 1
fi
echo "building .deb for SVN release $release"
#now patch uppsrc/ide/version.h file to match current svn build
mv $src/uppsrc/ide/version.h $src/uppsrc/ide/version.h.BACKUP
echo "#define IDE_VERSION \"SVN.$release\"" > $src/uppsrc/ide/version.h
#creates a temporary folder for executable file
outtmp="`mktemp -t -d uppsvn2deb.XXXXXXX`"
#build theide
echo "building TheIDE......"
$idebuild $src $outtmp/theide-svn
if [ $? = 0 ]
then
true
else
echo "Error building TheIDE"
echo "Please check executables for errors"
exit 1
fi
#creates the deb package
echo "Creating package......"
$uppdeb $src $outtmp/theide-svn $dst SVN.$release
result=$?
#resets uppsrc/ide/version.h file
rm $src/uppsrc/ide/version.h
mv $src/uppsrc/ide/version.h.BACKUP $src/uppsrc/ide/version.h
#remove temporary folder
rm -rf $outtmp