1 # Contributor: Det <nimetonmaili at gmail a-dot com>
2 # Contributor: The Ringmaster <theringmaster AT archlinux.us>
3 # Contributor: Christian Berendt <berendt@b1-systems.de>
4 # Contributor: Balwinder S "bsd" Dheeman <bdheeman AT gmail.com>
5 # Contributor: thotypous <matiasΘarchlinux-br·org>
6 # Based on virtualbox_bin and virtualbox-ext-oracle
8 pkgbase=virtualbox_bin_beta
10 true && pkgname=('virtualbox_bin_beta' 'virtualbox-ext-oracle-beta')
14 arch=('i686' 'x86_64')
15 url='http://virtualbox.org'
16 license=('GPL2' 'custom:PUEL')
19 [ "${CARCH}" = 'x86_64' ] && _arch='amd64'
20 source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run
21 http://download.virtualbox.org/virtualbox/$pkgver/Oracle_VM_VirtualBox_Extension_Pack-$pkgver-$_build.vbox-extpack
28 md5sums=(`wget ${source/V*}MD5SUMS -qO - | grep ${_arch}.run | cut -d " " -f1`
29 `wget ${source[1]/O*}MD5SUMS -qO - | grep VM | cut -d " " -f1`
30 'fe60f9510502bea67383d9198ae8c13c'
31 'e7a94c97b1b1e1e843c1bb85181d2de8'
32 '951bf4a5524e919fc4aaee6f46041e3d'
33 'c159d683ba1947290fc2ad2c64194150'
34 '3ac185709bfe688bb753c46e170d0546'
35 '08b28b82d0ebd6962025100d4b5414a1')
37 package_virtualbox_bin_beta() {
38 pkgdesc="A powerful x86 virtualizer (Personal Use Edition, bleeding edge binaries)"
39 depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'linux-headers' 'python2')
40 optdepends=('virtualbox-ext-oracle-beta: for Oracle extensions'
41 'dkms: for handling kernel modules with dkms'
43 'sdl: for VBoxSDL and GUI support'
44 'mesa: for OpenGL support'
45 'libgl: for shared OpenGL support'
46 'libxt: for shared clipboard support'
47 'alsa-lib: for ALSA support'
48 'pulseaudio: for PulseAudio support')
49 provides=("virtualbox=${pkgver}")
50 conflicts=('virtualbox' 'virtualbox-modules')
51 backup=('etc/vbox/vbox.cfg' 'etc/conf.d/vboxdrv' 'etc/conf.d/vboxweb')
52 install=${pkgbase}.install
53 _installdir=/opt/VirtualBox
55 # Unpack the run package via sh(1)
56 echo yes | sh VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run --target . --nox11 --noexec &> /dev/null
58 # Unpack bundled files
59 install -d "${pkgdir}/${_installdir}"
60 cd "${pkgdir}/${_installdir}"
61 tar -xjf "${srcdir}/VirtualBox.tar.bz2"
63 # Hardened build: Mark binaries suid root, create symlinks for working around
64 # unsupported $ORIGIN/.. in VBoxC.so and make sure the
65 # directory is only writable by the user (paranoid).
66 chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP,NetAdpCtl}
67 for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
68 ln -sf ${_installdir}/${_lib} components/${_lib}
72 # Patch "vboxshell.py" to use Python 2.x instead of Python 3
73 sed -i 's#/usr/bin/python#\02#' "${pkgdir}/${_installdir}/vboxshell.py"
75 # Update Arch initscripts way of life in VBox.sh
76 sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/etc/rc.d/vboxdrv setup,g' "${pkgdir}/${_installdir}/VBox.sh"
77 sed -i -e 's,sudo /etc/init.d/vboxdrv restart,/etc/rc.d/vboxdrv restart,g' "${pkgdir}/${_installdir}/VBox.sh"
79 # Install vboxdrv initscript
80 install -D -m 0755 "${srcdir}/vboxdrv.rc" "${pkgdir}/etc/rc.d/vboxdrv"
81 install -D -m 0644 "${srcdir}/vboxdrv.conf" "${pkgdir}/etc/conf.d/vboxdrv"
83 # Install vboxweb initscript
84 install -D -m 0755 "${srcdir}/vboxweb.rc" "${pkgdir}/etc/rc.d/vboxweb"
85 install -D -m 0644 "${srcdir}/vboxweb.conf" "${pkgdir}/etc/conf.d/vboxweb"
88 install -D -m 0644 "${srcdir}/10-vboxdrv.rules" "${pkgdir}/lib/udev/rules.d/10-vboxdrv.rules"
89 ln -s "${_installdir}/VBoxCreateUSBNode.sh" "${pkgdir}/lib/udev/VBoxCreateUSBNode.sh"
93 VBOX_INSTALL_PATH=${_installdir} python2 vboxapisetup.py install --root "${pkgdir}"
97 # Symlink the launchers. Second link can fail if fs is not case sensitive.
98 install -d -m 0755 "${pkgdir}/usr/bin"
99 for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl} rdesktop-vrdp; do
100 ln -s ${_installdir}/${_bin} "${pkgdir}/usr/bin/${_bin}"
101 ln -s ${_installdir}/${_bin} "${pkgdir}/usr/bin/${_bin,,}" &>/dev/null || :
104 # Symlink the desktop icon and ".desktop" files
105 install -d -m 0755 "${pkgdir}/usr/"{share/applications,share/pixmaps}
106 ln -s ${_installdir}/VBox.png "${pkgdir}/usr/share/pixmaps/VBox.png"
107 ln -s ${_installdir}/icons/128x128/virtualbox.png "${pkgdir}/usr/share/pixmaps/virtualbox.png"
108 ln -s ${_installdir}/virtualbox.desktop "${pkgdir}/usr/share/applications/virtualbox.desktop"
111 install -d -m 0755 "${pkgdir}/usr/share/mime/packages"
112 ln -s ${_installdir}/virtualbox.xml "${pkgdir}/usr/share/mime/packages/virtualbox.xml"
115 install -d -m 0755 "${pkgdir}/usr/share/doc/${pkgname}"
116 ln -s ${_installdir}/VirtualBox.chm "${pkgdir}/usr/share/doc/$pkgname/virtualbox.chm"
118 # Symlink module sources
119 install -d -m 0755 "${pkgdir}/usr/src"
120 ln -s ${_installdir}/src/vboxhost "${pkgdir}/usr/src/vboxhost-${pkgver}"
123 cd "${pkgdir}/${_installdir}/icons"
126 install -d -m 0755 "${pkgdir}/usr/share/icons/hicolor/${_dir}/"{apps,mimetypes}
128 if [[ "${_icon}" = 'virtualbox.png' ]]; then
129 ln -s ${_installdir}/icons/${_dir}/${_icon} "${pkgdir}/usr/share/icons/hicolor/${_dir}/apps/${_icon}"
131 ln -s ${_installdir}/icons/${_dir}/${_icon} "${pkgdir}/usr/share/icons/hicolor/${_dir}/mimetypes/${_icon}"
137 # Write the configuration file
138 install -d -m 0755 "${pkgdir}/etc/vbox"
139 echo "# VirtualBox installation directory" > "${pkgdir}/etc/vbox/vbox.cfg"
140 echo "INSTALL_DIR=${_installdir}" >> "${pkgdir}/etc/vbox/vbox.cfg"
141 echo "# VirtualBox version" >> "${pkgdir}/etc/vbox/vbox.cfg"
142 echo "INSTALL_VER='${pkgver}'" >> "${pkgdir}/etc/vbox/vbox.cfg"
143 echo "INSTALL_REV='${_build}'" >> "${pkgdir}/etc/vbox/vbox.cfg"
144 chmod 0644 "${pkgdir}/etc/vbox/vbox.cfg"
146 # Create the directory below if it doesn't exist
147 install -d -m 0755 "${pkgdir}/var/run/VirtualBox"
150 package_virtualbox-ext-oracle-beta() {
151 pkgdesc="An extension pack for Virtualbox (bleeding edge)"
153 depends=("$pkgbase=$pkgver")
154 install=virtualbox-ext-oracle-beta.install
156 install -D -m 644 Oracle_VM_VirtualBox_Extension_Pack-$pkgver-$_build.vbox-extpack "$pkgdir/usr/share/virtualbox/extensions/Oracle_VM_VirtualBox_Extension_Pack-$pkgver.vbox-extpack"
157 install -D -m 644 PUEL "$pkgdir/usr/share/licenses/$pkgname/PUEL"
160 pkgdesc="A powerful x86 virtualizer (Personal Use Edition + Extension Pack, bleeding edge binaries)"
161 depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'kernel26-headers' 'python2')
163 # vim:set ts=2 sw=2 ft=sh et: