#!/bin/sh
# Set initial variables:
CWD=`pwd`

VERSION=2.59
ARCH=noarch
BUILD=1

if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
PKG=$TMP/package-autoconf
rm -rf $PKG
mkdir -p $PKG
cd $TMP
rm -rf autoconf-$VERSION
tar xjvf $CWD/autoconf-$VERSION.tar.bz2
cd autoconf-$VERSION
chown -R root.root .
find . -perm 444 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 666 -exec chmod 644 {} \;
./configure --prefix=/usr
make
make install DESTDIR=$PKG
chown -R root.bin $PKG/usr/bin
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*
gzip -9 $PKG/usr/man/man1/*.?
mkdir -p $PKG/usr/doc/autoconf-$VERSION
cp -a \
  AUTHORS BUGS COPYING INSTALL NEWS README THANKS TODO \
  $PKG/usr/doc/autoconf-$VERSION
mkdir -p $PKG/install
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
makepkg -l y -c n $TMP/autoconf-$VERSION-$ARCH-$BUILD.tgz