postflight revision 343053a42dedb94c8ef5534fff89c72384adf94d
649N/A#!/bin/sh
649N/A
1339N/A#
649N/A# Copyright (C) 2007-2010 Oracle Corporation
1422N/A#
649N/A# This file is part of VirtualBox Open Source Edition (OSE), as
649N/A# available from http://www.virtualbox.org. This file is free software;
919N/A# you can redistribute it and/or modify it under the terms of the GNU
919N/A# General Public License (GPL) as published by the Free Software
919N/A# Foundation, in version 2 as it comes in the "COPYING" file of the
919N/A# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
919N/A# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
919N/A#
919N/A
919N/A#
919N/A# Correct the ownership of the directories in case there
919N/A# was an existing installation.
919N/A#
919N/Achown -R root:admin /Applications/VirtualBox.app
919N/A
919N/A#
919N/A# Select the right architecture.
919N/A#
919N/AMY_ARCH=`uname -m`
649N/Aif test "$MY_ARCH" = "x86_64"; then
649N/A MY_ARCH="amd64"
649N/Aelse
649N/A MY_ARCH="x86"
649N/Afi
649N/Aset -e
1360N/Afor trg in `ls /Applications/VirtualBox.app/Contents/MacOS/*-${MY_ARCH}`;
1360N/Ado
1360N/A linkname=`echo "$trg" | sed -e 's|-'"${MY_ARCH}"'$||' `
649N/A if test "$linkname" = "$trg"; then
649N/A echo "oops: $trg" 1>&2
1339N/A exit 1;
649N/A fi
649N/A rm -f "$linkname"
649N/A ln -vh "$trg" "$linkname"
649N/Adone
1339N/A
1339N/A#
1339N/A# Install the Python bindings
1339N/A#
970N/A
977N/AVBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS
970N/APYTHON="python python2.3 python2.5 python2.6"
970N/Aif [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then
970N/A for p in $PYTHON; do
970N/A # Install the python bindings if python is in the path
970N/A if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then
970N/A echo 1>&2 "Python found: ${p}, installing bindings..."
649N/A # Pass install path via environment
649N/A export VBOX_INSTALL_PATH
649N/A /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install 2> /dev/null"
649N/A fi
1422N/A done
1422N/Afi
649N/A
649N/A#
649N/A# Install any custom files
1422N/A#
1422N/ACP="/bin/cp -f"
1422N/ACPDIR="${CP} -R"
1422N/ADATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.."
649N/Aif [ -d "${DATAPATH}/.custom" ]; then
970N/A echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}...";
970N/A ${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom"
970N/Afi
649N/A
exit 0;