VirtualBox.tmpl.spec revision 9704f1d0180960069e2c4eb8fe2ddee350910e5d
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Spec file for creating VirtualBox rpm packages
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync# Copyright (C) 2006-2011 Oracle Corporation
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# available from http://www.virtualbox.org. This file is free software;
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# you can redistribute it and/or modify it under the terms of the GNU
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# General Public License as published by the Free Software Foundation,
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncVirtualBox is a powerful PC virtualization solution allowing
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncyou to run a wide range of PC operating systems on your Linux
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncsystem. This includes Windows, Linux, FreeBSD, DOS, OpenBSD
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsyncand others. VirtualBox comes with a broad feature set and
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncexcellent performance, making it the premier virtualization
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync# Mandriva: prevent replacing 'echo' by 'gprintf'
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/applications
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/icons/hicolor
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT%{_defaultdocdir}/virtualbox
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/lib/virtualbox/ExtensionPacks
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/virtualbox
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncinstall -m 755 -d $RPM_BUILD_ROOT/usr/share/mime/packages
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncmv VBoxEFI32.fd $RPM_BUILD_ROOT/usr/lib/virtualbox || true
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncmv VBoxEFI64.fd $RPM_BUILD_ROOT/usr/lib/virtualbox || true
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncmv components $RPM_BUILD_ROOT/usr/lib/virtualbox/components
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncmv *.so.4 $RPM_BUILD_ROOT/usr/lib/virtualbox || true
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync %{__python} ./vboxapisetup.py install --prefix %{_prefix} --root $RPM_BUILD_ROOT)
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncmv VBoxSysInfo.sh $RPM_BUILD_ROOT/usr/share/virtualbox
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncmv VBoxCreateUSBNode.sh $RPM_BUILD_ROOT/usr/share/virtualbox
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsynccp icons/128x128/virtualbox.png $RPM_BUILD_ROOT/usr/share/pixmaps/virtualbox.png
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync for i in *; do
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync install -d $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/apps
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync mv $i/virtualbox.png $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/apps
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync install -d $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync mv $i/* $RPM_BUILD_ROOT/usr/share/icons/hicolor/$i/mimetypes || true
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncmv virtualbox.xml $RPM_BUILD_ROOT/usr/share/mime/packages
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncfor i in VBoxManage VBoxSVC VBoxSDL VirtualBox VBoxHeadless VBoxExtPackHelperApp VBoxBalloonCtrl vboxwebsrv webtest; do
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsyncfor i in VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl; do
8d974ced0dc3540dd1b3ec85f8663388e246461avboxsync chmod 4511 $RPM_BUILD_ROOT/usr/lib/virtualbox/$i; done
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync --save-module-symvers /tmp/vboxdrv-Module.symvers \
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
c285785ffc9f35513e0c6e7e2a05df3090dc919cvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsync KBUILD_VERBOSE= KERN_DIR=$d/build MODULE_DIR=$RPM_BUILD_ROOT/$d/misc -j4 \
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncfor i in rdesktop-vrdp.tar.gz rdesktop-vrdp-keymaps additions/VBoxGuestAdditions.iso; do
037f4c44a9ef4e458f46b264aebd12df049b0f0cvboxsyncif [ -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