#!/bin/bash

source /usr/share/slackdev/buildkit.sh

# Package metadata:
export PACKAGE=trn
export PKGSERIES=n
export VERSION=3.6
export BUILD=1
export ARCH=armv3
export SLACKPACKAGE="${PACKAGE}-${VERSION}-${ARCH}-${BUILD}.tgz"

# Reset the ARM file system: restore it to the 'factory settings'
# as it were (this has no effect when building natively):
sboxsysrestore

# Ensure base ARM packages are installed first:
slackbasedeps

# Ensure build dependencies.  If you're building inside Scratchbox
# (but I don't do that) then you need ARMedslack's 'bash' package too
# else it breaks. I can't remember why it can't use sbox's bash but it doesn't
# work.
slackcheckpkgdeps ispell     || installpkg ${PKGSTORE}/ap/ispell-*.tgz
slackcheckpkgdeps libtermcap || installpkg ${PKGSTORE}/l/libtermcap-*.tgz
slackcheckpkgdeps elvis      || installpkg ${PKGSTORE}/a/elvis-*.tgz
slackcheckpkgdeps sendmail   || installpkg ${PKGSTORE}/n/sendmail-[0-9]*.tgz
slackcheckpkgdeps util-linux || installpkg ${PKGSTORE}/a/util-linux-*.tgz
slackcheckpkgdeps ispell,libtermcap,elvis,sendmail,util-linux || exit 50

# Launch the package build script:
./${PACKAGE}.SlackBuild 
