VirtualBox.tmpl.spec revision 14dcfe007d2a64583946ed5e4cfdb458a7f7f03b
#
# Spec file for creating VirtualBox rpm packages
#
#
# Copyright (C) 2006-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License as published by the Free Software Foundation,
# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
# distribution. VirtualBox OSE is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY of any kind.
#
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Release: 1
%prep
%setup -q
DESTDIR=""
unset DESTDIR
# Mandriva: prevent replacing 'echo' by 'gprintf'
export DONT_GPRINTIFY=1
(export VBOX_INSTALL_PATH=/usr/lib/virtualbox && \
%{__python} ./vboxapisetup.py install --prefix %{_prefix} --root $RPM_BUILD_ROOT)
cd icons
for i in *; do
if [ -f $i/virtualbox.png ]; then
fi
rmdir $i
done
cd -
for i in VBoxManage VBoxSVC VBoxSDL VirtualBox VBoxHeadless VBoxExtPackHelperApp VBoxBalloonCtrl VBoxAutostart; do
if %WEBSVC%; then
fi
if [ -d ExtensionPacks/VNC ]; then
fi
%INSTMOD%
%INSTMOD%
%INSTMOD%
%INSTMOD%
fi
done
if [ -d accessible ]; then
fi
%pre
# defaults
# check for active VMs of the installed (old) package
VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
if [ -n "$VBOXSVC_PID" ]; then
# executed before the new package is installed!
# try graceful termination; terminate the balloon control service first
fi
# try graceful termination; terminate the webservice first
fi
# ask the daemon to terminate immediately
kill -USR1 $VBOXSVC_PID
sleep 1
echo "A copy of VirtualBox is currently running. Please close it and try again."
echo "Please note that it can take up to ten seconds for VirtualBox (in particular"
echo "the VBoxSVC daemon) to finish running."
exit 1
fi
fi
# check for old installation
echo "An old installation of VirtualBox was found. To install this package the"
echo "determine the installation directory of the previous installation. After"
exit 1
fi
fi
# XXX remove old modules from previous versions (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox)
if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
fi
%post
#include installer-common.sh
# defaults
# remove old cruft
echo "Found old version of /etc/init.d/vboxdrv.sh, removing."
fi
fi
# XXX SELinux: allow text relocation entries
# create users groups (disable with INSTALL_NO_GROUP=1 in /etc/default/virtualbox)
if [ "$INSTALL_NO_GROUP" != "1" ]; then
echo
echo "Creating group 'vboxusers'. VM users must be member of that group!"
echo
fi
# install udev rule (disable with INSTALL_NO_UDEV=1 in /etc/default/virtualbox)
# Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox
if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then
# compile problem
cat << EOF
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to $LOG.
EOF
fi
fi
# if INSTALL_NO_VBOXDRV is set to 1, remove all shipped modules
if [ "$INSTALL_NO_VBOXDRV" = "1" ]; then
fi
else
fi
if [ -n "$DKMS" ]; then
fi
fi
fi
# $1==0: remove the last version of the package
# $1==1: install the first time
# $1>=2: upgrade
if [ "$1" = 0 ]; then
fi
if [ "$1" = 0 ]; then
# check for active VMs
VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
if [ -n "$VBOXSVC_PID" ]; then
kill -USR1 $VBOXSVC_PID
sleep 1
echo "A copy of VirtualBox is currently running. Please close it and try again."
echo "Please note that it can take up to ten seconds for VirtualBox (in particular"
echo "the VBoxSVC daemon) to finish running."
exit 1
fi
fi
fi
if [ "$1" = 0 ]; then
fi
if [ -n "$DKMS" ]; then
fi
fi
%{?rpm_suse: %{py_sitedir}/*}
%{!?rpm_suse: %{python_sitelib}/*}