6
# To build Dr. Geo we need:
7
# A virgin image, its source, the virtual machine, the Smalltalk
8
# installation script and the DrGeo source code repository
9
smalltalkImage="Pharo8.0-SNAPSHOT-64bit-278304f"
10
smalltalkSources="Pharo8.0-32bit-278304f.sources"
11
vmExec="`pwd`/VMs/gnulinux/DrGeo64bits/Contents/vm/pharo"
12
installScript="`pwd`/install-drgeo-workstation.st"
13
src="tonel:///home/hilaire/Travaux/Developpement/DrGeoII/trunk/src"
16
buildPath="`pwd`/images"
18
installationPath="bundles"
21
# PRE-CLEAN UP because Pharo is confused with its own cache
22
rm -rf $buildPath/pharo-local $buildPath/package-cache
24
# INSTALL PACKAGE AND CLEAN UP IMAGE
25
# prepare the drgeo image
26
cp $buildPath/$smalltalkImage.image $buildPath/drgeo.image
27
cp $buildPath/$smalltalkImage.changes $buildPath/drgeo.changes
28
# install source code in the drgeo image
29
$vmExec $buildPath/drgeo.image metacello install $src \
30
BaselineOfDrGeo --groups=development
31
# configure the drgeo image
32
$vmExec $buildPath/drgeo.image $installScript
33
ls -lh $buildPath/$smalltalkImage.image
34
echo "--== DONE building DrGeo image ==--"
38
# $1 OS target (gnulinux windows mac)
39
# Empty the bundle space
40
bundlePath="$installationPath/$1"
41
if [[ "$1" == "gnulinux" || "$1" == "windows" ]]
43
bundle="$bundlePath/DrGeo"
45
bundle="$bundlePath/DrGeo.app"
47
bundleTemplate="`pwd`/VMs/$1"
51
rsync -a --exclude '.bzr' --exclude '*~' $bundleTemplate $installationPath
52
cp ../doc/ChangeLog $bundle
53
# install Example files
54
rsync -a --exclude '.bzr' "`pwd`/examples" $bundle
55
rsync -a --exclude '.bzr' "`pwd`/examplesKids/"* $bundle/examples
56
# install Smalltalk sketches files
57
rsync -a --exclude '.bzr' "`pwd`/SmalltalkSketches" $bundle
58
# user sketches and exports folder, splash
59
mkdir $bundle/MySketches
60
mkdir $bundle/MyExports
61
mkdir $bundle/MyShares
62
mkdir $bundle/MyScripts
63
rsync -a graphics/splash.bmp $bundle
64
# install Smalltalk Image
65
rsync -a $buildPath/drgeo.image $bundle/Contents/Resources
66
rsync -a $buildPath/drgeo.changes $bundle/Contents/Resources
67
# install Smalltalk Source
68
rsync -a $buildPath/$smalltalkSources $bundle/Contents/Resources
70
rsync -a fonts/*.tt? $bundle/Contents/Resources
72
rsync -a ../i18n/locale $bundle/Contents/Resources
75
cp $docPath/README.*.txt $docPath/README.txt $bundle/doc
76
mkdir $bundle/doc/userGuide
77
cp $docPath/userGuide/fr/drgeoText/*.txt $bundle/doc/userGuide
80
if [[ "$1" == "gnulinux" ]]
82
chmod +x $bundle/DrGeo.sh
83
chmod +x $bundle/Contents/vm/pharo
84
elif [[ "$1" == "mac" ]]
86
chmod +x $bundle/Contents/MacOS/Pharo
89
# Create an archive out of the bundle
91
zip -r --symlinks -qdgds 5m DrGeo-$1-$rel.zip "`basename $bundle`" -x \*/.bzr/* \*~
92
ls -sh DrGeo-$1-$rel.zip
93
echo "--== DONE packaging DrGeo for $1 ==--"
95
gpg --armor --sign --detach-sign DrGeo-$1-$rel.zip
103
# Package from an already built image:
104
# $1 = --package , $2 = all | gnulinux | windows | mac
105
# Build image and package all bundles:
114
makeBundle "gnulinux"
119
makeBundle "gnulinux"
128
echo -e "Unknow \"$2\" --package argument.\nValid arguments are gnulinux, windows, mac."
134
makeBundle "gnulinux"
139
echo "Usage: makeDrGeo [OPTION] [ARGUMENT]"
141
echo -e "--build\t\t\t\t\tBuild Dr. Geo image"
142
echo -e "--package all|gnulinux|windows|mac\tPackage Dr.Geo with an already built image"
143
echo -e "--all\t\t\t\t\tBuild image and package for all OS"