# # NOTE!! # # When updating this package, remember to push # kmod-vboxadditions and kmod-virtualbox too # # temp fix for new binutils %define _disable_ld_no_undefined 1 %define ver 6.1.44 %define srcver 6.1.44 %define rel 1 %define kname vboxdrv %define oname VirtualBox %define srcname %{oname}-%{srcver} %define distname %{oname}-%{version} #define dirname vbox-ose %define pkgver %{ver}%{?svndate:-%{svndate}} %define vboxlibdir %{_libdir}/%{name} %define vboxdatadir %{_datadir}/%{name} %define vboxpydir %{python3_sitelib}/vboxapi # (doktor5000) add conditional for build of the webservice, takes quite long to build locally %define build_gsoap 0 # (tmb) add conditional to build vboxvideo ddx (obsolete since switch to virtualbox 5.1 series) %define build_vboxvideo 0 %define build_additions 1 # (tmb) disable dkms-vboxadditions for mga8, they are all in-kernel as of 4.17.2-4, # but not in kernel-linus yet %if %mgaversion <= 7 %define build_additions_dkms 1 %else %define build_additions_dkms 0 %endif %define build_doc 0 %ifarch %{ix86} %define vbox_platform linux.x86 %define build_sdk 0 %endif %ifarch x86_64 %define vbox_platform linux.amd64 %define build_sdk 1 %endif # nuke vbox-specific dependencies, dont provide libGL.so.1 %global __provides_exclude ^VBox|\^libGL\\.so\\.1|\^libEGL\\.so\\.1 %global __requires_exclude ^VBox # Missing build-id in /usr/lib64/virtualbox/iPxeBaseBin %define _missing_build_ids_terminate_build 0 %global x11_server_majorver %(pkg-config --modversion xorg-server|awk -F. '{print $1$2}') # (tmb) define path to kernel-desktop-devel headers we build against %global kernver %(rpm -q --qf \\'\\%\\{VERSION\\}\\' kernel-desktop-devel-latest) %global kernrel %(rpm -q --qf \\'\\%\\{RELEASE\\}\\' kernel-desktop-devel-latest) %global kernel_devel_path /usr/src/kernel-%{kernver}-desktop-%{kernrel} Summary: A general-purpose full virtualizer for x86 hardware Name: virtualbox Version: %{ver}%{?svndate:.%{svndate}} Release: %mkrel %{rel} Source0: https://download.virtualbox.org/virtualbox/%ver/%{srcname}.tar.bz2 # systemd host files Source2: vboxhost.service Source3: 96-vboxhost.preset Source4: virtualbox-tmpfiles.conf # systemd web files Source5: vboxweb.service # systemd guest files Source6: vboxguest.service Source7: vboxdrmclient.service Source8: 96-vboxguest.preset # (tmb: mga icons submitted upstream 2011-10-22) Source20: os_mageia.png Source21: os_mageia_64.png Source22: os_mageia_x2.png Source23: os_mageia_64_x2.png Source24: os_mageia_x3.png Source25: os_mageia_64_x3.png Source26: os_mageia_x4.png Source27: os_mageia_64_x4.png ### Patches Patch3: VirtualBox-5.1.0-futex.patch Patch4: VirtualBox-5.2.2-fix-vboxadd-req.patch # from rpmfusion Patch5: VirtualBox-6.1.16-xclient-cleanups.patch # don't check for: # - makeself: we're not going to create the stanalone .run installers Patch9: VirtualBox-5.2.16-dont-check-for-makeself.patch # add Mageia support (tmb: submitted upstream 2011-10-22) Patch13: VirtualBox-6.1.36-add-Mageia-support.patch # (tmb) Default to Mageia Patch14: VirtualBox-6.1.36-default-to-Mageia.patch # (tmb) default to no update checks as we provide rpms Patch15: VirtualBox-6.0.0-noupdate-check.patch # (tmb) fix build with gsoap >= 2.8.13 Patch16: VirtualBox-5.1.4-fix-build-with-gsoap-2.8.13-and-up.patch # (tmb) revert to working Vbox.sh reading config file Patch18: VirtualBox-5.1.0-revert-VBox.sh.patch # reorder python 3.10, 3.9, 3.8 & 3.7 detection Patch20: VirtualBox-6.1.36-python-3.10.patch # fix python shebang Patch21: VirtualBox-5.2.22-vboxshell-python3-shebang.patch # more python3 stuff Patch22: VirtualBox-6.0.10-convert-map-python3.patch # remove duplicated define Patch23: VirtualBox-6.0.10-remove-duplicated-define.patch # really disable updates (Arch) Patch24: VirtualBox-6.1.2-disable-update.patch # OpenSuSe Patch26: virtualbox-gcc-10-hack2.patch # Patch27: VirtualBox-6.1.12-mga-disable-cloud-net.patch # Fix for Qt 5.15 # https://build.opensuse.org/package/view_file/Virtualization/virtualbox/fix-missing-includes-with-qt-5.15.patch Source29: VirtualBox-6.1.14-fix-missing-includes-with-qt-5.15.patch # (tmb) fix VBoxDtrace versioning (mga#27936) Patch33: VirtualBox-6.1.16-ExtPacks-VBoxDTrace-no-publisher-in-version.patch # fix for (mga#27433) # From https://build.opensuse.org/package/view_file/Virtualization/virtualbox/vb-6.1.16-modal-dialog-parent.patch?expand=1 Patch34: VirtualBox-6.1.38-modal-dialog-parent.patch # execute vbox additions scripts as "sourced" when starting X11 Patch36: VirtualBox-6.1.8-vboxadd-xclient-sourced.patch ### ### RPMfusion patches ### https://pkgs.rpmfusion.org/cgit/free/VirtualBox.git ### # build against system libs Patch52: VirtualBox-6.1.42-no-bundles.patch # TODO: REVIEW: fix mount Source53: VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch License: GPLv2 Group: Emulators Url: https://www.virtualbox.org/ ExclusiveArch: x86_64 %{ix86} Requires(post): systemd >= %{systemd_required_version} Requires(post): rpm-helper Requires(preun): rpm-helper Requires(postun): rpm-helper # needed for switching from init scripts to systemd services Requires: systemd Requires: chkconfig %ifarch x86_64 Requires: kmod(vboxdrv.ko) = %{version} %endif Conflicts: dkms-%{name} <= 1.5.0-5 Recommends: %{name}-doc # enforce fixed gcc %if %mgaversion >= 8 BuildRequires: gcc >= 10.3.0-2 BuildRequires: binutils >= 1:2.36.1-1.1 %endif %if %build_gsoap BuildRequires: pkgconfig(gsoap) %endif BuildRequires: dev86 BuildRequires: iasl BuildRequires: nasm BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xmu) BuildRequires: pkgconfig(sdl) BuildRequires: pkgconfig(opus) BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5X11Extras) BuildRequires: pkgconfig(Qt5PrintSupport) BuildRequires: pkgconfig(Qt5OpenGL) BuildRequires: qttools5 BuildRequires: pkgconfig(libIDL-2.0) BuildRequires: pkgconfig(ext2fs) BuildRequires: libxslt-proc BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(xt) BuildRequires: libstdc++-static-devel BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(libcap) BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(xinerama) BuildRequires: pkgconfig(xcomposite) BuildRequires: pulseaudio-devel BuildRequires: kernel-desktop-devel-latest BuildRequires: pkgconfig(glu) BuildRequires: mesagl-devel BuildRequires: pkgconfig(xmu) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libcurl) BuildRequires: dkms-minimal BuildRequires: libpam-devel BuildRequires: gawk BuildRequires: pkgconfig(xorg-server) BuildRequires: javapackages-tools BuildRequires: java-devel BuildRequires: pkgconfig(devmapper) BuildRequires: boost-devel BuildRequires: pkgconfig(libvpx) BuildRequires: desktop-file-utils BuildRequires: pkgconfig(alsa) %if %{build_doc} # for building the user manual pdf file BuildRequires: texlive BuildRequires: texlive-fontsextra BuildRequires: docbook-dtds %endif BuildRequires: pkgconfig(libxslt) %description VirtualBox is a general-purpose full virtualizer for x86 hardware. %ifarch x86_64 %package -n dkms-%{name} Summary: VirtualBox kernel module Group: System/Kernel and hardware Provides: kmod(vboxdrv.ko) = %{version} ExclusiveArch: x86_64 Requires: dkms >= 2.0.19-37 Requires(post): dkms >= 2.0.19-37 Requires(preun): dkms >= 2.0.19-37 Conflicts: dkms-vboxadditions < 4.0.6 %description -n dkms-%{name} Kernel support for VirtualBox. %endif %if %{build_additions} %package guest-additions Summary: Additions for VirtualBox guest systems Group: Emulators Requires: kmod(vboxguest.ko) Requires: kmod(vboxsf.ko) Requires: kmod(vboxvideo.ko) Requires: x11-driver-video-vboxvideo # needed for switching from init scripts to systemd services Requires: systemd Requires: chkconfig # guest-additions should require xrandr for auto-resizing of guest display to # work without having to restart the X server in the guest VM Requires: xrandr Requires(post): rpm-helper Requires(preun): rpm-helper %description guest-additions This package contains additions for VirtualBox guest systems. It allows to share files with the host system and sync time with host. %endif %if %{build_additions_dkms} %package -n dkms-vboxadditions Summary: Kernel module for VirtualBox additions Group: System/Kernel and hardware Provides: kmod(vboxguest.ko) = %{version} Provides: kmod(vboxsf.ko) = %{version} Provides: kmod(vboxvideo.ko) = %{version} BuildArch: noarch Requires: dkms >= 2.0.19-37 Requires(post): dkms >= 2.0.19-37 Requires(preun): dkms >= 2.0.19-37 Obsoletes: dkms-vboxadd < %{version}-%{release} Provides: dkms-vboxvfs = %{version}-%{release} Obsoletes: dkms-vboxvfs < %{version}-%{release} Provides: dkms-vboxsf = %{version}-%{release} Obsoletes: dkms-vboxsf < %{version}-%{release} Provides: dkms-vboxvideo = %{version}-%{release} Obsoletes: dkms-vboxvideo < %{version}-%{release} Conflicts: dkms-%{name} < 4.0.6 %description -n dkms-vboxadditions Kernel module for VirtualBox additions (ideally only needs to be installed on the guest OS not on the host OS). %endif %if %{build_vboxvideo} %package -n x11-driver-video-vboxvideo Summary: The X.org driver for video in VirtualBox guests Group: System/X11 Recommends: virtualbox-guest-additions Requires: x11-server-common %(xserver-sdk-abi-requires videodrv) %description -n x11-driver-video-vboxvideo The X.org driver for video in VirtualBox guests. %endif %if %{build_doc} %package doc Summary: The user manual PDF file for %{name} Group: Documentation BuildArch: noarch %description doc This package contains the user manual PDF file for %{name}. %endif %if %{build_sdk} %package devel Summary: %{name} SDK Group: Development/Other Requires: %{name} = %{version}-%{release} Requires: python-%{name} = %{version}-%{release} %description devel This package contains the SDK for %{name}. %package -n python-%{name} Summary: %{name} SDK Group: Development/Python Requires: %{name} = %{version}-%{release} %description -n python-%{name} Python XPCOM bindings to %{name}. %endif %prep %setup -q -n %{distname} %autopatch -p1 # add Mageia images cp -a %{SOURCE20} %{SOURCE21} src/VBox/Frontends/VirtualBox/images/ cp -a %{SOURCE22} %{SOURCE23} src/VBox/Frontends/VirtualBox/images/x2/ cp -a %{SOURCE24} %{SOURCE25} src/VBox/Frontends/VirtualBox/images/x3/ cp -a %{SOURCE26} %{SOURCE27} src/VBox/Frontends/VirtualBox/images/x4/ # Remove some bundled sources before patching. rm -rf src/VBox/Additions/x11/x11include rm -rf src/VBox/Additions/x11/x11stubs # remove unwanted bundled libs rm -rf src/libs/libxml2-2.9.4/ rm -rf src/libs/libpng-1.6.36/ rm -rf src/libs/zlib-1.2.13/ # VBOX_BUILD_PUBLISHER is used for distro branding and it must start with # an underscore, and we end it with a dash so the end reslult changes # from upsteam 6.0.10r132055 to a more readable 6.0.10_Mageia-r132055 cat << EOF > LocalConfig.kmk VBOX_BUILD_PUBLISHER:=_%{_vendor} VBOX_PATH_APP_PRIVATE_ARCH:=%{vboxlibdir} VBOX_WITH_ORIGIN:= VBOX_WITH_RUNPATH:=%{vboxlibdir} VBOX_PATH_APP_PRIVATE:=%{vboxlibdir} VBOX_WITH_TESTCASES:= VBOX_WITH_TESTSUITE:= VBOX_JAVA_HOME := %{java_home} VBOX_WITHOUT_ADDITIONS_ISO := 1 VBOX_USE_SYSTEM_XORG_HEADERS := 1 VBOX_NO_LEGACY_XORG_X11 := 1 VBOX_USE_SYSTEM_GL_HEADERS := 1 XSERVER_VERSION := %{x11_server_majorver} VBOX_PATH_APP_DOCS :=%{_defaultdocdir}/virtualbox SVN := VBOX_WITH_MULTIVERSION_PYTHON := 1 EOF %build #make -C fake-linux prepare export LIBPATH_LIB="%{_lib}" ./configure \ %if %build_gsoap --enable-webservice \ %endif --with-linux=%{kernel_devel_path} \ %if ! %build_doc --disable-docs \ %endif || (cat configure.log; exit 1) %if !%{build_additions} sed -rie 's/(VBOX_WITH_LINUX_ADDITIONS\s+:=\s+).*/\1/' AutoConfig.kmk echo VBOX_WITHOUT_ADDITIONS=1 >> LocalConfig.kmk %endif . ./env.sh kmk all %install mkdir -p %{buildroot}%{_bindir} %ifarch x86_64 # install vbox components mkdir -p %{buildroot}%{vboxlibdir} %{buildroot}%{vboxdatadir} (cd out/%{vbox_platform}/release/bin && tar cf - --exclude=additions .) | \ (cd %{buildroot}%{vboxlibdir} && tar xf -) # move noarch files to vboxdatadir mv %{buildroot}%{vboxlibdir}/{VBox*.sh,*.desktop,*.png} %{buildroot}%{vboxdatadir} # install host service files install -p -m 0644 -D %{SOURCE2} %{buildroot}%{_unitdir}/vboxhost.service install -p -m 0644 -D %{SOURCE3} %{buildroot}%{_presetdir}/96-vboxhost.preset # add tmpfs dir in /run install -p -m 0644 -D %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf # install host web service %if %build_gsoap install -p -m 0644 -D %{SOURCE5} %{buildroot}%{_unitdir}/vboxweb.service %endif # install wrappers mkdir -p %{buildroot}%{_sysconfdir}/vbox cat > %{buildroot}%{_sysconfdir}/vbox/vbox.cfg << EOF # VirtualBox installation directory INSTALL_DIR="%{vboxlibdir}" EOF ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/%{oname} ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxManage ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxSDL ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxHeadless %if %build_gsoap ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/vboxwebsrv %endif # provide network control tools in bindir ln -s %{vboxlibdir}/VBoxTunctl %{buildroot}%{_bindir}/VBoxTunctl ln -s %{vboxlibdir}/VBoxNetAdpCtl %{buildroot}%{_bindir}/VBoxNetAdpCtl ln -s %{vboxlibdir}/VBoxNetDHCP %{buildroot}%{_bindir}/VBoxNetDHCP # install dkms sources mkdir -p %{buildroot}%{_usr}/src/%{name}-%{version}-%{release} cat > vboxbuild << EOF #!/bin/sh set -e SYMPWD=\$(pwd) make -C %{kname} KERN_DIR=\$1 cp -f %{kname}/Module.symvers vboxnetflt cp -f %{kname}/Module.symvers vboxnetadp export KBUILD_EXTRA_SYMBOLS=\${SYMPWD}/vboxnetflt/Module.symvers; make -C vboxnetflt KERN_DIR=\$1 export KBUILD_EXTRA_SYMBOLS=\${SYMPWD}/vboxnetadp/Module.symvers; make -C vboxnetadp KERN_DIR=\$1 EOF install -m 0755 vboxbuild %{buildroot}%{_usr}/src/%{name}-%{version}-%{release} mv %{buildroot}%{vboxlibdir}/src/* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ cat > %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf << EOF MAKE[0]="./vboxbuild \$kernel_source_dir" PACKAGE_NAME=%{name} PACKAGE_VERSION=%{version}-%{release} DEST_MODULE_LOCATION[0]=/kernel/3rdparty/vbox BUILT_MODULE_LOCATION[0]=%{kname}/ BUILT_MODULE_NAME[0]=%{kname} DEST_MODULE_LOCATION[1]=/kernel/3rdparty/vbox BUILT_MODULE_LOCATION[1]=vboxnetflt/ BUILT_MODULE_NAME[1]=vboxnetflt DEST_MODULE_LOCATION[2]=/kernel/3rdparty/vbox BUILT_MODULE_LOCATION[2]=vboxnetadp/ BUILT_MODULE_NAME[2]=vboxnetadp AUTOINSTALL=yes EOF %endif # install udev host rules mkdir -p %{buildroot}%{_udevrulesdir} %ifarch x86_64 cat > %{buildroot}%{_udevrulesdir}/%{name}.rules << EOF KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600" KERNEL=="vboxdrvu", NAME="vboxdrvu", OWNER="root", GROUP="vboxusers", MODE="0660" KERNEL=="vboxnetctl", NAME="vboxnetctl", OWNER="root", GROUP="vboxusers", MODE="0660" SUBSYSTEM=="usb_device", ACTION=="add", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass} vboxusers" SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass} vboxusers" SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh --remove \$major \$minor" SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh --remove \$major \$minor" EOF %endif # install additions %if %{build_additions} # install udev guest rules cat > %{buildroot}%{_udevrulesdir}/vbox-additions.rules << EOF KERNEL=="vboxguest", NAME="vboxguest", OWNER="root", MODE="0660" KERNEL=="vboxuser", NAME="vboxuser", OWNER="root", MODE="0666" ACTION=="add|change", SUBSYSTEM=="drm", KERNEL=="card[0-9]", SUBSYSTEMS=="pci", ATTRS{vendor}=="0x15ad", ATTRS{device}=="0x0405", TAG+="systemd", ENV{SYSTEMD_WANTS}="vboxdrmclient.service" EOF # install guest service files install -p -m 0644 -D %{SOURCE6} %{buildroot}%{_unitdir}/vboxguest.service install -p -m 0644 -D %{SOURCE7} %{buildroot}%{_unitdir}/vboxdrmclient.service install -p -m 0644 -D %{SOURCE8} %{buildroot}%{_presetdir}/96-vboxguest.preset # install xinit and xdg scripts for starting desktop integration install -p -m 0755 -D src/VBox/Additions/x11/Installer/98vboxadd-xclient \ %{buildroot}%{_sysconfdir}/X11/xinit/xinitrc.d/98-vboxclient.sh ln -s ../..%{_sysconfdir}/X11/xinit/xinitrc.d/98-vboxclient.sh \ %{buildroot}%{_bindir}/VBoxClient-all desktop-file-install --dir=%{buildroot}%{_sysconfdir}/xdg/autostart/ \ --remove-key=Encoding src/VBox/Additions/x11/Installer/vboxclient.desktop desktop-file-validate \ %{buildroot}%{_sysconfdir}/xdg/autostart/vboxclient.desktop pushd out/%{vbox_platform}/release/bin/additions install -d %{buildroot}%{_sbindir} %{buildroot}/%{_libdir}/dri install -m755 mount.vboxsf %{buildroot}%{_sbindir}/mount.vboxsf_old install -m755 VBoxService %{buildroot}%{_sbindir} install -m755 VBoxClient %{buildroot}%{_bindir} install -m755 VBoxControl %{buildroot}%{_bindir} install -m755 VBoxDRMClient %{buildroot}%{_bindir} %if %{build_vboxvideo} install -m755 VBox*.so %{buildroot}%{_libdir} ln -s -f ../VBoxOGL.so %{buildroot}%{_libdir}/dri/vboxvideo_dri.so %endif install -d %{buildroot}%{_libdir}/xorg/modules/{input,drivers} %if %{build_vboxvideo} install vboxvideo_drv_system.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so %endif %if %{build_additions_dkms} mkdir -p %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release} cat > %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF PACKAGE_NAME=vboxadditions PACKAGE_VERSION=%{version}-%{release} MAKE[0]="'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxguest && cp \$dkms_tree/\$module/\$module_version/build/vboxguest/Module.symvers \$dkms_tree/\$module/\$module_version/build/vboxsf && 'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxsf && cp \$dkms_tree/\$module/\$module_version/build/vboxsf/Module.symvers \$dkms_tree/\$module/\$module_version/build/vboxvideo && 'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxvideo" EOF i=0 for kmod in vboxguest vboxsf vboxvideo; do mkdir -p %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/$kmod cp -a src/$kmod/* %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/$kmod/ cat >> %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF DEST_MODULE_LOCATION[$i]=/kernel/3rdparty/vbox BUILT_MODULE_LOCATION[$i]=$kmod/ BUILT_MODULE_NAME[$i]=$kmod EOF i=$((i+1)) done cat >> %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF CLEAN="'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxguest clean && 'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxsf clean && 'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxvideo clean " AUTOINSTALL=yes EOF %endif popd %if %{build_additions_dkms} sed 's/^\(.package.*-kernel-\)\(.*-latest\)\(.*\)\\$/\1\2\3Obsoletes: vboxsf-kernel-\2 vboxvideo-kernel-\2\\n\\/' /etc/dkms/template-dkms-mkrpm.spec > %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/vboxadditions-dkms-mkrpm.spec %endif %endif # desktop integration # # install icons %ifarch x86_64 mkdir -p %{buildroot}%{_iconsdir}/hicolor/{16x16,32x32,48x48,64x64,128x128,scalable}/{apps,mimetypes} pushd out/%{vbox_platform}/release/bin/icons/ for i in 16 32 48 64 128; do cp -a "$i"x"$i"/virtualbox.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/ cp -a "$i"x"$i"/virtualbox-*.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/mimetypes/ done popd install -m 0644 ./src/VBox/Artwork/OSE/virtualbox.svg %{buildroot}%{_iconsdir}/hicolor/scalable/apps/ # install menu entries mkdir -p %{buildroot}%{_datadir}/applications cat > %{buildroot}%{_datadir}/applications/mageia-%{name}.desktop << EOF [Desktop Entry] Name=VirtualBox GenericName=Virtual Machine GenericName[de]=Virtuelle Maschine GenericName[ru]=Виртуальная машина Comment=Run several virtual systems on a single host computer Comment[de]=Verschiedene virtuelle Systeme auf einem Hostrechner laufen lassen Comment[it]=Esegue diversi sistemi virtuali su un singolo computer Comment[pl]=Uruchamianie wielu systemów wirtualnych na jednym komputerze gospodarza Comment[sv]=Kör flera virtuella system på en enda värddator Comment[ko]=단일 호스트 컴퓨터에 여러 개의 가상 시스템 실행 Comment[ru]=Управление несколькими виртуальными системами на одном главном компьютере Comment[af]=Loop verskeie virtuele stelsels op 'n enkele gasheerrekenaar Comment[sq]=Nis dis sisteme në një kompjuter të vetëm mbartës Comment[ast]=Execute varios sistemes virtuales nun sólu equipu anfitrión Comment[bn]=একটি একক হোস্ট কম্পিউটারে একাধিক ভার্চুয়াল সিস্টেম চালান Comment[bg]=Изпълнение на няколко виртуални системи на един компютър Comment[bs]=Pokrenite više virtuelnih sistema na jednom domaćinskom računaru Comment[pt_BR]=Execute vários sistemas virtuais em um único computador hospedeiro Comment[ca]=Executeu diversos sistemes virtuals en un únic ordinador hoste Comment[ca@valencia]=Executeu diversos sistemes virtuals en un únic ordinador hoste Comment[zh_HK]=於單一主機電腦執行多個虛擬機器 Comment[zh_CN]=在一个主机上运行多个虚拟系统 Comment[zh_TW]=於單一主機電腦執行多個虛擬機器 Comment[crh]=Tek bir bilgisayar üzerinde birden fazla sanal işletim sistemi çalıştırın Comment[cs]=Spouštění různých virtuálních systémů na hostitelském počítači Comment[da]=Kør flere virtuelle maskiner på en enkelt computer Comment[fi]=Suorita useita virtuaalisia järjestelmiä yhdellä isäntäkoneella Comment[et]=Käivita mitmeid virtuaalseid süsteeme ühel peaarvutil Comment[nl]=Draai verschillende virtuele systemen op één enkele hostcomputer Comment[gl]=Execute varios sistemas virtuais nun único computador Comment[fr]=Exécuter plusieurs systèmes virtuels sur le même ordinateur hôte Comment[el]=Χρήση πολλαπλών εικονικών συστημάτων από έναν υπολογιστή Comment[hu]=Több virtuális rendszer futtatása egy számítógépen Comment[ky]=Бир негизги компьютерде бир нече виртуалдык тутумдарды жүргүзүү Comment[ja]=一つのホストコンピューター上で複数の仮想システムを走らせます Comment[lt]=Leiskite kelias virtualias sistemas viename kompiuteryje Comment[ms]=Jalankan beberapa sistem maya dalam satu komputer hos Comment[oc]=Executar mantun sistèma virtuals sul meteis ordenador òste Comment[nb]=Kjør opptil flere virtuelle systemer på én vertsmaskin Comment[pt]=Corra diversos sistemas virtuais num único computador Comment[ro]=Rulați mai multe sisteme virtuale pe calculatorul gazdă Comment[sl]=Zagon več navideznih sistemov na enem gostiteljskem računalniku Comment[es]=Ejecute varios sistemas virtuales en un sólo equipo anfitrión Comment[vi]=Chạy nhiều hệ thống ảo trên một máy chủ đơn Comment[uk]=Запуск декількох віртуальних систем на одному базовому комп'ютері Comment[tr]=Tek bir bilgisayar üzerinde birden fazla sanal işletim sistemi çalıştırın Exec=%{oname} %U Icon=%{name} Type=Application Terminal=false Categories=Emulator; MimeType=application/x-virtualbox-vbox;application/x-virtualbox-vbox-extpack;application/x-virtualbox-ovf;application/x-virtualbox-ova; EOF # install mime types install -D -m644 out/%{vbox_platform}/release/bin/virtualbox.xml %{buildroot}%{_datadir}/mime/packages/virtualbox.xml # add missing makefile for kernel module install -m644 src/VBox/HostDrivers/Support/linux/Makefile %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ %if %{build_sdk} mkdir -p %{buildroot}%{vboxpydir} pushd out/%{vbox_platform}/release/bin/sdk/installer VBOX_INSTALL_PATH=%{vboxlibdir} \ python3 vboxapisetup.py install --prefix %{_prefix} --root %{buildroot} popd rm -rf %{buildroot}%{vboxlibdir}/sdk/installer %else rm -rf %{buildroot}%{vboxlibdir}/sdk %endif %endif # remove unpackaged files rm -rf %{buildroot}%{vboxlibdir}/{src,testcase} rm -f %{buildroot}%{vboxlibdir}/tst* rm -f %{buildroot}%{vboxlibdir}/vboxkeyboard.tar.gz rm -f %{buildroot}%{vboxlibdir}/SUP* rm -f %{buildroot}%{vboxlibdir}/xpidl # install PAM module: install -D -m755 out/%{vbox_platform}/release/bin/additions/pam_vbox.so %{buildroot}/%{_lib}/security/pam_vbox.so # install the user manual %if %build_doc install -D -m644 out/%{vbox_platform}/release/bin/UserManual.pdf %{buildroot}/%{_defaultdocdir}/%{name}/UserManual.pdf rm -f %{buildroot}%{vboxlibdir}/UserManual.pdf %endif # (tmb) HACK to avoid picking up python2 from build chroots rm -f %{buildroot}/%{_libdir}/%{name}/VBoxPython2_7.so # fix virtualbox upgrade from init scripts to systemd services %triggerun -- virtualbox < 6.1.16-12 if /usr/sbin/chkconfig virtualbox ; then /usr/bin/systemctl enable vboxhost.service >/dev/null 2>&1 || : fi %if %build_gsoap if /usr/sbin/chkconfig vboxweb-service ; then /usr/bin/systemctl enable vboxweb.service >/dev/null 2>&1 || : fi %endif %post %_tmpfilescreate %{name} %systemd_post vboxhost.service %_add_group_helper %{name} 1 vboxusers # (Debian) Build usb device tree for i in /sys/bus/usb/devices/*; do if test -r "$i/dev"; then dev="`cat "$i/dev" 2> /dev/null || true`" major="`expr "$dev" : '\(.*\):' 2> /dev/null || true`" minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null || true`" class="`cat $i/bDeviceClass 2> /dev/null || true`" /usr/share/virtualbox/VBoxCreateUSBNode.sh "$major" "$minor" "$class" vboxusers 2>/dev/null || true fi done %postun %systemd_postun vboxhost.service %_del_group_helper %{name} 1 vboxusers %preun %systemd_preun vboxhost.service %ifarch x86_64 %post -n dkms-%{name} set -x /usr/sbin/dkms --rpm_safe_upgrade add -m %{name} -v %{version}-%{release} if [ -z "$DURING_INSTALL" ] ; then /usr/sbin/dkms --rpm_safe_upgrade build -m %{name} -v %{version}-%{release} && /usr/sbin/dkms --rpm_safe_upgrade install -m %{name} -v %{version}-%{release} && /sbin/rmmod vboxnetflt &>/dev/null /sbin/rmmod vboxnetadp &>/dev/null /sbin/rmmod %{kname} &>/dev/null /sbin/modprobe %{kname} &>/dev/null /sbin/modprobe vboxnetflt &>/dev/null /sbin/modprobe vboxnetadp &>/dev/null : fi %preun -n dkms-%{name} if [ "$1" = "0" ]; then /sbin/rmmod vboxnetadp >/dev/null 2>&1 /sbin/rmmod vboxnetflt >/dev/null 2>&1 /sbin/rmmod %{kname} >/dev/null 2>&1 fi set -x /usr/sbin/dkms --rpm_safe_upgrade remove -m %{name} -v %{version}-%{release} --all || : %endif %if %{build_additions} # fix guest-additions upgrade from init scripts to systemd services %triggerun -n virtualbox-guest-additions -- virtualbox-guest-additions < 6.1.16-12 if /usr/bin/systemctl is-enabled vboxadd-timesync.service ; then /usr/bin/systemctl enable vboxguest.service >/dev/null 2>&1 || : fi %post guest-additions %systemd_post vboxguest.service %_add_group_helper %{name} 1 vboxsf %preun guest-additions %systemd_preun vboxdrmclient.service %systemd_preun vboxguest.service %postun guest-additions %systemd_postun vboxdrmclient.service %systemd_postun vboxguest.service %_del_group_helper %{name} 1 vboxsf %if %{build_additions_dkms} %post -n dkms-vboxadditions set -x /usr/sbin/dkms --rpm_safe_upgrade add -m vboxadditions -v %{version}-%{release} if [ -z "$DURING_INSTALL" ] ; then /usr/sbin/dkms --rpm_safe_upgrade build -m vboxadditions -v %{version}-%{release} && /usr/sbin/dkms --rpm_safe_upgrade install -m vboxadditions -v %{version}-%{release} : fi %preun -n dkms-vboxadditions set -x /usr/sbin/dkms --rpm_safe_upgrade remove -m vboxadditions -v %{version}-%{release} --all : %endif %endif %files %ifarch x86_64 %dir %{_sysconfdir}/vbox/ %config %{_sysconfdir}/vbox/vbox.cfg %{_bindir}/%{oname} %{_bindir}/VBoxManage %{_bindir}/VBoxSDL %{_bindir}/VBoxHeadless %{_bindir}/VBoxTunctl %{_bindir}/VBoxNetAdpCtl %{_bindir}/VBoxNetDHCP %if %build_gsoap %{_bindir}/vboxwebsrv %endif %exclude %{vboxlibdir}/sdk %dir %{vboxlibdir} %{vboxlibdir}/* %attr(4511,root,root) %{vboxlibdir}/VBoxHeadless %attr(4511,root,root) %{vboxlibdir}/VBoxNetAdpCtl %attr(4511,root,root) %{vboxlibdir}/VBoxNetDHCP %attr(4511,root,root) %{vboxlibdir}/VBoxNetNAT %attr(4511,root,root) %{vboxlibdir}/VBoxSDL %attr(4511,root,root) %{vboxlibdir}/VBoxVolInfo %attr(4511,root,root) %{vboxlibdir}/VirtualBoxVM %attr(0755,root,root) %{vboxlibdir}/VirtualBox %dir %{vboxdatadir} %{vboxdatadir}/* %{_unitdir}/vboxhost.service %{_presetdir}/96-vboxhost.preset %if %build_gsoap %{_unitdir}/vboxweb.service %endif %{_udevrulesdir}/%{name}.rules %{_tmpfilesdir}/%{name}.conf # desktop integration %{_datadir}/icons/hicolor/*/*/*.png %{_datadir}/icons/hicolor/scalable/apps/virtualbox.svg %{_datadir}/applications/mageia-%{name}.desktop %{_datadir}/mime/packages/virtualbox.xml %endif %ifarch x86_64 %files -n dkms-%{name} %{_usr}/src/%{name}-%{version}-%{release} %endif %if %{build_additions} %files guest-additions /%{_lib}/security/pam_vbox.so %{_sbindir}/mount.vboxsf_old %{_sbindir}/VBoxService %{_bindir}/VBoxClient %{_bindir}/VBoxClient-all %{_bindir}/VBoxControl %{_bindir}/VBoxDRMClient %{_sysconfdir}/X11/xinit/xinitrc.d/98-vboxclient.sh %{_sysconfdir}/xdg/autostart/vboxclient.desktop %{_udevrulesdir}/vbox-additions.rules %{_unitdir}/vboxguest.service %{_unitdir}/vboxdrmclient.service %{_presetdir}/96-vboxguest.preset %if %{build_vboxvideo} %files -n x11-driver-video-vboxvideo %{_libdir}/VBoxEGL* %{_libdir}/VBoxOGL* %if %{build_vboxvideo} %{_libdir}/xorg/modules/drivers/vboxvideo_drv.so %{_libdir}/dri/vboxvideo_dri.so %endif %endif %if %{build_additions_dkms} %files -n dkms-vboxadditions %{_usr}/src/vbox*-%{version}-%{release} %endif %endif %if %{build_doc} %files doc %doc %{_defaultdocdir}/%{name}/UserManual.pdf %endif %if %{build_sdk} %files devel %dir %{vboxlibdir}/sdk %{vboxlibdir}/sdk/* %files -n python-%{name} %{vboxpydir} %{python3_sitelib}/vboxapi*.egg-info %endif