Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 7th, 2010  |  syntax: Bash  |  size: 3.83 KB  |  hits: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: The Ringmaster <theringmaster AT archlinux.us>
  2. # Contributor: Balwinder S "bsd" Dheeman <bdheeman AT gmail.com>
  3. # Contributor: thotypous <matiasΘarchlinux-br·org>
  4. # Based on virtualbox_bin
  5.  
  6. pkgname=virtualbox_bin_beta
  7. pkgver=4.0.0_BETA1
  8. _build=68572
  9. pkgrel=1
  10. pkgdesc='Powerful x86 virtualization (Bleeding edge, Personal Use Binaries Edition).'
  11. arch=('i686' 'x86_64')
  12. url='http://virtualbox.org'
  13. license=('custom:PUEL')
  14. depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'gcc' 'make' 'kernel26-headers' 'python2')
  15. optdepends=('qt: for GUI support'
  16.             'sdl: for VBoxSDL and GUI support'
  17.             'mesa: for OpenGL support'
  18.             'libgl: for shared OpenGL support'
  19.             'libxt: for shared clipboard support'
  20.             'alsa-lib: for ALSA support'
  21.             'pulseaudio: for PulseAudio support')
  22. provides=("virtualbox=${pkgver}")
  23. conflicts=('virtualbox-ose' 'virtualbox-modules' 'virtualbox_bin')
  24. backup=('etc/vbox/vbox.cfg')
  25. install=virtualbox_bin_beta.install
  26. _arch='x86'
  27. [ "${CARCH}" = 'x86_64' ] && _arch='amd64'
  28. source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run
  29.         '10-vboxdrv.rules'
  30.         'vboxdrv')
  31. md5sums=('7e788d8e0fbbde1565b56dda2fa52f65'
  32.          '98859bfca9ef2ebf2ea43eb9123316fc'
  33.          '8b3b5fb34d5e8594ee873d7947f3d09b')
  34. [ "${CARCH}" = 'x86_64' ] && md5sums[0]='561d85ede4a6e79ba865a58fd695b869'
  35.  
  36. package() {
  37.   # Unpack the run package via sh(1)
  38.   echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" --target "${srcdir}" \
  39.     --nox11 --noexec &> /dev/null
  40.  
  41.   # Unpack bundled files
  42.   install -d "${pkgdir}/opt/VirtualBox"
  43.   cd "${pkgdir}/opt/VirtualBox"
  44.   tar -xjf "${srcdir}/VirtualBox.tar.bz2"
  45.  
  46.   install -d "${pkgdir}/usr/"{bin,share/applications,share/pixmaps}
  47.  
  48.   # Hardened build: Mark binaries suid root, create symlinks for working around
  49.   #                 unsupported $ORIGIN/.. in VBoxC.so and make sure the
  50.   #                 directory is only writable by the user (paranoid).
  51.   chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP}
  52.   for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
  53.     ln -sf "/opt/VirtualBox/${_lib}" "components/${_lib}"
  54.   done
  55.   chmod go-w .
  56.  
  57.   # VBoxNetAdpCtl needs to be suid root in any case
  58.   chmod 4511 VBoxNetAdpCtl
  59.  
  60.   # Patch "vboxshell.py" to use Python 2.x (instead of Python 3)
  61.   sed -i 's#/usr/bin/python#\02#' "${pkgdir}/opt/VirtualBox/vboxshell.py"
  62.  
  63.   # Install the SDK
  64.   cd "${pkgdir}/opt/VirtualBox/sdk/installer"
  65.   VBOX_INSTALL_PATH="/opt/VirtualBox" python2 vboxapisetup.py install --root "${pkgdir}"
  66.   rm -Rf build
  67.   cd "${pkgdir}/opt/VirtualBox"
  68.  
  69.   # Install rc.d script for module compilation
  70.   install -Dm0755 "${srcdir}/vboxdrv" "${pkgdir}/etc/rc.d/vboxdrv"
  71.  
  72.   # Replace init script stuff
  73.   sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/etc/rc.d/vboxdrv setup,g' \
  74.     "${pkgdir}/opt/VirtualBox/VBox.sh"
  75.   sed -i -e 's,sudo /etc/init.d/vboxdrv restart,modprobe vboxdrv,g' \
  76.     "${pkgdir}/opt/VirtualBox/VBox.sh"
  77.  
  78.   # Install udev rules
  79.   install -Dm0644 "${srcdir}/10-vboxdrv.rules" "${pkgdir}/lib/udev/rules.d/10-vboxdrv.rules"
  80.  
  81.   # Symlink the launchers
  82.   for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl} rdesktop-vrdp; do
  83.     ln -s "/opt/VirtualBox/${_bin}" "${pkgdir}/usr/bin/${_bin}"
  84.   done
  85.  
  86.   # Symlink the desktop icon and ".desktop" files
  87.   ln -s /opt/VirtualBox/VBox.png "${pkgdir}/usr/share/pixmaps/VBox.png"
  88.   ln -s /opt/VirtualBox/virtualbox.desktop "${pkgdir}/usr/share/applications/VirtualBox.desktop"
  89.  
  90.   # Symlink the license
  91.   install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  92.   ln -s /opt/VirtualBox/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/PUEL"
  93.  
  94.   # Setup configuration
  95.   install -d "${pkgdir}/etc/vbox"
  96.   echo 'INSTALL_DIR="/opt/VirtualBox"' > "${pkgdir}/etc/vbox/vbox.cfg"
  97. }