#!/bin/sh

#######################################################################
# Program: trackbuild.floppy
# Purpose: Build ARM versions of Slackware's floppy package
# Author : Stuart Winter <stuart@polplex.co.uk>
#######################################################################

PACKAGE=floppy
VERSION=5.4
ARCH=arm
BUILD=1
SLACKPACKAGE="${PACKAGE}-${VERSION}-${ARCH}-${BUILD}.tgz"

# We don't want to overwrite my working Intel bash with an ARM version :)
which slacktrack >/dev/null 2>&1 || { echo "slacktrack not installed.  Cannot build without it" ; exit 1 ;}

# Download source
#./download.source

# Source the cross compile ARM environment variables
source /armedslack/source/armslack-utils/arm-cross-envs.sh

# Set the original path so the build scripts can find the source
export ORIGPATH="$( pwd )"

slacktrack -l${ARMBUILDLOG}/${PACKAGE}.log -b${BUILDSTORE}/a \
           -cN${ARMSTRIPPROG} \
           -ezUSIp ${SLACKPACKAGE} "/bin/sh -x floppy.build ${VERSION}"

echo
echo "floppy package built.  Be sure to tar ztvvf it because"
echo "one time I found that I only had two files in usr/bin "
echo "but it worked the next time I rebuilt the package 1 min later."
echo "so we'll browse the tar now"
less ${BUILDSTORE}/a/${SLACKPACKAGE} 

#EOF

