#!/bin/sh
# ResidualVM Slackware 9(.1) Package Creation Script
# Initial version by Jay Lanagan <roni@parodius.com>
# Updated by Robert Kelsen <rkelsen@optusnet.com.au>

CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
PKG=$TMP/package-residualvm

VERSION=0.3.1
ARCH=i486
BUILD=1

if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
if [ ! -d $PKG ]; then
  mkdir -p $PKG
fi

#cd $TMP
tar xvf residualvm-$VERSION.tar.bz2
cd residualvm-$VERSION
./configure --prefix=/usr --bindir=/usr/games --enable-release
make
strip residualvm
make install DESTDIR=$PKG
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
chown -R root.root .
makepkg -l y -c n $TMP/residualvm-$VERSION-$ARCH-$BUILD.tgz

if [ "$1" = "--cleanup" ]; then
  rm -rf $TMP/residualvm-$VERSION
  rm -rf $PKG
fi
