Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

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