postflight revision 2009785c2bc1d376c4919f55ddba552a22e1ce26
208651a016b098f4fa1f6279559f104d70f1632dtakashi#!/bin/sh
714c811200789fde839f46fe904db50b458afe1byoshiki
714c811200789fde839f46fe904db50b458afe1byoshiki#
0a05fab9aadd37834734ffe106fc8ad4488fb3e3rbowen# Copyright (C) 2007-2010 Oracle Corporation
714c811200789fde839f46fe904db50b458afe1byoshiki#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# This file is part of VirtualBox Open Source Edition (OSE), as
031b91a62d25106ae69d4693475c79618dd5e884fielding# available from http://www.virtualbox.org. This file is free software;
031b91a62d25106ae69d4693475c79618dd5e884fielding# you can redistribute it and/or modify it under the terms of the GNU
031b91a62d25106ae69d4693475c79618dd5e884fielding# General Public License (GPL) as published by the Free Software
031b91a62d25106ae69d4693475c79618dd5e884fielding# Foundation, in version 2 as it comes in the "COPYING" file of the
031b91a62d25106ae69d4693475c79618dd5e884fielding# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
031b91a62d25106ae69d4693475c79618dd5e884fielding# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdndCP="/bin/cp -f"
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdndCPDIR="${CP} -R"
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# Correct the ownership of the directories in case there
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# was an existing installation.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdndchown -R root:admin /Applications/VirtualBox.app
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
714c811200789fde839f46fe904db50b458afe1byoshiki# Select the right architecture.
208651a016b098f4fa1f6279559f104d70f1632dtakashi#
208651a016b098f4fa1f6279559f104d70f1632dtakashiMY_ARCH=`uname -m`
5feb3e793f498910da27b70e591fc021e378e44byoshikiif test "$MY_ARCH" = "x86_64"; then
5feb3e793f498910da27b70e591fc021e378e44byoshiki MY_ARCH="amd64"
5feb3e793f498910da27b70e591fc021e378e44byoshikielse
5feb3e793f498910da27b70e591fc021e378e44byoshiki MY_ARCH="x86"
208651a016b098f4fa1f6279559f104d70f1632dtakashifi
208651a016b098f4fa1f6279559f104d70f1632dtakashiset -e
208651a016b098f4fa1f6279559f104d70f1632dtakashifor trg in `ls /Applications/VirtualBox.app/Contents/MacOS/*-${MY_ARCH}`;
208651a016b098f4fa1f6279559f104d70f1632dtakashido
714c811200789fde839f46fe904db50b458afe1byoshiki linkname=`echo "$trg" | sed -e 's|-'"${MY_ARCH}"'$||' `
5feb3e793f498910da27b70e591fc021e378e44byoshiki if test "$linkname" = "$trg"; then
208651a016b098f4fa1f6279559f104d70f1632dtakashi echo "oops: $trg" 1>&2
714c811200789fde839f46fe904db50b458afe1byoshiki exit 1;
5feb3e793f498910da27b70e591fc021e378e44byoshiki fi
5feb3e793f498910da27b70e591fc021e378e44byoshiki rm -f "$linkname"
208651a016b098f4fa1f6279559f104d70f1632dtakashi ln -vh "$trg" "$linkname"
5feb3e793f498910da27b70e591fc021e378e44byoshikidone
5feb3e793f498910da27b70e591fc021e378e44byoshiki
5feb3e793f498910da27b70e591fc021e378e44byoshiki#
5feb3e793f498910da27b70e591fc021e378e44byoshiki# Install the Python bindings
5feb3e793f498910da27b70e591fc021e378e44byoshiki#
5feb3e793f498910da27b70e591fc021e378e44byoshiki
714c811200789fde839f46fe904db50b458afe1byoshikiVBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS
714c811200789fde839f46fe904db50b458afe1byoshikiPYTHON="python python2.3 python2.5 python2.6"
714c811200789fde839f46fe904db50b458afe1byoshikiif [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then
208651a016b098f4fa1f6279559f104d70f1632dtakashi for p in $PYTHON; do
208651a016b098f4fa1f6279559f104d70f1632dtakashi # Install the python bindings if python is in the path
5feb3e793f498910da27b70e591fc021e378e44byoshiki if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then
208651a016b098f4fa1f6279559f104d70f1632dtakashi echo 1>&2 "Python found: ${p}, installing bindings..."
5feb3e793f498910da27b70e591fc021e378e44byoshiki # Pass install path via environment
5feb3e793f498910da27b70e591fc021e378e44byoshiki export VBOX_INSTALL_PATH
714c811200789fde839f46fe904db50b458afe1byoshiki /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install 2> /dev/null"
714c811200789fde839f46fe904db50b458afe1byoshiki fi
714c811200789fde839f46fe904db50b458afe1byoshiki done
714c811200789fde839f46fe904db50b458afe1byoshikifi
714c811200789fde839f46fe904db50b458afe1byoshiki
208651a016b098f4fa1f6279559f104d70f1632dtakashi#
5feb3e793f498910da27b70e591fc021e378e44byoshiki# Install the vboxweb service file for launchd
5feb3e793f498910da27b70e591fc021e378e44byoshiki#
5feb3e793f498910da27b70e591fc021e378e44byoshikiVBOXWEBSRV="${VBOX_INSTALL_PATH}/org.virtualbox.vboxwebsrv.plist"
714c811200789fde839f46fe904db50b458afe1byoshikiVBOXWEBSRV_TRG="${HOME}/Library/LaunchAgents"
714c811200789fde839f46fe904db50b458afe1byoshikiif [[ -e "${VBOXWEBSRV}" && -e "${VBOXWEBSRV_TRG}" ]]; then
714c811200789fde839f46fe904db50b458afe1byoshiki echo "Installing vboxwebsrv launchd file to ${VBOXWEBSRV_TRG}"
208651a016b098f4fa1f6279559f104d70f1632dtakashi ${CP} "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/"
208651a016b098f4fa1f6279559f104d70f1632dtakashi /usr/sbin/chown `/usr/bin/stat -f"%u" "${HOME}"` "${VBOXWEBSRV_TRG}/org.virtualbox.vboxwebsrv.plist"
5feb3e793f498910da27b70e591fc021e378e44byoshikifi
208651a016b098f4fa1f6279559f104d70f1632dtakashi
5feb3e793f498910da27b70e591fc021e378e44byoshiki#
5feb3e793f498910da27b70e591fc021e378e44byoshiki# Install any custom files
714c811200789fde839f46fe904db50b458afe1byoshiki#
714c811200789fde839f46fe904db50b458afe1byoshikiDATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.."
714c811200789fde839f46fe904db50b458afe1byoshikiif [ -d "${DATAPATH}/.custom" ]; then
714c811200789fde839f46fe904db50b458afe1byoshiki echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}...";
714c811200789fde839f46fe904db50b458afe1byoshiki ${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom"
208651a016b098f4fa1f6279559f104d70f1632dtakashifi
5feb3e793f498910da27b70e591fc021e378e44byoshiki
5feb3e793f498910da27b70e591fc021e378e44byoshikiexit 0;
714c811200789fde839f46fe904db50b458afe1byoshiki
a900cea992dcc120dd1479d929816e4f44377e82yoshiki