#!/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=syslinux
export VERSION=2.13
export ARCH=arm
export BUILD=1
export PKGSERIES=a
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 nasm is installed (needed to build SYSLINUX on x86)
# For other architectures we don't build syslinux anyway because
# it's an x86 bootloader.  However, the data in /usr/share/syslinux
# is very useful for providing boot images over PXE/TFTP to x86 clients.
slackcheckpkgdeps nasm || installpkg $PKGSTORE/d/nasm-*.tgz
slackcheckpkgdeps nasm || exit 99

# Launch the package build script:
( ./$PACKAGE.SlackBuild ) 2>&1 | tee build.log

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