#!/bin/bash

piece=$1
ooo_build_tag=$2

source $OO_TOOLSDIR/piece/sys-setup

# icon themes subpackages
$OO_TOOLSDIR/piece/merge-file-lists "files-icon-themes.txt" $DESTDIR/gid_Module_Root_Files_Images

# generate the common file list
$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
$OO_TOOLSDIR/piece/desktop-support-app "$piece" "$ooo_build_tag" "fromtemplate"
$OO_TOOLSDIR/piece/desktop-support-app "$piece" "$ooo_build_tag" "ooffice"

# FIXME: about, intro are not isntalled by the installer
if test "$OOO_BUILD_NOARCH" = 'YES' ; then
    # create only symlinks; the icons will be packaged separately
    ln -sf $OO_INSTDIR_SHARE/program/about.bmp $DESTDIR$OO_INSTDIR/program
    ln -sf $OO_INSTDIR_SHARE/program/intro.bmp $DESTDIR$OO_INSTDIR/program
else
    cp $OO_SOLVERDIR/default_images/introabout/about.bmp $DESTDIR$OO_INSTDIR/program || exit 1;
    cp $OO_SOLVERDIR/default_images/introabout/intro.bmp $DESTDIR$OO_INSTDIR/program || exit 1;
fi    
echo "$OO_INSTDIR/program/about.bmp" >>files-$piece.txt
echo "$OO_INSTDIR/program/intro.bmp" >>files-$piece.txt
