# Exit on error:
set -e

wget http://ftpmirror.gnu.org/emacs/emacs-24.4.tar.xz
tar xf emacs-24.4.tar.xz
mkdir emacs-build
cd emacs-build

../emacs-24.4/configure \
    --prefix= \
    --without-all \
    --without-x

make
make install
cd ..
rm -rf emacs-build
rm -rf emacs-24.4
rm emacs-24.4.tar.xz

# Fix permissions for Package Users:
chmod g+w,o+t /share/emacs/24.4/etc
chmod g+w,o+t /share/emacs/24.4/lisp
chmod g+w,o+t /share/emacs/site-lisp

exit 0
