

PARTS=$BUILDOUT/parts

case "$1" in
    install)
	if [ ! -d  $PARTS/$PROJECT ]; then
	    echo installing
	    git clone $GIT_SRC $PARTS/$PROJECT
	else
	    echo "already installed"	    
	fi
	;;
    dist)
	echo distributing
	cd $PARTS/$PROJECT
	shift
	if [ $@X != X ]; then
	    ./distribute.sh -m "$RECIPES"  $@
	else
	    ./distribute.sh -m "$RECIPES"  dist
	fi
	;;
    build)
	echo building
	cd $PARTS/$PROJECT/dist/default
	shift
	./build.py --package $PACKAGE --name "$APPNAME" --version $VERSION  --orientation $ORIENTATION --permission $PERMISSIONS --dir $PUBLIC --private $PRIVATE $@
	;;
	*)
	echo "Usage: $0 {install|dist|build}" >&2
	exit 1
	;;
esac

exit 0
