mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-02-04 07:37:14 +08:00
107 lines
4.2 KiB
Bash
107 lines
4.2 KiB
Bash
|
#
|
||
|
# Chakra Packages for Chakra, part of chakra-project.org
|
||
|
#
|
||
|
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||
|
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||
|
|
||
|
# include global config
|
||
|
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
|
||
|
|
||
|
pkgname="virtualbox_bin"
|
||
|
pkgver="3.2.0"
|
||
|
_build="61806"
|
||
|
pkgrel=1
|
||
|
pkgdesc="Powerful x86 virtualization (Personal Use Binaries Edition)."
|
||
|
arch=('i686' 'x86_64')
|
||
|
url="http://virtualbox.org"
|
||
|
license=('custom:PUEL')
|
||
|
depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'gcc' 'make' 'kernel26-headers')
|
||
|
optdepends=("qt: for VirtualBox GUI"
|
||
|
"sdl: for VBoxSDL and VirtualBox GUI"
|
||
|
"libgl: for shared OpenGL"
|
||
|
"libxt: for shared Clipboard"
|
||
|
"alsa-lib: for ALSA support"
|
||
|
"pulseaudio: for PulseAudio support")
|
||
|
provides=("virtualbox=${pkgver}")
|
||
|
conflicts=('virtualbox-ose' 'virtualbox-modules')
|
||
|
install='virtualbox.install'
|
||
|
_architect='x86'
|
||
|
[ "$CARCH" = "x86_64" ] && _architect='amd64'
|
||
|
source=("VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run::http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run"
|
||
|
'10-vboxdrv.rules'
|
||
|
'vbox_build_module')
|
||
|
md5sums=('003c36b1704dda450b6b21e99afc2d85'
|
||
|
'98859bfca9ef2ebf2ea43eb9123316fc'
|
||
|
'dcb2d165b25274f77426a895d6dc41af')
|
||
|
[ "$CARCH" = "x86_64" ] && md5sums[0]='6fc4475dc26af6aa64bd9fb37ea9ca6a'
|
||
|
|
||
|
build() {
|
||
|
# Check and unpack the run package via sh(1)
|
||
|
sh "VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run" --check || return 1
|
||
|
echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_architect}.run" --target "$srcdir" \
|
||
|
--nox11 --noexec &> /dev/null || return 1
|
||
|
|
||
|
# Unpack bundled files
|
||
|
mkdir -p "$pkgdir/opt/VirtualBox" || return 1
|
||
|
cd "$pkgdir/opt/VirtualBox"
|
||
|
tar -xjf "$srcdir/VirtualBox.tar.bz2" || return 1
|
||
|
|
||
|
mkdir -p "$pkgdir/usr/"{bin,share/applications,share/pixmaps} || return 1
|
||
|
|
||
|
# Hardened build: Mark binaries suid root, create symlinks for working around
|
||
|
# unsupported $ORIGIN/.. in VBoxC.so and make sure the
|
||
|
# directory is only writable by the user (paranoid).
|
||
|
chmod 4511 VirtualBox VBox{SDL,Headless,NetDHCP}
|
||
|
for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
|
||
|
ln -sf "/opt/VirtualBox/${_lib}" "components/${_lib}"
|
||
|
done
|
||
|
chmod go-w .
|
||
|
|
||
|
# VBoxNetAdpCtl needs to be suid root in any case
|
||
|
chmod 4511 VBoxNetAdpCtl
|
||
|
|
||
|
# Replace VirtualBox built-in Qt by system Qt libraries (disabled as of
|
||
|
# 2010-03-26, 3.1.6-1)
|
||
|
#for _lib in libQt{Core,Gui,Network,OpenGL}; do
|
||
|
# rm "${_lib}VBox.so.4"
|
||
|
# ln -s "/usr/lib/${_lib}.so.4" "${_lib}VBox.so.4"
|
||
|
#done
|
||
|
|
||
|
# Install the SDK (disabled, since the extension expects an UCS4-compiled
|
||
|
# python, while Arch Linux has an UCS2-compiled python)
|
||
|
#cd "$pkgdir/opt/VirtualBox/sdk/installer"
|
||
|
#VBOX_INSTALL_PATH="/opt/VirtualBox" python vboxapisetup.py install --root "${pkgdir}" || return 1
|
||
|
#rm -Rf build
|
||
|
#cd "$pkgdir/opt/VirtualBox"
|
||
|
rm -Rf sdk vboxshell.py VBoxPython*
|
||
|
|
||
|
# Symlink the launchers
|
||
|
for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl} rdesktop-vrdp; do
|
||
|
ln -s "/opt/VirtualBox/${_bin}" "$pkgdir/usr/bin/${_bin}"
|
||
|
done
|
||
|
|
||
|
# Symlink the desktop icon and ".desktop" files
|
||
|
ln -s "/opt/VirtualBox/VBox.png" "$pkgdir/usr/share/pixmaps/VBox.png"
|
||
|
ln -s "/opt/VirtualBox/virtualbox.desktop" "$pkgdir/usr/share/applications/VirtualBox.desktop"
|
||
|
|
||
|
# Install vbox_build_module
|
||
|
install -Dm0744 "$srcdir/vbox_build_module" "$pkgdir/usr/bin/vbox_build_module" || return 1
|
||
|
|
||
|
# Replace some init scripts by simplified stuff
|
||
|
sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/usr/bin/vbox_build_module,g' \
|
||
|
"$pkgdir/opt/VirtualBox/VBox.sh"
|
||
|
sed -i -e 's,sudo /etc/init.d/vboxdrv restart,modprobe vboxdrv,g' \
|
||
|
"$pkgdir/opt/VirtualBox/VBox.sh"
|
||
|
|
||
|
# Install udev rules
|
||
|
install -Dm0644 "$srcdir/10-vboxdrv.rules" "$pkgdir/lib/udev/rules.d/10-vboxdrv.rules" || return 1
|
||
|
|
||
|
# Setup configuration
|
||
|
mkdir -p "$pkgdir/etc/vbox" || return 1
|
||
|
echo 'INSTALL_DIR="/opt/VirtualBox"' > "$pkgdir/etc/vbox/vbox.cfg"
|
||
|
|
||
|
# Symlink the license
|
||
|
mkdir -p "$pkgdir/usr/share/licenses/$pkgname" || return 1
|
||
|
ln -s "/opt/VirtualBox/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/PUEL"
|
||
|
}
|