BLD=$SOURCE_DIRECTORY/build &&
SRC=$SOURCE_DIRECTORY &&
cd $BLD/firebird &&
local DEST &&
# config files
DEST=$INSTALL_ROOT/etc/firebird3   &&
mkdir -p $DEST &&
chown firebird:firebird $DEST     &&
# treate the security db as a config file
install_config_file security3.fdb $DEST/security3.fdb &&
chown firebird:firebird $DEST/security3.fdb  &&
# link to config files
FROM=$FB_PREFIX/firebird &&
mkdir -p $FROM &&
TGT=$TRACK_ROOT/etc/firebird3    &&
ln -vsf $TGT/security3.fdb  $FROM &&
for FF in firebird databases plugins fbtrace; do
  install_config_file $FF.conf $DEST/$FF.conf &&
  chown firebird:firebird $DEST/$FF.conf &&
  ln -vsf $TGT/$FF.conf $FROM
done &&

DEST=$FB_PREFIX/firebird &&
mkdir -p $DEST  &&
# install the built tree
cp -a * $DEST    &&

cd $BLD/src &&
cp msg.fdb help.fdb $DEST &&

DEST=$FB_PREFIX/firebird/include/firebird  &&
mkdir -p $DEST   &&
# need the impl/boost files; copy them as well
cp -a $SRC/src/include/firebird/impl $DEST &&

# need some symlinks

TGT=$TRACK_ROOT/$FB_PREFIX/firebird &&

FROM=$INSTALL_ROOT/usr/include   &&
mkdir -p $FROM &&

ln -vsf $TGT/include/ibase.h   $FROM &&
ln -vsf $TGT/include/iberror.h $FROM &&
ln -vsf $TGT/include/ib_util.h $FROM &&
ln -vsf $TGT/include/firebird  $FROM &&

FROM=$INSTALL_ROOT/usr/lib &&
mkdir -p $FROM &&
ln -vsf $TGT/lib/libfbclient.so $FROM &&
#ln -vsf $TGT/lib/libib_util.so  $FROM &&
# need a symlink for firebird.log
TGT=$TRACK_ROOT/var/log/firebird.log &&
ln -vsf $TGT    $DEST
