#!/bin/sh
# Set initial variables:
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-smartmontools
VERSION=5.33
ARCH=alpha
BUILD=1

mkdir -p $PKG
( cd $TMP
tar xzf $CWD/smartmontools-$VERSION.tar.gz
cd smartmontools-$VERSION
./configure --prefix=/usr --sysconfdir=/etc --with-docdir=/usr/doc/smartmontools-$VERSION
make
make install DESTDIR=$PKG
strip --strip-unneeded $PKG/usr/sbin/*
chmod 755 $PKG/usr/sbin/*
chown -R root.bin $PKG/usr/sbin
gzip -9 $PKG/usr/man/man{5,8}/*
chmod 644 $PKG/usr/doc/smartmontools-$VERSION/*
chown -R root.root $PKG/usr/doc/smartmontools-$VERSION
rm -rf $PKG/etc/rc.d
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
makepkg -l y -c n $TMP/smartmontools-$VERSION-$ARCH-$BUILD.tgz
) 2>&1 | tee $TMP/smartmon.build.log
