Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 16th, 2010  |  syntax: Bash  |  size: 4.21 KB  |  views: 43  |  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: Det <nimetonmaili at gmail a-dot com>
  2. # Contributor: The Ringmaster <theringmaster AT archlinux.us>
  3. # Contributor: Balwinder S "bsd" Dheeman <bdheeman AT gmail.com>
  4. # Contributor: thotypous <matiasΘarchlinux-br·org>
  5. # Based on virtualbox_bin
  6.  
  7. pkgname=virtualbox_bin_beta
  8. pkgver=4.0.0_BETA3
  9. _build=68940
  10. pkgrel=1
  11. pkgdesc='Powerful x86 virtualizer (Bleeding edge, Personal Use Binaries Edition)'
  12. arch=('i686' 'x86_64')
  13. url='http://virtualbox.org'
  14. license=('custom:PUEL')
  15. depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'gcc' 'make' 'kernel26-headers' 'python2')
  16. optdepends=('qt: for GUI support'
  17.             'sdl: for VBoxSDL and GUI support'
  18.             'mesa: for OpenGL support'
  19.             'libgl: for shared OpenGL support'
  20.             'libxt: for shared clipboard support'
  21.             'alsa-lib: for ALSA support'
  22.             'pulseaudio: for PulseAudio support')
  23. provides=("virtualbox=${pkgver}")
  24. conflicts=('virtualbox-ose' 'virtualbox-modules' 'virtualbox_bin')
  25. backup=('etc/vbox/vbox.cfg')
  26. install=virtualbox_bin_beta.install
  27. _arch='x86'
  28. [ "${CARCH}" = 'x86_64' ] && _arch='amd64'
  29. source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run
  30.         '10-vboxdrv.rules'
  31.         'vboxdrv')
  32. md5sums=(`wget ${source/V*}MD5SUMS -qO - | grep ${_arch}.run | cut -d " " -f1`
  33.          '98859bfca9ef2ebf2ea43eb9123316fc'
  34.          '8b3b5fb34d5e8594ee873d7947f3d09b')
  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.  
  98.   # Install the USB Extension Package (see: http://forums.virtualbox.org/viewtopic.php?f=24&p=164806)
  99.   _extpack=Oracle_VM_VirtualBox_Extension_Pack-${pkgver}-${_build}.vbox-extpack
  100.   wget ${source/V*}${_extpack}
  101.   install -d ExtensionPacks/${_extpack/-*}
  102.   tar xzf ${_extpack} -C ExtensionPacks/${_extpack/-*}
  103.   chown -R root:root ExtensionPacks/
  104.   rm ${_extpack}
  105. }
clone this paste RAW Paste Data