fix dkms build by installing each module in its own directory in /usr/src [release 5.2.2-2mamba;Sat Dec 23 2017]

This commit is contained in:
Silvan Calarco 2024-01-05 17:54:49 +01:00
parent beecc3d02f
commit e791652c21
2 changed files with 135 additions and 122 deletions

View File

@ -0,0 +1,12 @@
Fix FTBFS by not compile X.org-1.19 drv, we don't use it, just need in el <= 7
--- ./src/VBox/Additions/x11/vboxvideo/Makefile.kmk.orig 2016-10-11 02:49:23.184986182 +0100
+++ ./src/VBox/Additions/x11/vboxvideo/Makefile.kmk 2016-10-11 02:49:39.879176964 +0100
@@ -376,7 +376,7 @@ vboxvideo_drv_118_SOURCES := $(vboxvideo
ifdef VBOX_USE_SYSTEM_XORG_HEADERS
# Build using local X.Org headers. We assume X.Org Server 1.7 or later.
- DLLS := $(filter-out vboxvideo_drv_%,$(DLLS)) vboxvideo_drv_system
+ DLLS := $(filter-out vboxvideo_drv_%,$(DLLS))
SYSMODS := $(filter-out vboxvideo_drv%,$(SYSMODS))
vboxvideo_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
vboxvideo_drv_system_CFLAGS := \

View File

@ -17,8 +17,8 @@
%endif
Name: VirtualBox
Version: 5.1.22
Release: 1mamba
Version: 5.2.2
Release: 2mamba
Summary: A general-purpose full virtualizer for x86 hardware
Group: Graphical Desktop/Applications/Utilities
Vendor: openmamba
@ -42,6 +42,7 @@ Patch5: VirtualBox-4.3.26-vdfuse.patch
Patch6: VirtualBox-5.0.4-x86-upstream-buildfixes.patch
Patch7: VirtualBox-5.1.22-build-gsoap.patch
Patch8: VirtualBox-5.0.24-ogl-include-path.patch
Patch9: VirtualBox-5.2.2-no-vboxvideo.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -59,18 +60,19 @@ BuildRequires: libXrandr-devel
BuildRequires: libXt-devel
BuildRequires: libcurl-devel
BuildRequires: libdevmapper-devel
BuildRequires: libfuse-devel
BuildRequires: libgcc
BuildRequires: libglib-devel
BuildRequires: libopenssl-devel
BuildRequires: libpam-devel
BuildRequires: libpng-devel
BuildRequires: libpython26-devel
BuildRequires: libpython27-devel
BuildRequires: libqt4-devel
BuildRequires: libpython3-devel
BuildRequires: libpython36-devel
BuildRequires: libqt5-devel
BuildRequires: libstdc++6-devel
BuildRequires: libvncserver-devel
BuildRequires: libvpx-devel
BuildRequires: libxcb-devel
BuildRequires: libxml2-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
@ -83,7 +85,6 @@ BuildRequires: latex-ucs
BuildRequires: latex-font-bera
BuildRequires: gsoap-devel
BuildRequires: jdk
BuildRequires: libfuse-devel
BuildRequires: librtmp-devel
Provides: kernelvboxdrv
Obsoletes: kernelvboxdrv
@ -97,6 +98,14 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
VirtualBox is a general-purpose full virtualizer for x86 hardware.
Targeted at server, desktop and embedded use, it is the professional-quality virtualization solution that is also Open Source Software.
%package devel
Summary: VirtualBox library headers
Group: Applications/Development
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description devel
VirtualBox library headers.
%package web
Summary: A service which allows to control VirtualBox from the Web
Group: Applications/Web
@ -164,7 +173,8 @@ Kernel DRM driver for VirtualBox guest machines.
%patch5 -p1
#%patch6 -p2
%patch7 -p1
%patch8 -p1
#%patch8 -p1
%patch9 -p1
echo "\
VBOX_WITH_ORIGIN :=
@ -185,6 +195,8 @@ VBOX_JAVA_HOME=%{_jvmdir}/jdk
VBOX_GSOAP_CXX_LIBS=gsoapssl++ z
# use system xorg
VBOX_USE_SYSTEM_XORG_HEADERS=1
# use system libGL
VBOX_USE_SYSTEM_GL_HEADERS=1
# no update request
VBOX_WITH_UPDATE_REQUEST=
VBOX_GCC_OPT=%{optflags}" > LocalConfig.kmk
@ -209,7 +221,7 @@ export CXXFLAGS="%optflags"
--disable-java
%endif
#_EOF
_EOF
# --disable-hardening \
# --enable-webservice \
@ -249,9 +261,9 @@ kmk %{?_smp_mflags} CPPFLAGS="%{optflags} -fpermissive"
install -d %{buildroot}%{_libdir}/%{name}
cp -a out/*/release/bin/* %{buildroot}%{_libdir}/%{name}/
install -d %{buildroot}%{_libdir}/xorg/modules/drivers
mv %{buildroot}%{_libdir}/%{name}/additions/vboxvideo_drv_system.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so
rm -f %{buildroot}%{_libdir}/%{name}/additions/vboxvideo_drv*
#install -d %{buildroot}%{_libdir}/xorg/modules/drivers
#mv %{buildroot}%{_libdir}/%{name}/additions/vboxvideo_drv_system.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so
#rm -f %{buildroot}%{_libdir}/%{name}/additions/vboxvideo_drv*
install -d %{buildroot}%{_libdir}/dri
mv %{buildroot}%{_libdir}/%{name}/additions/VBoxOGL.so %{buildroot}%{_libdir}/dri/vboxvideo_dri.so
@ -331,7 +343,7 @@ rm -rf %{buildroot}%{_libdir}/%{name}/VBoxPython2_6.so
# install additions
mv %{buildroot}%{_libdir}/%{name}/additions/VBoxOGL*.so %{buildroot}%{_libdir}/
mv %{buildroot}%{_libdir}/%{name}/additions/vboxadd-service %{buildroot}%{_initrddir}/vboxadd
cp src/VBox/Additions/linux/installer/vboxadd-service.sh %{buildroot}%{_initrddir}/vboxadd
install -d -m 0755 %{buildroot}%{_sbindir}
mv %{buildroot}%{_libdir}/%{name}/additions/{VBoxService,VBoxClient,VBoxControl} %{buildroot}%{_sbindir}/
@ -358,62 +370,34 @@ _EOF
#/lib/modules/%{KERNEL_VER}%{KERNEL_TARGET}/kernel/drivers/virtualbox/vboxpci.ko
# dkms
install -d -m0755 %{buildroot}%{_prefix}/src/%{name}-%{version}
cp -a out/linux.%virtualbox_arch/release/bin/src/* %{buildroot}%{_prefix}/src/%{name}-%{version}/
cat > %{buildroot}%{_prefix}/src/%{name}-%{version}/dkms.conf << _EOF
PACKAGE_NAME=%{name}
PACKAGE_VERSION=%{version}
MAKE="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build modules"
CLEAN="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build clean"
BUILT_MODULE_NAME[0]=vboxdrv
BUILT_MODULE_NAME[1]=vboxnetadp
BUILT_MODULE_NAME[2]=vboxnetflt
BUILT_MODULE_NAME[3]=vboxpci
BUILT_MODULE_LOCATION[0]=./vboxdrv/
BUILT_MODULE_LOCATION[1]=./vboxnetadp/
BUILT_MODULE_LOCATION[2]=./vboxnetflt/
BUILT_MODULE_LOCATION[3]=./vboxpci/
DEST_MODULE_LOCATION[0]=/kernel/drivers/virtualbox
DEST_MODULE_LOCATION[1]=/kernel/drivers/virtualbox
DEST_MODULE_LOCATION[2]=/kernel/drivers/virtualbox
DEST_MODULE_LOCATION[3]=/kernel/drivers/virtualbox
REMAKE_INITRD=no
AUTOINSTALL=yes
_EOF
for p in vboxdrv vboxnetadp vboxnetflt vboxpci; do
install -d -m0755 %{buildroot}%{_prefix}/src/${p}-%{version}
cp -a out/linux.%virtualbox_arch/release/bin/src/${p}/* %{buildroot}%{_prefix}/src/${p}-%{version}/
done
# dkms for vboxvideo
install -d -m0755 %{buildroot}%{_prefix}/src/vboxvideo-%{version}
cp -a out/linux.%virtualbox_arch/release/bin/additions/src/vboxvideo/* %{buildroot}%{_prefix}/src/vboxvideo-%{version}/
cat > %{buildroot}%{_prefix}/src/vboxvideo-%{version}/dkms.conf << _EOF
PACKAGE_NAME=%{name}
PACKAGE_VERSION=%{version}
MAKE="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/vboxvideo/\${PACKAGE_VERSION}/build modules"
CLEAN="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/vboxvideo/\${PACKAGE_VERSION}/build clean"
BUILT_MODULE_NAME=vboxvideo
BUILT_MODULE_LOCATION=./
DEST_MODULE_LOCATION=/kernel/drivers/virtualbox
REMAKE_INITRD=no
AUTOINSTALL=yes
_EOF
# dkms for vboxguest
install -d -m0755 %{buildroot}%{_prefix}/src/vboxguest-%{version}
cp -a out/linux.%virtualbox_arch/release/bin/additions/src/vboxguest/* %{buildroot}%{_prefix}/src/vboxguest-%{version}/
cat > %{buildroot}%{_prefix}/src/vboxguest-%{version}/dkms.conf << _EOF
PACKAGE_NAME=%{name}
for p in vboxdrv vboxnetadp vboxnetflt vboxpci vboxvideo vboxguest; do
cat > %{buildroot}%{_prefix}/src/${p}-%{version}/dkms.conf << _EOF
PACKAGE_NAME=${p}
PACKAGE_VERSION=%{version}
MAKE="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/vboxguest/\${PACKAGE_VERSION}/build modules"
CLEAN="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/vboxguest/\${PACKAGE_VERSION}/build clean"
BUILT_MODULE_NAME=vboxguest
MAKE="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build modules"
CLEAN="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build clean"
BUILT_MODULE_NAME=${p}
BUILT_MODULE_LOCATION=./
DEST_MODULE_LOCATION=/kernel/drivers/virtualbox
REMAKE_INITRD=no
AUTOINSTALL=yes
_EOF
done
# load modules at boot
install -d %{buildroot}%{_prefix}/lib/modules-load.d
cat > %{buildroot}%{_prefix}/lib/modules-load.d/virtualbox.conf << _EOF
@ -423,19 +407,31 @@ vboxnetadp
vboxpci
_EOF
# build and install vdfuse
cd vdfuse
sed -i "s|-l:||" vdbuild_new
export INSTALL_DIR=%{buildroot}%{_libdir}/%{name}
sh ./vdbuild_new ../include/ vdfuse.c
install -m0755 vdfuse %{buildroot}%{_bindir}/vdfuse
cd ..
## build and install vdfuse
#cd vdfuse
#sed -i "s|-l:||" vdbuild_new
#export INSTALL_DIR=%{buildroot}%{_libdir}/%{name}
#sh ./vdbuild_new ../include/ vdfuse.c
#install -m0755 vdfuse %{buildroot}%{_bindir}/vdfuse
#cd ..
# install headers for vdfuse
install -d -m0755 %{buildroot}%{_includedir}/virtualbox
cp -a include/{VBox,iprt} %{buildroot}%{_includedir}/virtualbox/
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
if [ $1 -ge 1 ]; then
# legacy cleanup
dkms remove -q -m %{name} -v 4.2.10 --all || true
dkms remove -q -m %{name} -v 4.2.12 --all || true
dkms remove -q -m %{name} -v 4.2.14 --all || true
dkms remove -q -m %{name} -v 4.2.16 --all || true
dkms remove -q -m %{name} -v 4.2.18 --all || true
rm -rf /var/lib/dkms/VirtualBox
# fix a mess with file being adirectory in 5.0.4-1mamba
[ -d %{_prefix}/lib/modules-load.d/virtualbox.conf ] && \
rmdir %{_prefix}/lib/modules-load.d/virtualbox.conf
@ -444,23 +440,17 @@ fi
:
%post
#if [ $1 -ge 1 ]; then
# systemctl -q daemon-reload
#fi
/sbin/ldconfig
:
%preun
# erase
dkms remove -q -m %{name} -v 4.2.10 --all || true
dkms remove -q -m %{name} -v 4.2.12 --all || true
dkms remove -q -m %{name} -v 4.2.14 --all || true
dkms remove -q -m %{name} -v 4.2.16 --all || true
dkms remove -q -m %{name} -v 4.2.18 --all || true
if [ $1 -eq 0 ]; then
%{_sbindir}/groupdel vboxusers 2>/dev/null
dkms remove -q -m %{name} -v %{version} --all
fi
for p in vboxdrv vboxnetadp vboxnetflt vboxpci; do
dkms remove -q -m ${p} -v %{version} --all
done
:
#%postun
@ -470,32 +460,34 @@ fi
#fi
#:
%post web
# new install
if [ $1 -eq 1 ]; then
systemctl daemon-reload
systemctl enable vboxweb-service
systemctl start vboxweb-service start
%posttrans
if [ $1 -ge 1 ]; then
for p in vboxdrv vboxnetadp vboxnetflt vboxpci; do
dkms add -q -m ${p} -v %{version}
dkms install -q -m ${p} -v %{version} --force
done
fi
:
%post web
%systemd_post vboxweb-service
:
%preun web
# erase
if [ $1 -eq 0 ]; then
systemctl stop vboxweb-service
systemctl disable vboxweb-service
fi
%systemd_preun vboxweb-service
:
%postun web
# upgrade
if [ $1 -eq 1 ]; then
systemctl restart vboxweb-service
fi
%systed_postun_with_restart wboxweb-service
:
%preun vboxguest
# erase
dkms remove -q -m vboxguest -v %{version} --all
dkms remove -q -m vboxvideo -v %{version} --all
:
%post vboxguest
dkms remove -q -m vboxguest -v 4.2.10 --all
dkms remove -q -m vboxvideo -v 4.2.10 --all
dkms remove -q -m vboxguest -v 4.2.12 --all
@ -506,17 +498,6 @@ dkms remove -q -m vboxguest -v 4.2.16 --all
dkms remove -q -m vboxvideo -v 4.2.16 --all
dkms remove -q -m vboxguest -v 4.2.18 --all
dkms remove -q -m vboxvideo -v 4.2.18 --all
if [ $1 -eq 0 ]; then
dkms remove -q -m vboxguest -v %{version} --all
dkms remove -q -m vboxvideo -v %{version} --all
fi
:
%posttrans
if [ $1 -ge 1 ]; then
dkms add -q -m %{name} -v %{version}
dkms install -q -m %{name} -v %{version} --force
fi
:
%posttrans vboxguest
@ -530,8 +511,6 @@ fi
%files
%defattr(-,root,root)
%dir %{_prefix}/src/%{name}-%{version}/
%{_prefix}/src/%{name}-%{version}/*
%config %{_sysconfdir}/vbox/vbox.cfg
%config(noreplace) %{_sysconfdir}/default/virtualbox
%{_sysconfdir}/pm/config.d/vboxdrv
@ -539,15 +518,11 @@ fi
%{_bindir}/VBoxManage
%{_bindir}/VBoxSDL
%{_bindir}/VirtualBox
%{_bindir}/vdfuse
%{_bindir}/vditool
/lib/udev/rules.d/59-vboxdrv.rules
/lib/udev/VBoxCreateUSBNode.sh
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/DbgPlugInDiggers.so
%{_libdir}/%{name}/vboxautostart-service.sh
%{_libdir}/%{name}/vboxballoonctrl-service.sh
%{_libdir}/%{name}/vboxweb-service.sh
%{_libdir}/%{name}/SUPInstall
%{_libdir}/%{name}/SUPUninstall
%attr(4755,root,root) %{_libdir}/%{name}/VirtualBox
@ -558,12 +533,31 @@ fi
%attr(4755,root,root) %{_libdir}/%{name}/VBoxNetNAT
%{_libdir}/%{name}/VirtualBox.so
%{_libdir}/%{name}/*.sh
%{_libdir}/%{name}/VBox*
%{_libdir}/%{name}/VBox*.so
%{_libdir}/%{name}/VMMRC.rc
%{_libdir}/%{name}/VMMRC.debug
%{_libdir}/%{name}/VMMR0.r0
%{_libdir}/%{name}/VMMR0.debug
%{_libdir}/%{name}/iPxeBaseBin
%{_libdir}/VirtualBox/VBox.png
%{_libdir}/VirtualBox/VBoxAutostart
%{_libdir}/VirtualBox/VBoxBalloonCtrl
%{_libdir}/VirtualBox/VBoxBugReport
%{_libdir}/VirtualBox/VBoxCpuReport
%{_libdir}/VirtualBox/VBox*.debug
%{_libdir}/VirtualBox/VBox*.r0
%{_libdir}/VirtualBox/VBox*.rc
%{_libdir}/VirtualBox/VBox*.fd
%{_libdir}/VirtualBox/VBoxDTrace
%{_libdir}/VirtualBox/VBoxExtPackHelperApp
%{_libdir}/VirtualBox/VBoxManage
%{_libdir}/VirtualBox/VBoxManageHelp
%{_libdir}/VirtualBox/VBoxSVC
%{_libdir}/VirtualBox/VBoxTestOGL
%{_libdir}/VirtualBox/VBoxTunctl
%{_libdir}/VirtualBox/VBoxVMMPreload
%{_libdir}/VirtualBox/VBoxVolInfo
%{_libdir}/VirtualBox/VBoxXPCOMIPCD
%dir %{_libdir}/%{name}/components
%{_libdir}/%{name}/components/VBox*.so
%{_libdir}/%{name}/components/VBoxXPCOMBase.xpt
@ -575,6 +569,8 @@ fi
%{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/*
%dir %{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.*/
%{_libdir}/%{name}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.*/*
%dir %{_libdir}/%{name}/UnattendedTemplates
%{_libdir}/%{name}/UnattendedTemplates/*
%dir %{_libdir}/VirtualBox/dtrace
%dir %{_libdir}/VirtualBox/dtrace/lib
%{_libdir}/VirtualBox/dtrace/lib/*
@ -591,26 +587,13 @@ fi
%if "%{stage1}" != "1"
%{_libdir}/%{name}/libvboxjxpcom.so
%endif
%{_libdir}/%{name}/load.sh
%{_libdir}/%{name}/loadall.sh
%dir %{_libdir}/%{name}/nls
%{_libdir}/%{name}/nls/VirtualBox_*.qm
%{_libdir}/%{name}/nls/qt_*.qm
%{_libdir}/%{name}/postinst-common.sh
%{_libdir}/%{name}/prerm-common.sh
%{_libdir}/%{name}/routines.sh
%dir %{_libdir}/%{name}/scripts
%{_libdir}/%{name}/scripts/*
%{_libdir}/%{name}/tools/*
#%{_libdir}/%{name}/scm
#%{_libdir}/%{name}/nls3/qt_*.qm
#%{_libdir}/%{name}/nls3/VirtualBox_*.qm
%{_libdir}/%{name}/SUPLoggerCtl
#%{_libdir}/%{name}/UserManual.pdf
#%{_libdir}/%{name}/webtest
#%lang(fr) %{_libdir}/%{name}/UserManual_fr_FR.pdf
#%{_libdir}/%{name}/vbox-img
%{_libdir}/%{name}/vbox-run.sh
%{_libdir}/%{name}/vboxkeyboard.tar.bz2
%ifarch x86_64
%{_libdir}/%{name}/vboxshell.py
@ -619,14 +602,26 @@ fi
%{_libdir}/%{name}/virtualbox.xml
%{_libdir}/%{name}/xpidl
%{_libdir}/%{name}/UserManual.pdf
%{_libdir}/dri/vboxvideo_dri.so
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/VBox.png
# dkms
%dir %{_prefix}/src/vboxdrv-%{version}
%{_prefix}/src/vboxdrv-%{version}/*
%dir %{_prefix}/src/vboxnetadp-%{version}
%{_prefix}/src/vboxnetadp-%{version}/*
%dir %{_prefix}/src/vboxnetflt-%{version}
%{_prefix}/src/vboxnetflt-%{version}/*
%dir %{_prefix}/src/vboxpci-%{version}
%{_prefix}/src/vboxpci-%{version}/*
%doc COPYING
#%files -n xorg-drv-input-vboxmouse
#%defattr(-,root,root)
#%{_libdir}/xorg/modules/input/vboxmouse_drv.so
%files devel
%defattr(-,root,root)
%dir %{_includedir}/virtualbox/
%{_includedir}/virtualbox/VBox
%{_includedir}/virtualbox/iprt
%files web
%defattr(-,root,root)
@ -636,10 +631,10 @@ fi
%{_bindir}/vboxwebsrv
#%{_libdir}/%{name}/vboxwebsrv
%files -n xorg-drv-video-vboxvideo
%defattr(-,root,root)
%{_libdir}/dri/vboxvideo_dri.so
%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so
#%files -n xorg-drv-video-vboxvideo
#%defattr(-,root,root)
#%{_libdir}/dri/vboxvideo_dri.so
#%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so
%files additions
%defattr(-,root,root)
@ -653,7 +648,7 @@ fi
%{_libdir}/%{name}/additions/mount.vboxsf
%{_libdir}/%{name}/additions/pam_vbox.so
%{_libdir}/%{name}/additions/runasroot.sh
%{_libdir}/%{name}/additions/vboxadd*
#%{_libdir}/%{name}/additions/vboxadd*
%files additions-VBoxGuest
%defattr(-,root,root)
@ -667,6 +662,12 @@ fi
%{_prefix}/src/vboxvideo-%{version}/*
%changelog
* Sat Dec 23 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2.2-2mamba
- fix dkms build by installing each module in its own directory in /usr/src
* Fri Dec 08 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2.2-1mamba
- update to 5.2.2
* Sun Jun 18 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.22-1mamba
- update to 5.1.22