commit 2a1aef55557d008fbc77ca0a59ae02c087d8cb82
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sun Mar 18 11:47:47 2018 +0000
Add patches from virtualbox-guest-additions of Fedora proper
python-VirtualBox renamed to python2-VirtualBox
See
https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
Enable vnc
...AutoMount-Change-Linux-mount-code-to-use-.patch | 130 +++++++++++++++++++++
VirtualBox-5.2.6-xclient.patch | 20 ++++
VirtualBox.spec | 65 ++++++++---
3 files changed, 196 insertions(+), 19 deletions(-)
---
diff --git a/0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
b/0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
new file mode 100644
index 0000000..625d554
--- /dev/null
+++ b/0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
@@ -0,0 +1,130 @@
+From 369dd2ee3c82c4417fee04aeec933c74fd198e78 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede(a)redhat.com>
+Date: Tue, 23 Jan 2018 15:09:20 +0100
+Subject: [PATCH resend] VBoxServiceAutoMount: Change Linux mount code to use
+ an options string
+
+Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
+---
+ .../common/VBoxService/VBoxServiceAutoMount.cpp | 62 +++-------------------
+ 1 file changed, 8 insertions(+), 54 deletions(-)
+
+diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
+index aa15d8b1..551edd4a 100644
+--- a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
++++ b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
+@@ -39,6 +39,7 @@
+ #include <iprt/assert.h>
+ #include <iprt/dir.h>
+ #include <iprt/mem.h>
++#include <iprt/param.h>
+ #include <iprt/path.h>
+ #include <iprt/string.h>
+ #include <iprt/semaphore.h>
+@@ -77,6 +78,9 @@ RT_C_DECLS_END
+ # endif
+ #endif
+
++#ifndef MAX_MNTOPT_STR
++#define MAX_MNTOPT_STR PAGE_SIZE
++#endif
+
+
/*********************************************************************************************************************************
+ * Global Variables
*
+@@ -297,13 +301,13 @@ static int vbsvcAutoMountSharedFolder(const char *pszShareName,
const char *pszM
+ rc = vbsvcAutoMountPrepareMountPoint(pszMountPoint, pszShareName, pOpts);
+ if (!fSkip && RT_SUCCESS(rc))
+ {
+-#ifdef RT_OS_SOLARIS
+ char szOptBuf[MAX_MNTOPT_STR] = { '\0', };
++ RTStrPrintf(szOptBuf, sizeof(szOptBuf),
"uid=%d,gid=%d,dmode=%0o,fmode=%0o,dmask=%0o,fmask=%0o",
++ pOpts->uid, pOpts->gid, pOpts->dmode, pOpts->fmode,
pOpts->dmask, pOpts->fmask);
++#ifdef RT_OS_SOLARIS
+ int fFlags = 0;
+ if (pOpts->ronly)
+ fFlags |= MS_RDONLY;
+- RTStrPrintf(szOptBuf, sizeof(szOptBuf),
"uid=%d,gid=%d,dmode=%0o,fmode=%0o,dmask=%0o,fmask=%0o",
+- pOpts->uid, pOpts->gid, pOpts->dmode, pOpts->fmode,
pOpts->dmask, pOpts->fmask);
+ int r = mount(pszShareName,
+ pszMountPoint,
+ fFlags | MS_OPTIONSTR,
+@@ -320,32 +324,11 @@ static int vbsvcAutoMountSharedFolder(const char *pszShareName,
const char *pszM
+
+ #elif defined(RT_OS_LINUX)
+ unsigned long fFlags = MS_NODEV;
+-
+- /*const char *szOptions = { "rw" }; - ??? */
+- struct vbsf_mount_info_new mntinf;
+-
+- mntinf.nullchar = '\0';
+- mntinf.signature[0] = VBSF_MOUNT_SIGNATURE_BYTE_0;
+- mntinf.signature[1] = VBSF_MOUNT_SIGNATURE_BYTE_1;
+- mntinf.signature[2] = VBSF_MOUNT_SIGNATURE_BYTE_2;
+- mntinf.length = sizeof(mntinf);
+-
+- mntinf.uid = pOpts->uid;
+- mntinf.gid = pOpts->gid;
+- mntinf.ttl = pOpts->ttl;
+- mntinf.dmode = pOpts->dmode;
+- mntinf.fmode = pOpts->fmode;
+- mntinf.dmask = pOpts->dmask;
+- mntinf.fmask = pOpts->fmask;
+-
+- strcpy(mntinf.name, pszShareName);
+- strcpy(mntinf.nls_name, "\0");
+-
+ int r = mount(pszShareName,
+ pszMountPoint,
+ "vboxsf",
+ fFlags,
+- &mntinf);
++ szOptBuf);
+ if (r == 0)
+ {
+ VGSvcVerbose(0, "vbsvcAutoMountWorker: Shared folder '%s' was
mounted to '%s'\n", pszShareName, pszMountPoint);
+@@ -378,34 +361,6 @@ static int vbsvcAutoMountSharedFolder(const char *pszShareName,
const char *pszM
+ }
+ else /* r == -1, we got some error in errno. */
+ {
+- if (errno == EPROTO)
+- {
+- VGSvcVerbose(3, "vbsvcAutoMountWorker: Messed up share name,
re-trying ...\n");
+-
+- /** @todo r=bird: What on earth is going on here????? Why can't
you
+- * strcpy(mntinf.name, pszShareName) to fix it again? */
+-
+- /* Sometimes the mount utility messes up the share name. Try to
+- * un-mangle it again. */
+- char szCWD[RTPATH_MAX];
+- size_t cchCWD;
+- if (!getcwd(szCWD, sizeof(szCWD)))
+- {
+- VGSvcError("vbsvcAutoMountWorker: Failed to get the current
working directory\n");
+- szCWD[0] = '\0';
+- }
+- cchCWD = strlen(szCWD);
+- if (!strncmp(pszMountPoint, szCWD, cchCWD))
+- {
+- while (pszMountPoint[cchCWD] == '/')
+- ++cchCWD;
+- /* We checked before that we have enough space */
+- strcpy(mntinf.name, pszMountPoint + cchCWD);
+- }
+- r = mount(mntinf.name, pszMountPoint, "vboxsf", fFlags,
&mntinf);
+- }
+- if (r == -1) /* Was there some error from one of the tries above? */
+- {
+ switch (errno)
+ {
+ /* If we get EINVAL here, the system already has mounted the Shared
Folder to another
+@@ -424,7 +379,6 @@ static int vbsvcAutoMountSharedFolder(const char *pszShareName, const
char *pszM
+ rc = RTErrConvertFromErrno(errno);
+ break;
+ }
+- }
+ }
+ #else
+ # error "PORTME"
+--
+2.14.3
+
diff --git a/VirtualBox-5.2.6-xclient.patch b/VirtualBox-5.2.6-xclient.patch
new file mode 100644
index 0000000..75eabab
--- /dev/null
+++ b/VirtualBox-5.2.6-xclient.patch
@@ -0,0 +1,20 @@
+diff -up VirtualBox-5.2.6/src/VBox/Additions/x11/Installer/98vboxadd-xclient~
VirtualBox-5.2.6/src/VBox/Additions/x11/Installer/98vboxadd-xclient
+--- VirtualBox-5.2.6/src/VBox/Additions/x11/Installer/98vboxadd-xclient~ 2018-01-15
15:49:57.000000000 +0100
++++ VirtualBox-5.2.6/src/VBox/Additions/x11/Installer/98vboxadd-xclient 2018-02-07
12:13:51.578170786 +0100
+@@ -21,13 +21,9 @@ for i in $HOME/.vboxclient-*.pid; do
+ test -w $i || rm -f $i
+ done
+
+-if ! test -c /dev/vboxguest 2>/dev/null; then
+- # Do not start if the kernel module is not present.
+- notify-send "VBoxClient: the VirtualBox kernel service is not running.
Exiting."
+-elif test -z "${SSH_CONNECTION}"; then
+- # This script can also be triggered by a connection over SSH, which is not
+- # what we had in mind, so we do not start VBoxClient in that case. We do
+- # not use "exit" here as this script is "source"d, not executed.
++# Do not start if the kernel module is not present; or if this script is
++# triggered by a connection over SSH.
++if [ -c /dev/vboxguest -a -z "${SSH_CONNECTION}" ]; then
+ /usr/bin/VBoxClient --clipboard
+ /usr/bin/VBoxClient --checkhostversion
+ /usr/bin/VBoxClient --display
diff --git a/VirtualBox.spec b/VirtualBox.spec
index 4e0a6bc..bbb7fd8 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -27,13 +27,13 @@
%else
%bcond_without docs
%endif
-%bcond_with vnc
+%bcond_without vnc
%bcond_with legacy_vboxvideo_drv
Name: VirtualBox
Version: 5.2.8
#Release: 1%%{?prerel:.%%{prerel}}%%{?dist}
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPLv2 or (GPLv2 and CDDL)
@@ -67,12 +67,19 @@ Patch28: 02-gsoap-build-fix.patch
Patch50: VirtualBox-5.1.0-add-Mageia-support.patch
Patch51: VirtualBox-5.1.0-revert-VBox.sh.patch
+Patch60: VirtualBox-5.2.6-xclient.patch
+Patch61: 0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
+
BuildRequires: kBuild >= 0.1.9998.r3093
-BuildRequires: SDL-devel xalan-c-devel
+BuildRequires: SDL-devel
BuildRequires: openssl-devel
BuildRequires: libcurl-devel
-BuildRequires: iasl libxslt-devel xerces-c-devel libIDL-devel
+BuildRequires: iasl
+BuildRequires: libxslt-devel
+BuildRequires: xalan-c-devel
+BuildRequires: xerces-c-devel
+BuildRequires: libIDL-devel
BuildRequires: yasm
BuildRequires: pulseaudio-libs-devel
BuildRequires: python2-devel
@@ -109,24 +116,25 @@ BuildRequires: makeself
# for 32bit on 64
%ifarch x86_64
-BuildRequires: libstdc++-static(x86-32) libgcc(x86-32)
-BuildRequires: libstdc++-static(x86-64)
BuildRequires: glibc-devel(x86-32)
+BuildRequires: libgcc(x86-32)
+BuildRequires: libstdc++-static(x86-32)
+BuildRequires: libstdc++-static(x86-64)
%else
BuildRequires: libstdc++-static
%endif
# For the X11 module
BuildRequires: libdrm-devel
+%if %{with legacy_vboxvideo_drv}
BuildRequires: libpciaccess-devel
-BuildRequires: mesa-libOSMesa-devel
BuildRequires: pixman-devel
+%endif
BuildRequires: xorg-x11-proto-devel
-BuildRequires: xorg-x11-server-devel
-BuildRequires: libXcursor-devel
BuildRequires: libXcomposite-devel
-BuildRequires: libXmu-devel
+BuildRequires: libXcursor-devel
BuildRequires: libXinerama-devel
+BuildRequires: libXmu-devel
BuildRequires: libXrandr-devel
BuildRequires: libXt-devel
BuildRequires: mesa-libEGL-devel
@@ -179,19 +187,23 @@ webservice GUI part for %{name}.
Summary: %{name} SDK
Group: Development/Libraries
Requires: %{name}-server%{?isa} = %{version}-%{release}
-Requires: python-%{name}%{?isa} = %{version}-%{release}
+Requires: python2-%{name}%{?isa} = %{version}-%{release}
%description devel
%{name} Software Development Kit.
-%package -n python-%{name}
+%package -n python2-%{name}
Summary: Python bindings for %{name}
Group: Development/Libraries
Requires: %{name}-server%{?_isa} = %{version}-%{release}
-%{?python_provide:%python_provide python2-%{srcname}}
+%{?python_provide:%python_provide python2-%{name}}
+# Remove before F30
+Provides: python-VirtualBox = %{version}-%{release}
+Provides: python-VirtualBox%{?_isa} = %{version}-%{release}
+Obsoletes: python-VirtualBox < %{version}-%{release}
-%description -n python-%{name}
+%description -n python2-%{name}
Python XPCOM bindings to %{name}.
@@ -244,7 +256,6 @@ rm -r src/VBox/Additions/x11/x11include/
rm -r src/VBox/Additions/x11/x11stubs/
rm include/VBox/HostServices/glext.h
rm include/VBox/HostServices/glxext.h
-
# wglext.h has typedefs for Windows-specific extensions
#rm include/VBox/HostServices/wglext.h
# src/VBox/GuestHost/OpenGL/include/GL/glext.h have VBOX definitions
@@ -265,6 +276,8 @@ rm -r src/libs/zlib-1.2.8/
%endif
%patch50 -p1 -b .mageia-support
%patch51 -p1 -b .revert-VBox.sh
+%patch60 -p1 -b .xclient
+%patch61 -p1 -b .automount
# CRLF->LF
sed -i 's/\r//' COPYING
@@ -314,10 +327,9 @@ kmk %{_smp_mflags} \
%{!?legacy_vboxvideo_drv: VBOX_NO_LEGACY_XORG_X11=1 } \
SDK_VBOX_LIBPNG_INCS=/usr/include/libpng16 \
SDK_VBOX_LIBXML2_INCS=/usr/include/libxml2 \
- SDK_VBOX_OPENSSL_INCS= \
+ SDK_VBOX_OPENSSL_INCS="" \
SDK_VBOX_OPENSSL_LIBS="ssl crypto" \
SDK_VBOX_ZLIB_INCS= \
-
%if %{with docs}
VBOX_WITH_DOCS=1 \
# doc/manual/fr_FR/ missing man_VBoxManage-debugvm.xml and man_VBoxManage-extpack.xml
@@ -435,7 +447,7 @@ install -p -m 0755 -t %{buildroot}%{_libdir}/virtualbox/nls \
# SDK
pushd obj/bin/sdk/installer
VBOX_INSTALL_PATH=%{_libdir}/virtualbox \
- python vboxapisetup.py install --prefix %{_prefix} --root %{buildroot}
+ %{__python2} vboxapisetup.py install --prefix %{_prefix} --root %{buildroot}
popd
cp -rp obj/bin/sdk/. %{buildroot}%{_libdir}/virtualbox/sdk
rm -rf %{buildroot}%{_libdir}/virtualbox/sdk/installer
@@ -504,10 +516,19 @@ install -p -m 0644 -D %{SOURCE8}
%{buildroot}%{_presetdir}/96-vbox.preset
install -p -m 0644 -D %{SOURCE5} %{buildroot}%{_udevrulesdir}/60-vboxguest.rules
install -p -m 0755 -D %{SOURCE9} %{buildroot}%{_bindir}/VBoxOGLRun
install -p -m 0644 -D %{SOURCE6}
%{buildroot}%{_prefix}/lib/modules-load.d/%{name}-guest.conf
+%if 0%{?fedora}
+#sed -i s/vboxvideo/d %{buildroot}%{_prefix}/lib/modules-load.d/%{name}-guest.conf
+sed -i 's/vboxvideo/#vboxvideo/'
%{buildroot}%{_prefix}/lib/modules-load.d/%{name}-guest.conf
+%endif
+%if 0%{?fedora} > 27
+#sed -i s/vboxguest/d %{buildroot}%{_prefix}/lib/modules-load.d/%{name}-guest.conf
+sed -i 's/vboxguest/#vboxguest/'
%{buildroot}%{_prefix}/lib/modules-load.d/%{name}-guest.conf
+%endif
# Module Source Code
mkdir -p %{name}-kmod-%{version}
cp -al obj/bin/src/vbox* obj/bin/additions/src/vbox* %{name}-kmod-%{version}
+#rm -r %{name}-kmod-%{version}/vboxvideo/
install -d %{buildroot}%{_datadir}/%{name}-kmod-%{version}
tar --use-compress-program xz -cf
%{buildroot}%{_datadir}/%{name}-kmod-%{version}/%{name}-kmod-%{version}.tar.xz \
%{name}-kmod-%{version}
@@ -723,7 +744,7 @@ getent passwd vboxadd >/dev/null || \
%{_libdir}/virtualbox/sdk
%exclude %{_libdir}/virtualbox/sdk/bindings/xpcom/python
-%files -n python-%{name}
+%files -n python2-%{name}
%{_libdir}/virtualbox/*.py*
%{python2_sitelib}/virtualbox
%{python2_sitelib}/vboxapi*
@@ -754,6 +775,12 @@ getent passwd vboxadd >/dev/null || \
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Sat Mar 17 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.8-3
+- Add patches from virtualbox-guest-additions of Fedora proper
+- python-VirtualBox renamed to python2-VirtualBox
+ See
https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
+- Enable vnc
+
* Wed Mar 07 2018 Sérgio Basto <sergio(a)serjux.com> - 5.2.8-2
- Fix minor spelling mistakes
- Remove Conflicts between subpackages server and guest-additions