nyam.imagine/builder-targets-cb.sh

62 lines
3.1 KiB
Bash
Raw Normal View History

2013-03-26 09:38:37 +01:00
##############################################################################
# This optional file "builder-targets-cb.sh" will be called by builder.sh
#
# The targets will be called from thde opsi-builder using the following
# order: config, prepare, retrieve, create, package, publish, commit, cleanup
# You can overwrite the target functions in builder-targets-cb.sh
#
# You can define callback functions. The functions are called from
# opsi-builder within processing a target
# cb_package_makeproductfile
#
# You can use every variable defined in any configuration file or by
# the defined builder script itself. Also, calling the predefined
# targets builder_<targetname> is possible.
#
# Abstract:
# target order: config, prepare, retrieve, create, package, publish, commit, cleanup
# callbacks: <none>
#
##############################################################################
function cleanup() {
echo "Cleanup"
builder_cleanup
}
2013-03-26 11:43:57 +01:00
function create() {
echo "Create"
builder_create
cp $INST_DIR/CLIENT_DATA/opsi-${PN}.ini $INST_DIR/CLIENT_DATA/Imagine.ini
mkdir $INST_DIR/CLIENT_DATA/X86/Icons
mkdir $INST_DIR/CLIENT_DATA/X86_64/Icons
mkdir $INST_DIR/CLIENT_DATA/ALL/Icons
pushd $INST_DIR/CLIENT_DATA/ALL/
for type in ${WINST_VALUE[0]}
do
# 256x256
convert -size 256x256 xc:transparent -font DejaVu-Sans-Condensed-Bold -pointsize 70 -fill white -draw "gravity south text 0,5 '$type'" $type-256x256-txt.png
composite -quality 100 $type-256x256-txt.png $INST_DIR/CLIENT_DATA/ALL/tmpicon/icon_imagine_24bit_256x256.png $type-256x256.png
# 128x128
convert -size 128x128 xc:transparent -font DejaVu-Sans-Condensed-Bold -pointsize 37 -fill white -draw "gravity south text 0,2 '$type'" $type-128x128-txt.png
composite -quality 100 $type-128x128-txt.png $INST_DIR/CLIENT_DATA/ALL/tmpicon/icon_imagine_24bit_128x128.png $type-128x128.png
# 64x64
convert -size 64x64 xc:transparent -font DejaVu-Sans-Condensed-Bold -pointsize 19 -fill white -draw "gravity south text 0,1 '$type'" $type-64x64-txt.png
composite -quality 100 $type-64x64-txt.png $INST_DIR/CLIENT_DATA/ALL/tmpicon/icon_imagine_24bit_64x64.png $type-64x64.png
# 48x48
convert -size 48x48 xc:transparent -font DejaVu-Sans-Condensed-Bold -pointsize 14 -fill white -draw "gravity south text 0,1 '$type'" $type-48x48-txt.png
composite -quality 100 $type-48x48-txt.png $INST_DIR/CLIENT_DATA/ALL/tmpicon/icon_imagine_24bit_48x48.png $type-48x48.png
# 16x16
convert -size 16x16 xc:transparent -font DejaVu-Sans-Condensed-Bold -pointsize 8 -fill white -draw "gravity south text 0,0 '$type'" $type-16x16-txt.png
composite -quality 100 $type-16x16-txt.png $INST_DIR/CLIENT_DATA/ALL/tmpicon/icon_imagine_24bit_16x16.png $type-16x16.png
# combine the images into a icon
icotool -c -o $INST_DIR/CLIENT_DATA/ALL/Icons/$type.ico $type-256x256.png $type-128x128.png $type-64x64.png $type-48x48.png $type-16x16.png
done
popd
cp $INST_DIR/CLIENT_DATA/ALL/Icons/*.ico $INST_DIR/CLIENT_DATA/X86/Icons
cp $INST_DIR/CLIENT_DATA/ALL/Icons/*.ico $INST_DIR/CLIENT_DATA/X86_64/Icons
rm -rf $INST_DIR/CLIENT_DATA/ALL/
}