#!/bin/sh
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-slocate
VERSION=2.7
ARCH=alpha
BUILD=1
TARGET=$ARCH-alphaslack-linux

mkdir -p $PKG
cd $PKG
explodepkg $CWD/_slocate.tar.gz
( cd $TMP
tar xzf $CWD/slocate-$VERSION.tar.gz
cd slocate-$VERSION
./autogen.sh
make clean
./configure --prefix=/usr $TARGET
# Developers SHOULD NOT require a certain version of autoconf/make!
make clean
make
strip slocate
cat slocate > $PKG/usr/bin/slocate
mkdir -p $PKG/usr/man/man1
zcat doc/slocate.1.linux.gz | gzip -9c > $PKG/usr/man/man1/slocate.1.gz
zcat doc/updatedb.1.gz | gzip -9c > $PKG/usr/man/man1/updatedb.1.gz
mkdir -p $PKG/usr/doc/slocate-$VERSION
cp -a AUTHORS ChangeLog INSTALL LICENSE README $PKG/usr/doc/slocate-$VERSION
chmod 644 $PKG/usr/doc/slocate-$VERSION/*
chown -R root.root $PKG/usr/doc/slocate-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
makepkg -l y -c n $TMP/slocate-$VERSION-$ARCH-$BUILD.tgz
) 2>&1 | tee $TMP/slocate.build.log
