View difference between Paste ID: VxFXs45V and
SHOW:
|
|
- or go back to the newest paste.
| 1 | - | |
| 1 | + | # Maintainer: The Ringmaster [[email protected]] |
| 2 | ||
| 3 | pkgname="virtualbox_bin_beta" | |
| 4 | pkgver="3.2.8" | |
| 5 | _build=(`wget http://download.virtualbox.org/virtualbox/${pkgver}/ -qO - | grep rhel4 | cut -d "_" -f2`) # automatic generation
| |
| 6 | pkgrel=1 | |
| 7 | pkgdesc="A powerful x86 virtualizer (PUEL edition) - Bleeding edge version" # Pkgname should not be mentioned in pkgdesc. This is a suggestion for you to start with | |
| 8 | url="http://virtualbox.org" | |
| 9 | license=('custom:PUEL')
| |
| 10 | arch=('i686' 'x86_64')
| |
| 11 | install='virtualbox.install' | |
| 12 | depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'gcc' 'make' 'kernel26-headers')
| |
| 13 | optdepends=("qt: for GUI support" # there's no other GUI in VirtualBox than the one it has
| |
| 14 | "sdl: for VBoxSDL and GUI support" | |
| 15 | "libgl: for shared OpenGL support" # the missing 'support' for some of these | |
| 16 | "libxt: for shared Clipboard support" | |
| 17 | "alsa-lib: for ALSA support" | |
| 18 | "pulseaudio: for PulseAudio support") | |
| 19 | provides=("virtualbox=${pkgver}")
| |
| 20 | conflicts=('virtualbox-ose' 'virtualbox-modules')
| |
| 21 | _arch='x86' | |
| 22 | [ "$CARCH" = "x86_64" ] && _arch='amd64' | |
| 23 | source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run # simplicity ;)
| |
| 24 | '10-vboxdrv.rules' | |
| 25 | 'vboxdrv') | |
| 26 | md5sums=(`wget http://download.virtualbox.org/virtualbox/${pkgver}/MD5SUMS -qO - | grep ${_arch}.run | cut -d " " -f1` # automatic generation
| |
| 27 | '98859bfca9ef2ebf2ea43eb9123316fc' | |
| 28 | '160fc08a43cd9a719d306b5f023dea42') | |
| 29 | ||
| 30 | build() {
| |
| 31 | # unpack the .run package via sh(1) | |
| 32 | echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_arch}.run" --target "$srcdir" \
| |
| 33 | --nox11 --noexec &> /dev/null # since 3.4 pacman automatically interrupts the build when an error occurs deprecating "return 1"s | |
| 34 | # no need for a 2nd md5sums check either (the '--check' operation) | |
| 35 | # Unpack bundled files | |
| 36 | install -d "$pkgdir/opt/VirtualBox" | |
| 37 | cd "$pkgdir/opt/VirtualBox" | |
| 38 | tar -xjf "$srcdir/VirtualBox.tar.bz2" | |
| 39 | ||
| 40 | install -d "$pkgdir/usr/"{bin,share/applications,share/pixmaps}
| |
| 41 | ||
| 42 | # Hardened build: Mark binaries suid root, create symlinks for working around | |
| 43 | # unsupported $ORIGIN/.. in VBoxC.so and make sure the | |
| 44 | # directory is only writable by the user (paranoid). | |
| 45 | chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP}
| |
| 46 | for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
| |
| 47 | ln -sf "/opt/VirtualBox/${_lib}" "components/${_lib}"
| |
| 48 | done | |
| 49 | chmod go-w . | |
| 50 | ||
| 51 | # VBoxNetAdpCtl needs to be suid root in any case | |
| 52 | chmod 4511 VBoxNetAdpCtl | |
| 53 | ||
| 54 | # Replace VirtualBox built-in Qt by system Qt libraries (disabled as of | |
| 55 | # 2010-03-26, 3.1.6-1) | |
| 56 | #for _lib in libQt{Core,Gui,Network,OpenGL}; do
| |
| 57 | # rm "${_lib}VBox.so.4"
| |
| 58 | # ln -s "/usr/lib/${_lib}.so.4" "${_lib}VBox.so.4"
| |
| 59 | #done | |
| 60 | ||
| 61 | # Install the SDK (disabled, since the extension expects an UCS4-compiled | |
| 62 | # python, while Arch Linux has an UCS2-compiled python) | |
| 63 | #cd "$pkgdir/opt/VirtualBox/sdk/installer" | |
| 64 | #VBOX_INSTALL_PATH="/opt/VirtualBox" python vboxapisetup.py install --root "$pkgdir" | |
| 65 | #rm -Rf build | |
| 66 | #cd "$pkgdir/opt/VirtualBox" | |
| 67 | rm -Rf sdk vboxshell.py VBoxPython* | |
| 68 | ||
| 69 | # Install rc.d script for module compilation | |
| 70 | install -Dm0755 "$srcdir/vboxdrv" "$pkgdir/etc/rc.d/vboxdrv" # no need for exceptional curly brackets ("{", "}") here, if not used in other "$pkgdir"/"$srcdir" functions either
| |
| 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 | } |