#!/bin/bash

#######################################################################
# Program: trackbuild.glib
# Purpose: Build the glib package for ARMedslack
# Author : Stuart Winter <stuart@armedslack.org>
#######################################################################

# Ensure slacktrack/altertrack is installed:
which slacktrack >/dev/null 2>&1 || { echo "Cannot build without slacktrack" ; exit 1 ;}

# Paths to skeleton port's source & real Slackware source tree:
export CWD=$SLACKSOURCE/l/glib
export PORTCWD=$PWD

# Determine the CFLAGS for the known architectures:
case $PORTARCH in
   arm)     export SLKCFLAGS="-O2 -march=armv3 -mtune=xscale" ;;
   powerpc) export SLKCFLAGS="-O2" ;;
   sparc)   export SLKCFLAGS="-O2" ;;
   alpha)   export SLKCFLAGS="-O2" ;;
   *)       export SLKCFLAGS="-O2" ;;
esac

# If specified in slackdev.config, we'll delete the old copy of the
# package from our package store.
if [ "${DELETEOLDPKGS}" = "Yes" ]; then
   rm -f $PKGSTORE/$PKGSERIES/$PACKAGE-*.{tgz,txt}
fi

slacktrack ${ALTERTRACKOPTS} \
           -l${PBLOGS}/${PACKAGE}.log \
           -b${PKGSTORE}/${PKGSERIES} \
           -OcQp ${SLACKPACKAGE} ./${PACKAGE}.build ${VERSION}
