#!/bin/bash -ex

# Last changed Wed Mar  3 16:21:41 EST 2010

trap '
SAVEDSTATUS=$?
set +x
if [ x$CLEANEXIT = x ]
then
	echo "$0: ERROR Unexpected exit with return value of $SAVEDSTATUS"
	exit $SAVEDSTATUS
fi' EXIT

#-----

# ssh adjustments

sed \
	-e 's/#   ForwardX11 no/    ForwardX11 yes/' \
	-e 's/#   ForwardX11Trusted yes/    ForwardX11Trusted yes/' \
	-e 's/HashKnownHosts yes/HashKnownHosts no/' \
	< /etc/ssh/ssh_config > /tmp/ssh_config
cat /tmp/ssh_config > /etc/ssh/ssh_config

apt-get -y install build-essential gcc-4.3-doc libstdc++6-4.3-doc

apt-get -y install emacs22 emacs22-el
# no elisp-manual package or similar by that name anymore

apt-get -y install auctex
# Suggested packages:
#   catdvi dvipng lacheck debhelper perl-tk
#
# Also now brings in base tex itself

apt-get -y install gnuserv

### apt-get -y install gnus # wants emacs 21

apt-get -y install mailcrypt

apt-get -y install bbdb

apt-get -y install vm

apt-get -y install metamail
# XXX suggests mailx

apt-get -y install texlive texlive-doc-en dvipdfmx lmodern tipa prosper latex-beamer latex-xcolor texpower texpower-manual texpower-examples texlive-generic-extra cm-super texlive-latex-extra texlive-full

# Paper size
texconfig-sys dvips paper letter
texconfig-sys pdftex paper letter
texconfig-sys dvipdfm paper letter
texconfig-sys xdvi paper us
texconfig-sys mode ljfour
### echo letter > /etc/papersize	# is already set to letter

apt-get -y install gfortran gfortran-multilib gfortran-doc gfortran-4.3-multilib gfortran-4.3-doc libgfortran3-dbg
# Suggested packages:
#   lib32mudflap0

# XXX can't find package refblas3
#apt-get -y install refblas3 refblas3-doc

apt-get -y install r-base curl r-doc-info r-doc-pdf r-doc-html r-base-latex r-base-dev r-mathlib cdbs debhelper tclreadline autoconf2.13 autobook autoconf-archive autoconf-doc libtool automake

apt-get -y install ess
# Suggested packages:
#   xlispstat r-base r-base-core pspp

apt-get -y install xpdf

apt-get -y install gv

apt-get -y install acroread acroread-plugins mozilla-acroread acroread-l10n-en acroread-dictionary-en

apt-get -y install ntp ntp-doc

apt-get -y install enscript

apt-get -y install psutils

apt-get -y install pdftk

apt-get -y install page-crunch

apt-get -y install thunderbird thunderbird-gnome-support latex-xft-fonts

# XXX do I really want xfs and the fonts?
apt-get -y install flashplugin-nonfree msttcorefonts ttf-xfree86-nonfree xfs

apt-get -y install java-common ubuntu-restricted-extras sun-java6-fonts

### default-jre default-jdk

# removed mh-e as changes too radical

apt-get -y install openoffice.org cli-uno-bridge openoffice.org-evolution openoffice.org-dev-doc openoffice.org-dev openoffice.org-gcj openoffice.org-starter-guide libooolib-perl openoffice.org-report-builder fig2sxd wpd2sxw writer2latex wps2sxw writer2latex-manual libwriter2latex-java-doc thescoder openoffice.org-presentation-minimizer odt2txt

# NOT openoffice.org-dmaths, creates a separate ugly toolbar menu

apt-get -y install filezilla

#-----

CLEANEXIT=1
exit 0

