#!/bin/sh -e

##########################################################################
#   Title:
#       Optional, defaults to the name of the script sans extention
#
#   Section:
#       8
#
#   Synopsis:
#       
#   Description:
#       
#   Arguments:
#       
#   Returns:
#
#   Examples:
#
#   Files:
#
#   Environment:
#
#   See also:
#       
#   History:
#   Date        Name        Modification
#   2024-11-11  Jason Bacon Add man page template and usage
##########################################################################

usage()
{
    printf "Usage: $0\n"
    exit 64 # sysexits.h    EX_USAGE
}


##########################################################################
#   Main
##########################################################################

if [ $# != 0 ]; then
    usage
fi

# Must be run by root because it builds and installs system binaries
if [ `id -un` != 'root' ]; then
    printf "$0 must be run by root.\n"
    exit 64
fi

case $(auto-ostype) in
FreeBSD)
    if [ `uname -m` != 'amd64' ]; then
	printf "$0 is only for amd64.\n"
	exit 1
    fi
    
    cd /usr/src
    make build32
    make install32
    /etc/rc.d/ldconfig restart
    ;;
    
*)
    auto-unsupported-os $0
    exit 1
    ;;

esac
