1 # Maintainer: thotypous <matiasΘarchlinux-br·org>
2 # Contributor: Peter 'piie' Feuerer <peterΘpiie·net>
3 # Contributor: Sascha Pfau <MrPeacockΘgmail·com>
4 # Contributor: iggy <iggy.mfΘgmail·com>
6 pkgname="virtualbox_bin-1"
9 pkgdesc="Powerful x86 virtualization (Personal Use Binaries Edition)"
10 url="http://www.virtualbox.org"
11 license=('custom:PUEL')
12 backup=('etc/vbox/interfaces')
13 arch=('i686' 'x86_64')
14 install=('vbox.install')
15 md5sums=('cda1cabca237db7caab94e9eb2dc2456'
16 'f30e78505cdebc925519e1146c22cc8a'
17 '9576c4ee3c362f7bc30525a4f07ea3ed'
18 '23d094a975174b7b599fb93bc0c43936')
21 [ "$CARCH" = "x86_64" ] && _architect='amd64'
23 source=('vbox.install'
28 install=('vbox.install')
29 depends=('libstdc++5')
30 optdepends=("qt3: For VirtualBox GUI"
32 provides=("virtualbox=${pkgver}")
33 conflicts=('virtualbox-ose' 'virtualbox-modules' 'virtualbox_bin')
39 # Bad news. We have to download the file inside build() because
40 # the server appends a random number to it's filename, so makepkg
41 # would download it, then would not be able to find it.
42 msg "Downloading VirtualBox"
43 wget -c -O "VirtualBox-${pkgver}-Linux_${_architect}.run" \
44 "http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-Linux_${_architect}.run" \
47 ln -sf "${SRCDEST}/VirtualBox-${pkgver}-Linux_${_architect}.run" "${srcdir}" || return 1
50 msg "Creating the package"
53 sh "VirtualBox-${pkgver}-Linux_${_architect}.run" --check || return 1
56 echo yes | sh "VirtualBox-${pkgver}-Linux_${_architect}.run" --target "$srcdir" \
57 --nox11 --noexec &>/dev/null || return 1
60 "$pkgdir/opt/virtualbox" \
62 "$pkgdir/etc/udev/rules.d" \
63 "$pkgdir/usr/share/applications" \
64 "$pkgdir/usr/share/pixmaps" || return 1
66 cd "$pkgdir/opt/virtualbox"
67 tar -jxf "$srcdir/VirtualBox.tar.bz2"
69 # Install vbox_build_module
70 install -D -m744 "$srcdir/vbox_build_module" "$pkgdir/usr/bin/vbox_build_module"
72 # NOTE: Comment the following line if you want the SDK.
73 rm -Rf "$pkgdir/opt/virtualbox/sdk"
75 # Symlink the launchers
76 for app in "VBoxAddIF" "VBoxDeleteIF"; do
77 ln -s "/opt/virtualbox/VBoxAddIF.sh" "$pkgdir/usr/bin/$app"
79 for app in "VirtualBox" "VBoxManage" "VBoxSDL" "VBoxVRDP" "VBoxHeadless"; do
80 ln -s "/opt/virtualbox/VBox.sh" "$pkgdir/usr/bin/$app"
82 ln -s "/opt/virtualbox/VBoxTunctl" "$pkgdir/usr/bin/VBoxTunctl"
84 # Symlink the desktop icon
85 ln -s "/opt/virtualbox/VBox.png" "$pkgdir/usr/share/pixmaps/VBox.png"
86 ln -s "/opt/virtualbox/VirtualBox.desktop" "$pkgdir/usr/share/applications/VirtualBox.desktop"
88 # Replace some init scripts by simplified stuff
89 sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/usr/bin/vbox_build_module,g' "$pkgdir/opt/virtualbox/VBox.sh"
90 sed -i -e 's,sudo /etc/init.d/virtualbox restart,modprobe vboxdrv,g' "$pkgdir/opt/virtualbox/VBox.sh"
93 echo 'KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="vboxusers", MODE="0660"' > \
94 "$pkgdir/etc/udev/rules.d/60-vboxdrv.rules"
97 install -D -m644 "$srcdir/interfaces" "$pkgdir/etc/vbox/interfaces"
99 # Point the installation directory to vbox
100 echo '# VirtualBox installation directory' > "$pkgdir/etc/vbox/vbox.cfg"
101 echo 'INSTALL_DIR="/opt/virtualbox"' >> "$pkgdir/etc/vbox/vbox.cfg"
103 # Patch the vboxnet initscript
105 patch < "vboxnet.patch" || return 1
106 install -D -m755 "$srcdir/vboxnet.sh" "$pkgdir/etc/rc.d/vboxnet"
109 mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
110 ln -s "/opt/virtualbox/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/PUEL"