Advertisement
a1x

Untitled

a1x
Nov 30th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. # Maintainer: M0Rf30
  2. # Contributor: SГѓВ©bastien Luttringer <seblu@aur.archlinux.org>
  3. # Contributor: Lukas Fleischer <archlinux at cryptocrack dot de>
  4. # Contributor: thotypous <matiasΘarchlinux-br·org>
  5. # Contributor: xduugu <xduuguΘgmx·com>
  6. # Contributor: Peter 'piie' Feuerer <peterΘpiie·net>
  7. # Contributor: Sascha Pfau <MrPeacockΘgmail·com>
  8. # Contributor: iggy <iggy.mfΘgmail·com>
  9.  
  10. pkgname=virtualbox-bin
  11. pkgver=4.3.4
  12. _build=91027
  13. pkgrel=1
  14. pkgdesc='Oracle VM VirtualBox Binary Edition'
  15. arch=('i686' 'x86_64')
  16. url='http://virtualbox.org/'
  17. license=('GPL2')
  18. options=('!strip')
  19. depends=(
  20. 'dkms'
  21. 'fontconfig'
  22. 'gcc'
  23. 'libgl'
  24. 'libidl2'
  25. 'libxcursor'
  26. 'libxinerama'
  27. 'libxmu'
  28. 'linux-headers'
  29. 'python2'
  30. 'sdl'
  31. )
  32. optdepends=('virtualbox-ext-oracle: for Oracle extensions')
  33. provides=("virtualbox=${pkgver}")
  34. conflicts=('virtualbox' 'virtualbox-ose' 'virtualbox-modules')
  35. replaces=('virtualbox_bin' 'virtualbox-sun')
  36. backup=('etc/vbox/vbox.cfg' 'etc/conf.d/vboxweb')
  37. install='install'
  38. _arch='amd64'
  39. [[ "${CARCH}" = i686 ]] && _arch='x86'
  40. source=(
  41. "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run::http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run"
  42. 'VBoxFixUSB'
  43. '10-vboxdrv.rules'
  44. 'vboxweb.rc'
  45. 'vboxweb.conf'
  46. )
  47. md5sums=('037d4f1b779764903866a63224d21a10'
  48. '2d04c2e2d8c71558c910a51ec773731a'
  49. 'fe60f9510502bea67383d9198ae8c13c'
  50. 'c159d683ba1947290fc2ad2c64194150'
  51. '3ac185709bfe688bb753c46e170d0546')
  52. [[ "${CARCH}" = i686 ]] && md5sums[0]='87018c5d87a8ce57759d24b48a46fa2c'
  53. _installdir='/opt/VirtualBox'
  54.  
  55. package() {
  56. # Check and unpack the run package via sh(1)
  57. sh "VirtualBox-$pkgver-$_build-Linux_$_arch.run" --check
  58. echo yes | sh "VirtualBox-$pkgver-$_build-Linux_$_arch.run" --target "$srcdir" \
  59. --nox11 --noexec &> /dev/null
  60.  
  61. # Unpack bundled files
  62. install -d "$pkgdir/$_installdir"
  63. cd "$pkgdir/$_installdir"
  64. tar -xjf "$srcdir/VirtualBox.tar.bz2"
  65.  
  66. # Hardened build: Mark binaries suid root, create symlinks for working around
  67. # unsupported $ORIGIN/.. in VBoxC.so and make sure the
  68. # directory is only writable by the user (paranoid).
  69. chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP,NetAdpCtl}
  70. for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
  71. ln -sf "$_installdir/$_lib" "components/$_lib"
  72. done
  73. chmod go-w .
  74.  
  75. # Replace VirtualBox built-in Qt by system Qt libraries (disabled as of
  76. # 2010-03-26, 3.1.6-1)
  77. #for _lib in libQt{Core,Gui,Network,OpenGL}; do
  78. # rm "${_lib}VBox.so.4"
  79. # ln -s "/usr/lib/${_lib}.so.4" "${_lib}VBox.so.4"
  80. #done
  81.  
  82. # Install the SDK
  83. pushd 'sdk/installer'
  84. VBOX_INSTALL_PATH="${_installdir}" python2 vboxapisetup.py install --root "${pkgdir}"
  85. rm -r -f build
  86. popd
  87.  
  88. # Install udev rules
  89. install -D -m 0644 "$srcdir/10-vboxdrv.rules" "$pkgdir/usr/lib/udev/rules.d/10-vboxdrv.rules"
  90. # we need to move and not symlink VBoxCreateUSBNode.sh in /usr/lib/udev to avoid udevd
  91. # to look /opt when /opt is not mounted. This can be done until VBoxCreateUSBNode.sh doesn't
  92. # need more stuff from /opt
  93. mv VBoxCreateUSBNode.sh "$pkgdir/usr/lib/udev/"
  94.  
  95. # Install Fixusb script
  96. install -D -m 0755 "$srcdir/VBoxFixUSB" VBoxFixUSB
  97.  
  98. # Patch "vboxshell.py" to use Python 2.x instead of Python 3
  99. sed -i 's#/usr/bin/python#\02#' vboxshell.py
  100.  
  101. # Update Arch initscripts way of life in VBox.sh
  102. sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/etc/rc.d/dkms start,g' \
  103. "$pkgdir/$_installdir/VBox.sh"
  104. sed -i -e 's,sudo /etc/init.d/vboxdrv restart,/etc/rc.d/dkms start,g' \
  105. "$pkgdir/$_installdir/VBox.sh"
  106.  
  107. # Install vboxweb initscript
  108. install -D -m 0755 "$srcdir/vboxweb.rc" "$pkgdir/etc/rc.d/vboxweb"
  109. install -D -m 0644 "$srcdir/vboxweb.conf" "$pkgdir/etc/conf.d/vboxweb"
  110.  
  111. # Symlink the launchers. Second link can fail if fs is not case sensitive.
  112. install -d -m 0755 "$pkgdir/usr/bin"
  113. for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl,FixUSB} rdesktop-vrdp; do
  114. ln -s "$_installdir/$_bin" "$pkgdir/usr/bin/$_bin"
  115. ln -s "$_installdir/$_bin" "$pkgdir/usr/bin/${_bin,,}" &>/dev/null || :
  116. done
  117.  
  118. # Symlink the desktop icon and ".desktop" files
  119. install -d -m 0755 "$pkgdir/usr/"{share/applications,share/pixmaps}
  120. ln -s "$_installdir/VBox.png" "$pkgdir/usr/share/pixmaps/VBox.png"
  121. ln -s "$_installdir/icons/128x128/virtualbox.png" "$pkgdir/usr/share/pixmaps/virtualbox.png"
  122. ln -s "$_installdir/virtualbox.desktop" "$pkgdir/usr/share/applications/virtualbox.desktop"
  123.  
  124. # Symlink mime info
  125. install -d -m 0755 "$pkgdir/usr/share/mime/packages"
  126. ln -s "$_installdir/virtualbox.xml" "$pkgdir/usr/share/mime/packages/virtualbox.xml"
  127.  
  128. # Symlink doc
  129. install -d -m 0755 "$pkgdir/usr/share/doc/$pkgname"
  130. ln -s "$_installdir/VirtualBox.chm" "$pkgdir/usr/share/doc/$pkgname/virtualbox.chm"
  131.  
  132. # Symlink module sources in /usr/src
  133. install -d -m 0755 "$pkgdir/usr/src"
  134. ln -s "$_installdir/src/vboxhost" "$pkgdir/usr/src/vboxhost-$pkgver"
  135.  
  136. # Symlink icons
  137. pushd icons
  138. for _dir in *; do
  139. cd "$_dir"
  140. install -d -m 0755 "$pkgdir/usr/share/icons/hicolor/$_dir/"{apps,mimetypes}
  141. for _icon in *; do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement