#!/bin/bash

source /usr/share/slackdev/buildkit.sh

# Package metadata:
export PACKAGE=irssi
export VERSION=0.8.10a
export ARCH=arm
export BUILD=4
export PKGSERIES=n
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 (mainly libraries). Also requires perl
# but that check is included within slackbasedeps:
slackcheckpkgdeps ncurses  || installpkg $PKGSTORE/l/ncurses-*.tgz
slackcheckpkgdeps openssl  || installpkg $PKGSTORE/n/openssl-*.tgz
slackcheckpkgdeps glib2    || installpkg $PKGSTORE/l/glib2-*.tgz
slackcheckpkgdeps openssl,ncurses,glib2 || exit 99

# Launch the package build script:
( ./$PACKAGE.SlackBuild ) >& /dev/stdout | tee build.$ARCH.log

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