# This file contains default settings for the Dropline Build System

function set_title ()
{
    if [ ${TERM} = "xterm" ]; then
	echo -e "\033]0;${1}\007"
    fi
}

function die ()
{
	if [ -n "${1}" ]; then
		echo "${1}"
	fi

	set_title "Error building package"
	
	exit 1
}



if [[ -z ${DLG_ROOT} || ! -d ${DLG_ROOT} ]]; then
	die "Please set the DLG_ROOT variable to a valid installation \
location of the Dropline Build System before sourcing this file."
fi

# Setup the default directory structure

DLG_SRCDIR=${DLG_ROOT}/SOURCES		# Source tarballs
DLG_SCRIPTDIR=${DLG_ROOT}/SCRIPTS	# Per-package build scripts
DLG_PACKAGEDIR=/tmp/DLG/PACKAGES	# Compiled packages
DLG_STAGEDIR=/tmp/DLG/STAGING		# Installation area
DLG_BUILDDIR=/tmp/DLG/BUILD		# Build area
DLG_DOCDIR=${DLG_ROOT}/DOCS		# Documentation
DLG_ISODIR=${DLG_ROOT}/ISO		# Area to create ISO structure
DLG_PACKAGEDIRROOT=${DLG_ROOT}/PACKAGES	# Secondary location for compiled packages

# Packager information

DLG_PKGER="dl"

# Version information

DLG_VERSION="2.8.0"

# Options

DLG_PURGE_BUILDS=yes			# Clean DLG_BUILDDIR after each build

# Fix some problems with libtool

export SED=sed

# Verify required directories exist; create them if they do not

if [ ! -d ${DLG_SRCDIR} ]; then
	echo "Creating ${DLG_SRCDIR}..."
	mkdir -p ${DLG_SRCDIR}
fi
if [ ! -d ${DLG_SCRIPTDIR} ]; then
	echo "Creating ${DLG_SCRIPTDIR}..."
	mkdir -p ${DLG_SCRIPTDIR}
fi
if [ ! -d ${DLG_PACKAGEDIR} ]; then
	echo "Creating ${DLG_PACKAGEDIR}..."
	mkdir -p ${DLG_PACKAGEDIR}
fi
if [ ! -d ${DLG_STAGEDIR} ]; then
	echo "Creating ${DLG_STAGEDIR}..."
	mkdir -p ${DLG_STAGEDIR}
fi
if [ ! -d ${DLG_BUILDDIR} ]; then
	echo "Creating ${DLG_BUILDDIR}..."
	mkdir -p ${DLG_BUILDDIR}
fi

