THUNDERBIRD_HOME=${INSTALL_ROOT}/usr/lib/thunderbird &&
mkdir -p $THUNDERBIRD_HOME &&
ln -s $THUNDERBIRD_HOME $THUNDERBIRD_HOME-$VERSION &&

rm -f $THUNDERBIRD_HOME/chrome/app-chrome.manifest &&
make install &&

cd ${INSTALL_ROOT}/usr/lib/thunderbird &&
export LD_LIBRARY_PATH="$THUNDERBIRD_HOME" &&
export MOZILLA_FIVE_HOME="$THUNDERBIRD_HOME" &&
$SOURCE_DIRECTORY/comm-1.9.2/mozilla/dist/bin/regxpcom &&
touch `find . -name *.rdf` &&


#
# Create symlink from NSS Root CA store, if it exists.  NSS requires this
# to be in the same directory as the current application binary.  See:
# http://www.mozilla.org/projects/security/pki/nss/loadable_certs.html
# https://bugzilla.mozilla.org/show_bug.cgi?id=128290
# Only create if $THUNDERBIRD_HOME/libnssckbi.so does not exist or is already a
# symlink.
#
if  test  -f   $INSTALL_ROOT/usr/lib/libnssckbi.so;  then
  if  !  test  -f   $THUNDERBIRD_HOME/libnssckbi.so  ||
         test  -h   $THUNDERBIRD_HOME/libnssckbi.so; then
    ln -sf $TRACK_ROOT/usr/lib/libnssckbi.so  $THUNDERBIRD_HOME/libnssckbi.so
  fi                                                                  
fi  &&

#
# Bug #13846 (remove broken symlinks)
#
rm -f  $INSTALL_ROOT/usr/lib/thunderbird/install/mozilla-installer      \
       $INSTALL_ROOT/usr/lib/thunderbird/install/mozilla-installer-bin
