#!/bin/sh
# $Id: 3.installworld.sh,v 1.11 2004/09/15 15:43:28 drizzt Exp $                     

set -e -u

. ./config.sh
. ./.common.sh

echo "Copying /etc files..."
sleep 1
cd /usr/src/etc || print_error
make distrib-dirs DESTDIR=$FREESBIEBASEDIR || print_error
make distribution DESTDIR=$FREESBIEBASEDIR || print_error

export __MAKE_CONF=$LOCALDIR/files/make.conf # Redefine make.conf path

echo "Installing world..."
sleep 1
cd /usr/src/ || print_error
make installworld DESTDIR=$FREESBIEBASEDIR || print_error

if [ "$RELEASE" -lt "5" ];
then
    echo "Building new sysinstall..."
    sleep 1
    cd /usr/src/release/sysinstall
    make clean
    make 
    make install

    tar -cf - -C /stand . | tar xpf - -C $FREESBIEBASEDIR/stand
fi
