VirtualBox.tmpl.spec revision 9704f1d0180960069e2c4eb8fe2ddee350910e5d
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# Spec file for creating VirtualBox rpm packages
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# Copyright (C) 2006-2011 Oracle Corporation
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# available from http://www.virtualbox.org. This file is free software;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# you can redistribute it and/or modify it under the terms of the GNU
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# General Public License as published by the Free Software Foundation,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncVirtualBox is a powerful PC virtualization solution allowing
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncyou to run a wide range of PC operating systems on your Linux
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncsystem. This includes Windows, Linux, FreeBSD, DOS, OpenBSD
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncand others. VirtualBox comes with a broad feature set and
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncexcellent performance, making it the premier virtualization
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync# Mandriva: prevent replacing 'echo' by 'gprintf'
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/applications
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/icons/hicolor
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT%{_defaultdocdir}/virtualbox
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox/ExtensionPacks
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/virtualbox
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/mime/packages
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv VBoxEFI32.fd $RPM_BUILD_ROOT/usr/lib/virtualbox || true
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv VBoxEFI64.fd $RPM_BUILD_ROOT/usr/lib/virtualbox || true
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv components $RPM_BUILD_ROOT/usr/lib/virtualbox/components
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv *.so.4 $RPM_BUILD_ROOT/usr/lib/virtualbox || true
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync %{__python} ./vboxapisetup.py install --prefix %{_prefix} --root $RPM_BUILD_ROOT)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv VBoxSysInfo.sh $RPM_BUILD_ROOT/usr/share/virtualbox
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv VBoxCreateUSBNode.sh $RPM_BUILD_ROOT/usr/share/virtualbox
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynccp icons/128x128/virtualbox.png $RPM_BUILD_ROOT/usr/share/pixmaps/virtualbox.png
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync for i in *; do
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync install -d $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/apps
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync mv $i/virtualbox.png $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/apps
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync install -d $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync mv $i/* $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes || true
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncmv virtualbox.xml $RPM_BUILD_ROOT/usr/share/mime/packages
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncfor i in VBoxManage VBoxSVC VBoxSDL VirtualBox VBoxHeadless VBoxExtPackHelperApp VBoxBalloonCtrl vboxwebsrv webtest; do
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncfor i in VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl; do
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync chmod 4511 $RPM_BUILD_ROOT/usr/lib/virtualbox/$i; done
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync --save-module-symvers /tmp/vboxdrv-Module.symvers \
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncfor i in rdesktop-vrdp.tar.gz rdesktop-vrdp-keymaps additions/VBoxGuestAdditions.iso; do
if [ -d accessible ]; then
%pre
if [ -n "$VBOXSVC_PID" ]; then
# XXX remove old modules from previous versions (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
%post
echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
# install udev rule (disable with INSTALL_NO_UDEV=1 in /etc/default/virtualbox)
echo "KERNEL=${udev_fix}\"vboxdrv\", NAME=\"vboxdrv\", OWNER=\"root\", GROUP=\"root\", MODE=\"0600\"" \
echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"add\", RUN=\"${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" \
echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"add\", ENV{DEVTYPE}==\"usb_device\", RUN=\"${usb_createnode} \$major \$minor \$attr{bDeviceClass}\"" \
echo "SUBSYSTEM=${udev_fix}\"usb_device\", ACTION=${udev_fix}\"remove\", RUN=\"${usb_createnode} --remove \$major \$minor\"" \
echo "SUBSYSTEM=${udev_fix}\"usb\", ACTION=${udev_fix}\"remove\", ENV{DEVTYPE}==\"usb_device\", RUN=\"${usb_createnode} --remove \$major \$minor\"" \
# create users groups (disable with INSTALL_NO_GROUP=1 in /etc/default/virtualbox)
# Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
cat << EOF
if [ -n "$DKMS" ]; then
if [ -n "$VBOXSVC_PID" ]; then
if [ -n "$DKMS" ]; then