#!/bin/sh
# apt-get the packages we always need.

# Define HAVE_X=true if you're installing from a terminal but want to
# install the X apps anyway.
# The following should work in most cases:
if which xclock || [ -e /usr/bin/X11 ]; then HAVE_X=true; fi

[ -z $DISPLAY ] || HAVE_X=true
[ -z $HAVE_X  ] && HAVE_X=false

if $HAVE_X; then
    sudo apt-get -y install \
	 emacs xdu xbase-clients gitk git-gui xterm xttitle	\
	 dconf-editor x11-xfs-utils
else
    sudo apt-get -y install emacs-nox
fi

# All we really need for bootstrapping are git, make, and openssh-client.
# This gets us the rest of the really basic stuff.  This mostly duplicates
# the packages in bootstrap.sh, and includes make because we can't be sure
# that it isn't being invoked directly.
#
sudo apt-get -y install \
     git git-doc git.el gitk git-extras curl make-doc wget rsync zile      \
     openssh-client openssh-server gdebi memtest86+ ntp lynx elinks        \
     emacs-goodies-el elpa-markdown-mode units bash-doc ack                \
     sysbench lm-sensors tidy pm-utils whois make smartmontools pandoc

sudo apt-get -y install emacs-common-non-dfsg || sudo apt-get -y install emacs25-common-non-dfsg \
    || echo FIXME



