#!/bin/sh
# Set initial variables:
CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi

if [ ! -d $TMP ]; then
  mkdir -p $TMP # location to build the source
fi

VERSION=1.9.1

echo "+=======================+"
echo "| emacspeak-ss-$VERSION |"
echo "+=======================+"
cd $TMP
tar xzvf $CWD/emacspeak-ss-$VERSION.tar.gz
cd emacspeak-ss-$VERSION
chown -R root.root .
find . -perm 775 -exec chmod 755 {} \;
find . -perm 700 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
./configure --prefix=/usr
make
make install
strip /usr/lib/emacs/common/emacspeak/ping-apollo
mkdir -p /usr/doc/emacspeak-ss-$VERSION
cp -a \
  COPYING CREDITS ChangeLog Colors INSTALL OtherSynthesizers README README.accent README.apollo README.braillenspeak README.ciber README.doubletalk README.pchablado TODO TROUBLESHOOTING \
  /usr/doc/emacspeak-ss-$VERSION
mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc