#!/bin/bash

source /usr/share/slackdev/buildkit.sh

# Package metadata:
export PACKAGE=libao
export PKGSERIES=l
export VERSION=0.8.6
export BUILD=1
export ARCH=arm
export SLACKPACKAGE=$PACKAGE-$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:
( ./$PACKAGE.SlackBuild ) 2>&1 | tee build.log

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