#!/bin/sh
#############################
## Build script for:kslack_etc
## Creator: mangus@deprecated.it <http://www.deprecated.it>
## Date: 23/09/2006
## Builds package: Yes
## 
## Updated on 18/03/2008 by davide77
## Changes: the start script won't work on slackware 12.0, now it sould work on
## any version

CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
PKG=$TMP/package
NAME=slackSuite
VERSION=1.0.1a
ARCH=${ARCH:-noarch}
BUILD=1dav

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

cd $TMP
tar xzvf $CWD/$NAME-$VERSION.tar.gz
cd $NAME-$VERSION
chown -R root.root .
mkdir -p $PKG/usr/bin
cp -a slackSuite slackSuite.kmdr  $PKG/usr/bin
mkdir -p $PKG/usr/doc/$NAME-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
cd $PKG
makepkg -l y -c n $CWD/../$NAME-$VERSION-$ARCH-$BUILD.tgz

if [ "$1" = "--cleanup" ]; then
 rm -rf $TMP
fi

