1 | #!/bin/sh
|
---|
2 |
|
---|
3 | #
|
---|
4 | # Copyright (C) 2007-2010 Oracle Corporation
|
---|
5 | #
|
---|
6 | # Use only with permission.
|
---|
7 | #
|
---|
8 |
|
---|
9 | #
|
---|
10 | # Correct the ownership of the directories in case there
|
---|
11 | # was an existing installation.
|
---|
12 | #
|
---|
13 | chown -R root:admin /Applications/VirtualBox.app
|
---|
14 |
|
---|
15 | #
|
---|
16 | # Select the right architecture.
|
---|
17 | #
|
---|
18 | MY_ARCH=`uname -m`
|
---|
19 | if test "$MY_ARCH" = "x86_64"; then
|
---|
20 | MY_ARCH="amd64"
|
---|
21 | else
|
---|
22 | MY_ARCH="x86"
|
---|
23 | fi
|
---|
24 | set -e
|
---|
25 | for trg in `ls /Applications/VirtualBox.app/Contents/MacOS/*-${MY_ARCH}`;
|
---|
26 | do
|
---|
27 | linkname=`echo "$trg" | sed -e 's|-'"${MY_ARCH}"'$||' `
|
---|
28 | if test "$linkname" = "$trg"; then
|
---|
29 | echo "oops: $trg" 1>&2
|
---|
30 | exit 1;
|
---|
31 | fi
|
---|
32 | rm -f "$linkname"
|
---|
33 | ln -vh "$trg" "$linkname"
|
---|
34 | done
|
---|
35 |
|
---|
36 | #
|
---|
37 | # Install the Python bindings
|
---|
38 | #
|
---|
39 |
|
---|
40 | VBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS
|
---|
41 | PYTHON="python python2.3 python2.5 python2.6"
|
---|
42 | if [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then
|
---|
43 | for p in $PYTHON; do
|
---|
44 | # Install the python bindings if python is in the path
|
---|
45 | if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then
|
---|
46 | echo 1>&2 "Python found: ${p}, installing bindings..."
|
---|
47 | # Pass install path via environment
|
---|
48 | export VBOX_INSTALL_PATH
|
---|
49 | /bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install 2> /dev/null"
|
---|
50 | fi
|
---|
51 | done
|
---|
52 | fi
|
---|
53 |
|
---|
54 | #
|
---|
55 | # Install any custom files
|
---|
56 | #
|
---|
57 | CP="/bin/cp -f"
|
---|
58 | CPDIR="${CP} -R"
|
---|
59 | DATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.."
|
---|
60 | if [ -d "${DATAPATH}/.custom" ]; then
|
---|
61 | echo 1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}...";
|
---|
62 | ${CPDIR} "${DATAPATH}/.custom/" "${VBOX_INSTALL_PATH}/custom"
|
---|
63 | fi
|
---|
64 |
|
---|
65 | exit 0;
|
---|
66 |
|
---|