#!/bin/bash

source /usr/share/slackdev/buildkit.sh

# Package metadata:
export PKGNAM=libao
export PKGSERIES=l
export VERSION=0.8.8
export BUILD=1
export ARCH=arm
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 additional dependencies:
slackcheckpkgdeps alsa-lib  || installpkg $PKGSTORE/l/alsa-lib-*.tgz
slackcheckpkgdeps arts      || installpkg $PKGSTORE/l/arts-*.tgz
slackcheckpkgdeps audiofile || installpkg $PKGSTORE/l/audiofile-*.tgz
slackcheckpkgdeps esound    || installpkg $PKGSTORE/l/esound-*.tgz
slackcheckpkgdeps glib2     || installpkg $PKGSTORE/l/glib2-*.tgz
slackcheckpkgdeps glib2,alsa-lib,arts,audiofile,esound  || exit 99

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

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