#!/bin/sh
CWD=`pwd` 
VERSION=1.0.1
cd /tmp
tar xzvf $CWD/sawfish-$VERSION.tar.gz
cd sawfish-$VERSION
zcat $CWD/sawfish-$VERSION.locale.diff.gz | patch -p1 --verbose --backup --suffix=.orig
CFLAGS=-O2 ./configure --prefix=/usr \
                       --localstatedir=/var/lib \
                       --with-x \
                       --with-readline \
                       --with-audiofile \
                       --with-esd \
                       --enable-capplet \
                       --enable-themer \
                       i386-slackware-linux
make
make install
mkdir -p /usr/doc/sawfish-$VERSION
cp -a \
  AUTHORS BUGS COPYING ChangeLog FAQ HACKING INSTALL NEWS README THANKS TODO TREE \
  /usr/doc/sawfish-$VERSION
chown -R root.root /usr/doc/sawfish-$VERSION
chmod 644 /usr/doc/sawfish-$VERSION/*
mkdir -p /etc/X11/xinit
cat $CWD/xinitrc.sawfish > /etc/X11/xinit/xinitrc.sawfish
chmod 755 /etc/X11/xinit/xinitrc.sawfish
# Add gorilla theme:
cp $CWD/sawfish-gorilla-0.1.tar.gz /usr/share/sawfish/themes
( cd /usr/share/sawfish/themes
  tar xzf sawfish-gorilla-0.1.tar.gz
  rm sawfish-gorilla-0.1.tar.gz
  cd gorilla
  chown -R root.root .
  find . -type f | xargs chmod 644
  find . -type d | xargs chmod 755
  cd ..
  tar czf gorilla.tar.gz gorilla
  rm -rf gorilla )
mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc
