#!/bin/sh
#
# CSW pkg installation, basic testing version
#

http_proxy=...
export http_proxy

ARCH=`/usr/bin/uname -p`
ADMIN_FILE=/tmp/admin
MIRROR_BASE=http://csw.informatik.uni-erlangen.de/csw
PKGS=`/usr/bin/sed -ne '/^__CSWPKGS__/,//p' $0 | grep -v __CSWPKGS__`

/usr/sfw/bin/wget \
    -O /tmp/pkgutil \
    ${MIRROR_BASE}/pkgutil-${ARCH}.pkg

cat >${ADMIN_FILE} <<EOM
mail=
instance=overwrite
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default
EOM

echo yes | /usr/sbin/pkgadd -a ${ADMIN_FILE} -d /tmp/pkgutil CSWpkgutil

echo "mirror=${MIRROR_BASE}/current" > /etc/opt/csw/pkgutil.conf

/opt/csw/bin/pkgutil -yi $PKGS

exit

# Put all to be installed pkgs below here
__CSWPKGS__
CSWggrep
CSWless
CSWfindutils
CSWmutt
CSWlsof
CSWdtracetoolkit
CSWncdu
