#!/bin/sh
#
# Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"$Revision: 1.4.4.2 $	SMI"
#

# Check current architecture in case of none remote install
# exit code is defined in Solaris packaging manual
# if ARCH != uname -p => exit 3
# this check must not be performed if we are remotly installed

if [ -z "${PKG_INSTALL_ROOT}" ]
then
    cur_arch=`uname -p`

    if [ "${cur_arch}" != "$ARCH" ]
    then
	echo "package is for <$ARCH> architecture, cannot install on <$cur_arch>"
	exit 3
    fi
fi

CLASSES="none"
have_smf=0
#check if we are under SMF supported OS
if [ -n "$PKG_INSTALL_ROOT" ] && [ "$PKG_INSTALL_ROOT" != "/" ]
then
    if [ ! -r $PKG_INSTALL_ROOT/etc/svc/volatile/repository_door ]
    then
    have_smf=1
    fi
else
    if [ -f /lib/svc/share/smf_include.sh ]
    then
    . /lib/svc/share/smf_include.sh
    smf_present
    if [ $? -eq 0 ]
    then
        have_smf=1
    fi
    fi
fi

if [ ${have_smf} -eq 1 ]
then
    CLASSES="$CLASSES manifest"
else
    CLASSES="$CLASSES initd"
fi 

#
# export environment variables to install

echo "CLASSES=${CLASSES}" >> $1

exit 0




