3
export CAIRO_DOCK_DIR=`pwd`/..
4
export CAIRO_DOCK_PREFIX=/usr
5
export CAIRO_DOCK_AUTORECONF="0"
6
export CAIRO_DOCK_CLEAN="0"
7
export CAIRO_DOCK_COMPIL="0"
8
export CAIRO_DOCK_UNSTABLE="0"
9
export CAIRO_DOCK_INSTALL="0"
10
export CAIRO_DOCK_DOC="0"
11
export CAIRO_DOCK_EXCLUDE="template stacks"
12
export CAIRO_DOCK_GLITZ_OPTION=""
13
export CAIRO_DOCK_PLUG_INS_OPTION=""
17
echo "this script will process : "
18
while getopts "acCituhd:Dgm" flag
20
echo " option $flag $OPTIND $OPTARG"
23
echo " => re-generation of files"
24
export CAIRO_DOCK_AUTORECONF="1"
28
export CAIRO_DOCK_CLEAN="1"
31
echo " => compilation"
32
export CAIRO_DOCK_COMPIL="1"
35
echo " => installation"
36
export CAIRO_DOCK_INSTALL="1"
39
echo " => include unstable applets"
40
export CAIRO_DOCK_UNSTABLE="1"
43
echo " => use folder $OPTARG"
44
export CAIRO_DOCK_DIR="$OPTARG"
47
echo " => build documentation $OPTARG"
48
export CAIRO_DOCK_DOC="1"
51
echo " => enable glitz"
52
export CAIRO_DOCK_GLITZ_OPTION="--enable-glitz"
55
echo " => minimum requirements"
56
export CAIRO_DOCK_PLUG_INS_OPTION="--without-mail --without-weblet"
59
echo "-a : run autoreconf"
62
echo "-i : install (will ask root password)"
63
echo "-u : include still unstable applets"
64
echo "-d rep : compile in the folder 'rep'"
68
echo "unexpected argument"
73
export CAIRO_DOCK_EXTRACT_MESSAGE=${CAIRO_DOCK_DIR}/utils/cairo-dock-extract-message
74
export CAIRO_DOCK_GEN_TRANSLATION=${CAIRO_DOCK_DIR}/cairo-dock/po/generate-translation.sh
78
rm -f $CAIRO_DOCK_DIR/compile.log
81
find . -name linguas -execdir mv linguas LINGUAS \;
82
find . -name potfiles.in -execdir mv potfiles.in POTFILES.in \;
85
cd $CAIRO_DOCK_DIR/cairo-dock
86
echo "*********************************"
87
echo "* Compilation of cairo-dock ... *"
88
echo "*********************************"
89
if test "$CAIRO_DOCK_CLEAN" = "1"; then
90
rm -f config.* configure configure.lineno intltool-extract intltool-merge intltool-update libtool ltmain.sh Makefile.in Makefile aclocal.m4 install-sh install depcomp missing compile cairo-dock.pc stamp-h1 cairo-dock.conf
91
rm -rf autom4te.cache src/.deps src/.libs src/Makefile src/Makefile.in po/Makefile po/Makefile.in po/*.gmo src/*.o src/*.lo src/*.la
92
if test "$CAIRO_DOCK_DOC" = "1"; then
97
if test "$CAIRO_DOCK_AUTORECONF" = "1"; then
99
echo "generating translation files ..."
100
if test -x $CAIRO_DOCK_EXTRACT_MESSAGE; then
104
$CAIRO_DOCK_EXTRACT_MESSAGE $c
106
$CAIRO_DOCK_EXTRACT_MESSAGE data/ChangeLog.txt
109
$CAIRO_DOCK_GEN_TRANSLATION
112
echo "* configuring ..."
113
/usr/bin/time -f " time elapsed : %Us" autoreconf -isf > /dev/null && ./configure --prefix=$CAIRO_DOCK_PREFIX $CAIRO_DOCK_GLITZ_OPTION > /dev/null
114
if test ! "$?" = "0"; then
115
echo " Attention : an error has occured !"
116
echo "Error while configuring cairo-dock" >> $CAIRO_DOCK_DIR/compile.log
121
if test "$CAIRO_DOCK_CLEAN" = "1" -a -e Makefile; then
122
make clean > /dev/null
124
if test "$CAIRO_DOCK_COMPIL" = "1"; then
125
echo "* compiling ..."
126
/usr/bin/time -f " time elapsed : %Us" make > /dev/null
127
if test ! "$?" = "0"; then
128
echo " Attention : an error has occured !"
129
echo "Error while compiling cairo-dock" >> $CAIRO_DOCK_DIR/compile.log
134
if test "$CAIRO_DOCK_DOC" = "1"; then
135
echo "* generating documentation ..."
137
/usr/bin/time -f " time elapsed : %Us" doxygen dox.config > /dev/null
138
if test ! "$?" = "0"; then
139
echo " Attention : an error has occured !"
140
echo "Error while generating documentation" >> $CAIRO_DOCK_DIR/compile.log
146
if test "$CAIRO_DOCK_INSTALL" = "1"; then
147
echo "* installation of cairo-dock..."
148
$SUDO rm -f $CAIRO_DOCK_PREFIX/bin/cairo-dock
149
$SUDO rm -rf $CAIRO_DOCK_PREFIX/share/cairo-dock
150
$SUDO rm -rf $CAIRO_DOCK_PREFIX/lib/cairo-dock
151
/usr/bin/time -f " time elapsed : %Us" $SUDO make install > /dev/null
152
if test ! "$?" = "0"; then
153
echo " Attention : an error has occured !"
154
echo "Error while installing cairo-dock" >> $CAIRO_DOCK_DIR/compile.log
158
$SUDO chmod +x $CAIRO_DOCK_PREFIX/bin/cairo-dock-update.sh
159
$SUDO chmod +x $CAIRO_DOCK_PREFIX/bin/launch-cairo-dock-after-beryl.sh
160
$SUDO chmod +x $CAIRO_DOCK_PREFIX/bin/cairo-dock-package-theme.sh
164
### On liste les plug-ins a compiler.
165
cd $CAIRO_DOCK_DIR/plug-ins
166
export liste_stable="`sed "/^#/d" Applets.stable`"
167
export liste_all="`find . -maxdepth 1 -type d | cut -d "/" -f 2 | /bin/grep -v '\.'`"
168
if test "$CAIRO_DOCK_UNSTABLE" = "1"; then
169
export liste_plugins="`echo $liste_all`"
171
export liste_plugins="`echo $liste_stable`"
173
echo "the following applets will be compiled :"
174
echo "$liste_plugins"
176
echo "*************************************"
177
echo "* Compilation of stable modules ... *"
178
echo "*************************************"
180
### on extrait les messages des plug-ins a traduire.
181
if test "$CAIRO_DOCK_AUTORECONF" = "1"; then
182
echo "extracting sentences to translate..."
183
for plugin in $liste_plugins
185
if test -d $plugin; then
187
if test -e Makefile.am -a "$plugin" != "$CAIRO_DOCK_EXCLUDE"; then
189
echo "generating translation files for $plugin ..."
190
if test -x $CAIRO_DOCK_EXTRACT_MESSAGE; then
194
$CAIRO_DOCK_EXTRACT_MESSAGE "$c"
198
$CAIRO_DOCK_GEN_TRANSLATION # defient obsolete.
208
$CAIRO_DOCK_GEN_TRANSLATION all
212
### On compile les plug-ins stables en une passe.
214
if test "$CAIRO_DOCK_AUTORECONF" = "1"; then
215
echo "* configuring stable plug-ins ..."
216
/usr/bin/time -f " time elapsed : %Us" autoreconf -isf > /dev/null && ./configure $CAIRO_DOCK_PLUG_INS_OPTION --prefix=$CAIRO_DOCK_PREFIX > /dev/null
217
if test ! "$?" = "0"; then
218
echo " Attention : an error has occured !"
219
echo "Error while configuring stable plug-ins" >> $CAIRO_DOCK_DIR/compile.log
225
if test "$CAIRO_DOCK_CLEAN" = "1" -a -e Makefile; then
226
make clean > /dev/null
228
if test "$CAIRO_DOCK_COMPIL" = "1"; then
229
echo "* compiling stable plug-ins ..."
230
/usr/bin/time -f " time elapsed : %Us" make > /dev/null
231
if test ! "$?" = "0"; then
232
echo " Attention : an error has occured !"
233
echo "Error while compiling stable plug-ins" >> $CAIRO_DOCK_DIR/compile.log
239
if test "$CAIRO_DOCK_INSTALL" = "1"; then
240
echo "* installation of stable plug-ins ..."
241
/usr/bin/time -f " time elapsed : %Us" $SUDO make install > /dev/null
242
if test ! "$?" = "0"; then
243
echo " Attention : an error has occured !"
244
echo "Error while installing stable plug-ins" >> $CAIRO_DOCK_DIR/compile.log
251
### On les compilera un a un si la compil globale a foirre.
252
if test "$compil_ok" = "0"; then
253
if test "$CAIRO_DOCK_UNSTABLE" = "0"; then
254
export liste_all="$liste_stable"
256
export liste_stable=""
259
### On compile un a un les plug-ins instables.
260
if test "$CAIRO_DOCK_UNSTABLE" = "1" -o "$compil_ok" = "0"; then
261
for plugin in $liste_all
263
if test "`echo $liste_stable | grep $plugin`" = ""; then
266
for e in $CAIRO_DOCK_EXCLUDE
268
if test "$e" = "$plugin"; then
272
if test -e Makefile.am -a "$exluded" != "1"; then
274
echo "************************************"
275
echo "* Compilation of module $plugin ... *"
276
echo "************************************"
277
if test "$CAIRO_DOCK_CLEAN" = "1"; then
278
rm -f config.* configure configure.lineno intltool-extract intltool-merge intltool-update libtool ltmain.sh Makefile.in Makefile aclocal.m4 missing stamp-h1 depcomp compile install-sh
279
rm -rf autom4te.cache src/.deps src/.libs src/Makefile src/Makefile.in po/Makefile po/Makefile.in po/*.gmo src/*.o src/*.lo src/*.la
281
if test "$CAIRO_DOCK_AUTORECONF" = "1"; then
283
if test -x $CAIRO_DOCK_EXTRACT_MESSAGE; then
287
$CAIRO_DOCK_EXTRACT_MESSAGE $c
291
$CAIRO_DOCK_GEN_TRANSLATION
294
echo "* configuring ..."
295
/usr/bin/time -f " time elapsed : %Us" autoreconf -isf > /dev/null && ./configure --prefix=$CAIRO_DOCK_PREFIX $CAIRO_DOCK_GLITZ_OPTION > /dev/null
296
if test ! "$?" = "0"; then
297
echo " Attention : an error has occured !"
298
echo "Error while configuring $plugin" >> $CAIRO_DOCK_DIR/compile.log
303
if test "$CAIRO_DOCK_CLEAN" = "1" -a -e Makefile; then
304
make clean > /dev/null
306
if test "$CAIRO_DOCK_COMPIL" = "1"; then
307
echo "* compiling ..."
308
/usr/bin/time -f " time elapsed : %Us" make > /dev/null
309
if test ! "$?" = "0"; then
310
echo " Attention : an error has occured !"
311
echo "Error while compiling $plugin" >> $CAIRO_DOCK_DIR/compile.log
316
if test "$CAIRO_DOCK_INSTALL" = "1"; then
317
echo "* installation of module $plugin..."
318
/usr/bin/time -f " time elapsed : %Us" $SUDO make install > /dev/null
319
if test ! "$?" = "0"; then
320
echo " Attention : an error has occured !"
321
echo "Error while installing $plugin" >> $CAIRO_DOCK_DIR/compile.log
332
if test "$CAIRO_DOCK_INSTALL" = "1"; then
333
$SUDO rm -f $CAIRO_DOCK_PREFIX/lib/cairo-dock/*.la
337
date +"compil ended at %c"
338
ls -l $CAIRO_DOCK_PREFIX/bin/cairo-dock
339
ls -l $CAIRO_DOCK_PREFIX/lib/cairo-dock
340
# nb_plugins = "`ls $CAIRO_DOCK_PREFIX/lib/cairo-dock/*.so | wc -w`"
344
echo "number of lines/word/caracters of sources (.c only) :"
345
sed '/^ *$/d' cairo-dock/src/*.c plug-ins/*/src/*.c | sed '/^\t*$/d' | sed '/^\t*\/\/*/d' | sed '/\t*\/\*/d' | wc
347
if test -e compile.log; then
348
echo "\033[8;34mSome errors were encountered :\033[0m"
351
echo "Compile is a success !"