#!/bin/sh
# $NetBSD: script,v 1.2 2001/01/24 09:34:37 garbled Exp $
if [ -z "$2" ]; then
	echo "There was an error finding your package source directory."
	echo "Please set the environment variable \$PKGSRCDIR to the location"
	echo "of your package sources."
	exit 1
fi
if [ -z "$1" ]; then
	echo "Somehow, an empty directory name was selected.  Most likely"
	echo "the category you selected contained no packages.  You should"
	echo "verify that $PKGSRCDIR/$2/$1 is not an empty directory."
	exit 1
fi
if [ -z "$PKGSRCDIR" ]; then
	if [ -d "/usr/pkgsrc" ]; then
		PKGSRCDIR="/usr/pkgsrc"
	fi
	if [ -d "/usr/src/pkgsrc" ]; then
		PKGSRCDIR="/usr/src/pkgsrc"
	fi
fi
cd $PKGSRCDIR/$2/$1
make clean && make install && make clean
