Advertisement
Guest User

Untitled

a guest
Dec 9th, 2010
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.79 KB | None | 0 0
  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=(`wget ${source/V*}MD5SUMS -qO - | grep ${_arch}.run | cut -d " " -f1`
  32.          '98859bfca9ef2ebf2ea43eb9123316fc'
  33.          '8b3b5fb34d5e8594ee873d7947f3d09b')
  34.  
  35. package() {
  36.   # Unpack the run package via sh(1)
  37.   echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" --target "${srcdir}" \
  38.     --nox11 --noexec &> /dev/null
  39.  
  40.   # Unpack bundled files
  41.   install -d "${pkgdir}/opt/VirtualBox"
  42.   cd "${pkgdir}/opt/VirtualBox"
  43.   tar -xjf "${srcdir}/VirtualBox.tar.bz2"
  44.  
  45.   install -d "${pkgdir}/usr/"{bin,share/applications,share/pixmaps}
  46.  
  47.   # Hardened build: Mark binaries suid root, create symlinks for working around
  48.   #                 unsupported $ORIGIN/.. in VBoxC.so and make sure the
  49.   #                 directory is only writable by the user (paranoid).
  50.   chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP}
  51.   for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
  52.     ln -sf "/opt/VirtualBox/${_lib}" "components/${_lib}"
  53.   done
  54.   chmod go-w .
  55.  
  56.   # VBoxNetAdpCtl needs to be suid root in any case
  57.   chmod 4511 VBoxNetAdpCtl
  58.  
  59.   # Patch "vboxshell.py" to use Python 2.x (instead of Python 3)
  60.   sed -i 's#/usr/bin/python#\02#' "${pkgdir}/opt/VirtualBox/vboxshell.py"
  61.  
  62.   # Install the SDK
  63.   cd "${pkgdir}/opt/VirtualBox/sdk/installer"
  64.   VBOX_INSTALL_PATH="/opt/VirtualBox" python2 vboxapisetup.py install --root "${pkgdir}"
  65.   rm -Rf build
  66.   cd "${pkgdir}/opt/VirtualBox"
  67.  
  68.   # Install rc.d script for module compilation
  69.   install -Dm0755 "${srcdir}/vboxdrv" "${pkgdir}/etc/rc.d/vboxdrv"
  70.  
  71.   # Replace init script stuff
  72.   sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/etc/rc.d/vboxdrv setup,g' \
  73.     "${pkgdir}/opt/VirtualBox/VBox.sh"
  74.   sed -i -e 's,sudo /etc/init.d/vboxdrv restart,modprobe vboxdrv,g' \
  75.     "${pkgdir}/opt/VirtualBox/VBox.sh"
  76.  
  77.   # Install udev rules
  78.   install -Dm0644 "${srcdir}/10-vboxdrv.rules" "${pkgdir}/lib/udev/rules.d/10-vboxdrv.rules"
  79.  
  80.   # Symlink the launchers
  81.   for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl} rdesktop-vrdp; do
  82.     ln -s "/opt/VirtualBox/${_bin}" "${pkgdir}/usr/bin/${_bin}"
  83.   done
  84.  
  85.   # Symlink the desktop icon and ".desktop" files
  86.   ln -s /opt/VirtualBox/VBox.png "${pkgdir}/usr/share/pixmaps/VBox.png"
  87.   ln -s /opt/VirtualBox/virtualbox.desktop "${pkgdir}/usr/share/applications/VirtualBox.desktop"
  88.  
  89.   # Symlink the license
  90.   install -d "${pkgdir}/usr/share/licenses/${pkgname}"
  91.   ln -s /opt/VirtualBox/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/PUEL"
  92.  
  93.   # Setup configuration
  94.   install -d "${pkgdir}/etc/vbox"
  95.   echo 'INSTALL_DIR="/opt/VirtualBox"' > "${pkgdir}/etc/vbox/vbox.cfg"
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement