postflight revision fb27aa740466280f820e13e238bc6dd0b477eb37
143N/A#!/bin/sh
143N/A
143N/A#
143N/A# Copyright (C) 2007-2010 Oracle Corporation
143N/A#
143N/A# Use only with permission.
143N/A#
143N/A
143N/A#
143N/A# Correct the ownership of the directories in case there
143N/A# was an existing installation.
143N/A#
143N/Achown -R root:admin /Applications/VirtualBox.app
143N/A
143N/A#
143N/A# Select the right architecture.
143N/A#
143N/AMY_ARCH=`uname -m`
143N/Aif test "$MY_ARCH" = "x86_64"; then
143N/A MY_ARCH="amd64"
143N/Aelse
143N/A MY_ARCH="x86"
143N/Afi
143N/Aset -e
143N/Afor trg in `ls /Applications/VirtualBox.app/Contents/MacOS/*-${MY_ARCH}`;
143N/Ado
618N/A linkname=`echo "$trg" | sed -e 's|-'"${MY_ARCH}"'$||' `
143N/A if test "$linkname" = "$trg"; then
143N/A echo "oops: $trg" 1>&2
143N/A exit 1;
143N/A fi
143N/A rm -f "$linkname"
143N/A ln -vh "$trg" "$linkname"
143N/Adone
143N/A
143N/A#
143N/A# Install the Python bindings
143N/A#
143N/A
143N/AVBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS
143N/APYTHON="python python2.3 python2.5 python2.6"
143N/Aif [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then
143N/A for p in $PYTHON; do
143N/A # Install the python bindings if python is in the path
143N/A if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then
143N/A echo 1>&2 "Python found: ${p}, installing bindings..."
143N/A # Pass install path via environment
143N/A export VBOX_INSTALL_PATH
143N/A /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install 2> /dev/null"
143N/A fi
143N/A done
181N/Afi
143N/A
143N/A#
143N/A# Install any custom files
143N/A#
CP="/bin/cp -f"
CPDIR="${CP} -R"
DATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.."
if [ -d "${DATAPATH}/.custom" ]; then
echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}...";
${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom"
fi
exit 0;