#!/bin/bash

# arm/build
# Check package dependencies, set metadata and launch
# package build script.
# by Stuart Winter <stuart@armedslack.org>
#
source /usr/share/slackdev/buildkit.sh

# Package metadata:
export PACKAGE=gxine
export VERSION=0.5.7
export ARCH=arm
export BUILD=1
export PKGSERIES=xap
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 specific build dependencies (mainly libraries):
{ slackcheckpkgdeps glib2               || installpkg $PKGSTORE/l/glib2-*.tgz || exit 99 ; }
{ slackcheckpkgdeps gtk+2               || installpkg $PKGSTORE/l/gtk+2-*.tgz || exit 99 ; }
{ slackcheckpkgdeps pango               || installpkg $PKGSTORE/l/pango-*.tgz || exit 99 ; }
{ slackcheckpkgdeps x11                 || installpkg $PKGSTORE/x/x11-*.tgz || exit 99 ; }
# Really?!
#{ slackcheckpkgdeps mozilla-firefox     || installpkg $PKGSTORE/xap/mozilla-firefox-*.tgz || exit 99 ; }
#{ slackcheckpkgdeps mozilla-thunderbird || installpkg $PKGSTORE/xap/mozilla-thunderbird-*.tgz || exit 99 ; }
#{ slackcheckpkgdeps seamonkey           || installpkg $PKGSTORE/xap/seamonkey-*.tgz || exit 99 ; }
{ slackcheckpkgdeps xine-lib            || installpkg $PKGSTORE/xap/xine-lib-*.tgz || exit 99 ; }

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

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