#!/bin/bash

piece=$1
ooo_build_tag=$2

source $OO_TOOLSDIR/piece/sys-setup

# math subpackages
$OO_TOOLSDIR/piece/merge-file-lists "files-math.txt" $DESTDIR/gid_Module_Prg_Math_Bin
$OO_TOOLSDIR/piece/desktop-support-app "math" "$ooo_build_tag" "math"

# merge the rest
$OO_TOOLSDIR/piece/merge-file-lists "files-$piece.txt" $DESTDIR/gid_*
$OO_TOOLSDIR/piece/desktop-support-app "$piece" "$ooo_build_tag" "$piece"
$OO_TOOLSDIR/piece/desktop-support-app "$piece" "$ooo_build_tag" "web"

# install the prebuilt registry files
$OO_TOOLSDIR/piece/install-registry $piece $ooo_build_tag "$piece"
$OO_TOOLSDIR/piece/install-registry $piece $ooo_build_tag "math"

# prune redundant files the scp2 likes to make for us
remove_file "files-$piece.txt" "$OO_INSTDIR/basis$VERSION/ure-link"
