#!/bin/bash

source /usr/share/slackdev/buildkit.sh
export PKGNAM=bitchx
export VERSION=1.1
export BUILD=1
export ARCH=arm
export PKGSERIES=n
export SLACKPACKAGE=$PKGNAM-$VERSION-$ARCH-$BUILD.tgz

# Reset the ARM file system: restore it to the 'factory settings'
# as it were:
sboxsysrestore

# Ensure base ARM packages are installed first:
slackbasedeps

# Ensure $PKGNAM isn't already installed:
slackfailpkgdeps $PKGNAM || removepkg $PKGNAM

# Ensure additional dependencies:
{ slackcheckpkgdeps mysql   || installpkg $PKGSTORE/ap/mysql-*.tgz || exit 99 ; }
{ slackcheckpkgdeps ncurses || installpkg $PKGSTORE/l/ncurses-*.tgz || exit 99 ; }
{ slackcheckpkgdeps openssl || installpkg $PKGSTORE/n/openssl-*.tgz || exit 99 ; }

# Launch the package build script:
./trackbuild.bitchx

# Compress the build log:
bzip2 -9f build.$ARCH.log
