function git_install_manpages() {
  for FF in man*; do
    cp -ra $FF $INSTALL_ROOT/usr/share/man
  done
}

function git_install_htmldocs() {
  local GIT_HTML                                &&
  GIT_HTML=$INSTALL_ROOT/usr/share/doc/git/html &&
  mkdir -p $GIT_HTML                            &&
  cp -a *.html howto $GIT_HTML
}

make  HOME="$INSTALL_ROOT/usr"  install  &&

case $GIT_DOC in
  manpages)
    git_install_manpages
  ;;
  htmldocs)
    git_install_htmldocs
  ;;
  both)
    git_install_manpages &&
    git_install_htmldocs
  ;;
esac  &&

if  is_depends_enabled  $SPELL  bash-completion
then
  cp  $SOURCE_DIRECTORY/contrib/completion/git-completion.bash  \
      $INSTALL_ROOT/etc/bash_completion.d/git-completion
fi  &&

if  is_depends_enabled  $SPELL  vim
then
  VIM_VERSION=$(installed_version vim)
  cp  $SOURCE_DIRECTORY/contrib/vim/syntax/gitcommit.vim  \
      $INSTALL_ROOT/usr/share/vim/vim${VIM_VERSION/./}/syntax
fi
