mk_source_dir  "${SOURCE_DIRECTORY}"  &&
cd  "${SOURCE_DIRECTORY}"             &&
unpack_file  ''                       &&
cd  comm-*                            &&

patch -p1 < $SPELL_DIRECTORY/0001-remove-version-number-from-thunderbird-s-installatio.patch &&

cp -v "${SPELL_DIRECTORY}"/mozconfig .mozconfig &&

# Be explicit: stripped install is the default.
if [[ "$THUNDERBIRD_STRIP" == "y" ]]; then
  echo 'ac_add_options --enable-install-strip' >> .mozconfig
else
  echo 'ac_add_options --disable-install-strip' >> .mozconfig
fi &&

if [[ "$THUNDERBIRD_SDK" == "n" ]]; then
  sed -i 's/^\(INSTALL_SDK = .*\)$/#\1/' mail/installer/Makefile.in
fi &&

if [[ "$THUNDERBIRD_OFFICIAL" == y ]]; then
  echo 'ac_add_options --enable-official-branding' >> .mozconfig
fi
