#!/bin/bash

# arm/build
# Check package dependencies, set metadata and launch
# package build script.
# by Stuart Winter <mozes@slackware.com>
#
source /usr/share/slackdev/buildkit.sh
export PKGNAM=aspell-dict
export VERSION=${VERSION:-NOVER} # versions are set by the file name of the dict archives
export BUILD=${BUILD:-NOVER} # Build numbers are set in the text files in the "build-nums" directory
export PKGSERIES=${PKGSERIES:-l}
export SLACKPACKAGE=$PKGNAM-$VERSION-$PKGARCH-$BUILD.txz

# Ensure base ARM packages are installed first:
slackbasedeps

# Ensure additional dependencies:
# aspell is required to generate the dictionary files and aspell
# requires ncurses:
{ slackcheckpkgdeps aspell  || installpkg $PKGSTORE/aspell-[0-9]*.t?z || exit 99; }
{ slackcheckpkgdeps ncurses || installpkg $PKGSTORE/l/ncurses-[0-9]*.t?z || exit 99; }

# Launch the package build script:
BUILDLOG=$SLKPORTARCH-$( basename $SLACKPACKAGE .t?z ).build.log
( ./$PKGNAM.SlackBuild ) >& /dev/stdout | tee $BUILDLOG

# Compress the build log:
bzip2 -9fvz $BUILDLOG
