2011-12-21 02:17:49 +08:00
|
|
|
# Contributor: Sebastien Luttringer <seblu[plus]arch[at]seblu[dot]net>
|
2011-08-20 00:44:58 +08:00
|
|
|
#
|
|
|
|
# Chakra Packages for Chakra, part of chakra-project.org
|
|
|
|
#
|
2012-04-14 05:04:20 +08:00
|
|
|
# maintainer abveritas@chakra-project.org
|
2011-08-20 00:44:58 +08:00
|
|
|
|
|
|
|
pkgname=virtualbox
|
2012-04-27 04:17:39 +08:00
|
|
|
pkgver=4.1.14
|
|
|
|
_build=77440
|
2012-03-14 13:01:16 +08:00
|
|
|
pkgrel=1
|
2011-08-20 00:44:58 +08:00
|
|
|
pkgdesc='Oracle VM VirtualBox Binary Edition'
|
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
url='http://virtualbox.org/'
|
|
|
|
license=('GPL2')
|
2012-03-05 02:55:35 +08:00
|
|
|
depends=('libidl2' 'libxcursor' 'libxinerama' 'libxslt' 'curl' 'linux-headers' 'python2')
|
2011-08-20 00:44:58 +08:00
|
|
|
options=('!strip')
|
|
|
|
optdepends=('virtualbox-ext-oracle: for Oracle extensions'
|
|
|
|
'dkms: for handling kernel modules with dkms'
|
|
|
|
'qt: for GUI support'
|
|
|
|
'sdl: for VBoxSDL and GUI support'
|
|
|
|
'mesa: for OpenGL support'
|
|
|
|
'libgl: for shared OpenGL support'
|
|
|
|
'libxt: for shared clipboard support'
|
|
|
|
'alsa-lib: for ALSA support'
|
|
|
|
'pulseaudio: for PulseAudio support')
|
|
|
|
provides=("virtualbox=${pkgver}")
|
|
|
|
conflicts=('virtualbox' 'virtualbox-ose' 'virtualbox-modules')
|
2012-03-16 22:51:37 +08:00
|
|
|
categories=('system')
|
2011-08-20 00:44:58 +08:00
|
|
|
backup=('etc/vbox/vbox.cfg' 'etc/conf.d/vboxdrv' 'etc/conf.d/vboxweb')
|
|
|
|
install='install'
|
|
|
|
|
|
|
|
_sarch='x86'
|
|
|
|
[ "${CARCH}" = 'x86_64' ] && _sarch='amd64'
|
|
|
|
|
|
|
|
source=(
|
|
|
|
"VirtualBox-${pkgver}-${_build}-Linux_${_sarch}.run::http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}-${_build}-Linux_${_sarch}.run"
|
|
|
|
'10-vboxdrv.rules'
|
|
|
|
'vboxdrv.rc'
|
|
|
|
'vboxdrv.conf'
|
|
|
|
'vboxweb.rc'
|
|
|
|
'vboxweb.conf'
|
|
|
|
)
|
2012-04-27 04:17:39 +08:00
|
|
|
sha256sums=('3469ec1f6dcd63db652f70d0b608afa2a10eb37e0a493e62ff465999a0fa6a45'
|
2011-08-20 00:44:58 +08:00
|
|
|
'69417a9e8855cab8e4878886abe138f559fd17ae487d4cd19c8a24974a8bbec2'
|
|
|
|
'578b63ab173cdcd9169d8aff00caf48668e46a6886bb90fd34a0fbe63e180a4e'
|
2012-03-05 02:55:35 +08:00
|
|
|
'71740893a5f226f9d9fcc607ab9d39b7de816b2759625b34da19162bc7e579ff'
|
2011-08-20 00:44:58 +08:00
|
|
|
'656905de981ffa24f6f921c920538854a235225053f44baedacc07b46ca0cf56'
|
|
|
|
'12dbba3b59991f2b68cddeeeda20236aeff63e11b7e2d1b08d9d6a82225f6651')
|
2012-04-27 04:17:39 +08:00
|
|
|
[[ "${CARCH}" = i686 ]] && sha256sums[0]='b4a8eb84bef6b925b4d20a5161561023fdb9aa791ad12bd87c1422c76846d697'
|
2011-08-20 00:44:58 +08:00
|
|
|
_installdir='/opt/VirtualBox'
|
|
|
|
|
|
|
|
package() {
|
|
|
|
# Check and unpack the run package via sh(1)
|
|
|
|
sh "VirtualBox-${pkgver}-${_build}-Linux_${_sarch}.run" --check
|
|
|
|
echo yes | sh "VirtualBox-${pkgver}-${_build}-Linux_${_sarch}.run" --target "${srcdir}" \
|
|
|
|
--nox11 --noexec &> /dev/null
|
|
|
|
|
|
|
|
# Unpack bundled files
|
|
|
|
install -d "${pkgdir}/${_installdir}"
|
|
|
|
cd "${pkgdir}/${_installdir}"
|
|
|
|
tar -xjf "${srcdir}/VirtualBox.tar.bz2"
|
|
|
|
|
|
|
|
# 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,NetAdpCtl}
|
|
|
|
for _lib in VBox{VMM,REM,RT,DDU,XPCOM}.so; do
|
|
|
|
ln -sf "${_installdir}/${_lib}" "components/${_lib}"
|
|
|
|
done
|
|
|
|
chmod go-w .
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Patch "vboxshell.py" to use Python 2.x instead of Python 3
|
|
|
|
sed -i 's#/usr/bin/python#\02#' "${pkgdir}/${_installdir}/vboxshell.py"
|
|
|
|
|
|
|
|
# Update new initscripts way of life in VBox.sh
|
|
|
|
sed -i -e 's,sudo /etc/init.d/vboxdrv setup,/etc/rc.d/vboxdrv setup,g' \
|
|
|
|
"${pkgdir}/${_installdir}/VBox.sh"
|
|
|
|
sed -i -e 's,sudo /etc/init.d/vboxdrv restart,/etc/rc.d/vboxdrv restart,g' \
|
|
|
|
"${pkgdir}/${_installdir}/VBox.sh"
|
|
|
|
|
|
|
|
# Install vboxdrv initscript
|
|
|
|
install -D -m 0755 "${srcdir}/vboxdrv.rc" "${pkgdir}/etc/rc.d/vboxdrv"
|
|
|
|
install -D -m 0644 "${srcdir}/vboxdrv.conf" "${pkgdir}/etc/conf.d/vboxdrv"
|
|
|
|
|
|
|
|
# Install vboxweb initscript
|
|
|
|
install -D -m 0755 "${srcdir}/vboxweb.rc" "${pkgdir}/etc/rc.d/vboxweb"
|
|
|
|
install -D -m 0644 "${srcdir}/vboxweb.conf" "${pkgdir}/etc/conf.d/vboxweb"
|
|
|
|
|
|
|
|
# Install udev rules
|
|
|
|
install -D -m 0644 "${srcdir}/10-vboxdrv.rules" "${pkgdir}/lib/udev/rules.d/10-vboxdrv.rules"
|
|
|
|
ln -s "${_installdir}/VBoxCreateUSBNode.sh" "${pkgdir}/lib/udev/VBoxCreateUSBNode.sh"
|
|
|
|
|
|
|
|
# Install the SDK
|
|
|
|
cd "${pkgdir}/${_installdir}/sdk/installer"
|
|
|
|
VBOX_INSTALL_PATH="${_installdir}" python2 vboxapisetup.py install --root "${pkgdir}"
|
|
|
|
rm -r -f build
|
|
|
|
cd "${pkgdir}/${_installdir}"
|
|
|
|
|
|
|
|
# Symlink the launchers. Second link can fail if fs is not case sensitive.
|
|
|
|
install -d -m 0755 "${pkgdir}/usr/bin"
|
|
|
|
for _bin in VirtualBox VBox{Headless,Manage,SDL,SVC,Tunctl,NetAdpCtl} rdesktop-vrdp; do
|
|
|
|
ln -s "${_installdir}/${_bin}" "${pkgdir}/usr/bin/${_bin}"
|
|
|
|
ln -s "${_installdir}/${_bin}" "${pkgdir}/usr/bin/${_bin,,}" &>/dev/null || :
|
|
|
|
done
|
|
|
|
|
|
|
|
# Symlink the desktop icon and ".desktop" files
|
|
|
|
install -d -m 0755 "${pkgdir}/usr/"{share/applications,share/pixmaps}
|
|
|
|
ln -s "${_installdir}/VBox.png" "${pkgdir}/usr/share/pixmaps/VBox.png"
|
|
|
|
ln -s "${_installdir}/icons/128x128/virtualbox.png" "${pkgdir}/usr/share/pixmaps/virtualbox.png"
|
|
|
|
ln -s "${_installdir}/virtualbox.desktop" "${pkgdir}/usr/share/applications/virtualbox.desktop"
|
|
|
|
|
|
|
|
# Symlink mime info
|
|
|
|
install -d -m 0755 "${pkgdir}/usr/share/mime/packages"
|
|
|
|
ln -s "${_installdir}/virtualbox.xml" "${pkgdir}/usr/share/mime/packages/virtualbox.xml"
|
|
|
|
|
|
|
|
# Symlink doc
|
|
|
|
install -d -m 0755 "${pkgdir}/usr/share/doc/${pkgname}"
|
|
|
|
ln -s "${_installdir}/VirtualBox.chm" "${pkgdir}/usr/share/doc/$pkgname/virtualbox.chm"
|
|
|
|
|
|
|
|
# Symlink module sources
|
|
|
|
install -d -m 0755 "${pkgdir}/usr/src"
|
|
|
|
ln -s "${_installdir}/src/vboxhost" "${pkgdir}/usr/src/vboxhost-${pkgver}"
|
|
|
|
|
|
|
|
# Symlink icons
|
|
|
|
cd "${pkgdir}/${_installdir}/icons"
|
|
|
|
for _dir in *; do
|
|
|
|
cd "${_dir}"
|
|
|
|
install -d -m 0755 "${pkgdir}/usr/share/icons/hicolor/${_dir}/"{apps,mimetypes}
|
|
|
|
for _icon in *; do
|
|
|
|
if [[ "${_icon}" = 'virtualbox.png' ]]; then
|
|
|
|
ln -s "${_installdir}/icons/${_dir}/${_icon}" "${pkgdir}/usr/share/icons/hicolor/${_dir}/apps/${_icon}"
|
|
|
|
else
|
|
|
|
ln -s "${_installdir}/icons/${_dir}/${_icon}" "${pkgdir}/usr/share/icons/hicolor/${_dir}/mimetypes/${_icon}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd - >/dev/null
|
|
|
|
done
|
|
|
|
|
|
|
|
# Write the configuration file
|
|
|
|
install -d -m 0755 "${pkgdir}/etc/vbox"
|
|
|
|
echo "# VirtualBox installation directory" > "${pkgdir}/etc/vbox/vbox.cfg"
|
|
|
|
echo "INSTALL_DIR='${_installdir}'" >> "${pkgdir}/etc/vbox/vbox.cfg"
|
|
|
|
echo "# VirtualBox version" >> "${pkgdir}/etc/vbox/vbox.cfg"
|
|
|
|
echo "INSTALL_VER='${pkgver}'" >> "${pkgdir}/etc/vbox/vbox.cfg"
|
|
|
|
echo "INSTALL_REV='${_build}'" >> "${pkgdir}/etc/vbox/vbox.cfg"
|
|
|
|
chmod 0644 "${pkgdir}/etc/vbox/vbox.cfg"
|
|
|
|
|
|
|
|
# Create the directory below if it doesn't exist
|
|
|
|
install -d -m 0755 "${pkgdir}/var/run/VirtualBox"
|
|
|
|
}
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 ft=sh et:
|