- rel 2
[packages/VirtualBox.git] / VirtualBox.spec
CommitLineData
44a0c82d
ER
1# NOTE
2# - https://www.virtualbox.org/wiki/Linux%20build%20instructions
744bc35e
JR
3# TODO
4# - java bindings
74268e47 5# - Package SDK.
ffb38bb6 6# - Check License of VBoxGuestAdditions_*.iso, it's probably not GPL v2.
5f8b0a92 7# If so check if it is distributable.
21a1d8ab 8# - guest x11 additions: currently incomplete/untested
23790586 9# - enable VDE networking: --enable-vde
21a1d8ab 10# - initscripts for webservice
988a8f09 11# - fix desc for dkms packages (proper wording needed), kernel modules desc is mess as well
48363591 12#
13# Conditional build:
8c008609 14%bcond_with all_langs # build with all manual translations
8da42f47 15%bcond_without doc # don't build the documentation
077e37dc 16%bcond_without debuginfo # disable debuginfo creation (to save space when compiling)
d1c4ec5b 17%bcond_without kernel # don't build kernel module
d1c4ec5b 18%bcond_without userspace # don't build userspace package
21a1d8ab 19%bcond_with webservice # webservice (SOAP) support
7223ee37 20%bcond_without lightdm # lightdm greeter
c38a3946 21%bcond_without dkms # build dkms package
bddee32c 22%bcond_without verbose
d7e93912 23%bcond_without gui # disable Qt4 GUI frontend build
05f1b1f5 24
163ddb28
JR
25%if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
26%{error:kernel and userspace cannot be built at the same time on PLD builders}
27exit 1
8833bce1 28%endif
163ddb28 29
8608f39a
JR
30%if %{with kernel}
31%define _duplicate_files_terminate_build 0
32%endif
33
05f9288a
ER
34%if %{without userspace}
35# nothing to be placed to debuginfo package
077e37dc
ER
36%undefine with_debuginfo
37%endif
38
39%if %{without debuginfo}
05f9288a
ER
40%define _enable_debug_packages 0
41%endif
bd3faca3 42
3df55f02 43%define qtver 5.6.0
22b6f11e 44
5d1b2a23 45%define rel 2
33aeed61 46%define pname VirtualBox
393ec35d
ER
47Summary: VirtualBox - x86 hardware virtualizer
48Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86
6ca4d491 49Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
a05e0520 50Version: 5.2.12
6ca4d491 51Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
48363591 52License: GPL v2
53Group: Applications/Emulators
33aeed61 54Source0: http://download.virtualbox.org/virtualbox/%{version}/%{pname}-%{version}.tar.bz2
a05e0520 55# Source0-md5: 1c9b83aff080692625c9076c072d8931
744bc35e 56Source1: http://download.virtualbox.org/virtualbox/%{version}/VBoxGuestAdditions_%{version}.iso
a05e0520 57# Source1-md5: a326ef4c75196f2439de8d9db59b39b9
07e9b84d 58Source2: vboxservice.init
4365ecaf 59Source3: vboxservice.service
122ca0f2 60Source4: vboxservice.sysconfig
4365ecaf
JR
61Source5: mount.vdi
62Source6: udev.rules
63Source7: %{pname}-virtualbox-host-modules-load.conf
64Source8: %{pname}-virtualbox-guest-modules-load.conf
38d06cb9
ER
65Source9: vboxautostart.init
66Source10: autostart.cfg
8c008609 67Patch0: %{pname}-version-error.patch
db6f33e3
KK
68Patch1: %{pname}-VBoxSysInfo.patch
69Patch2: %{pname}-warning_workaround.patch
70Patch3: %{pname}-dri.patch
44a0c82d 71Patch4: wrapper.patch
db6f33e3 72Patch5: xserver-1.12.patch
44a0c82d 73Patch6: hardening-shared.patch
9970fc61 74Patch7: lightdm-greeter-makefile.patch
8d08b907 75Patch8: lightdm-greeter-g++-link.patch
621cd96c 76Patch9: pld-guest.patch
b980c81c 77Patch10: 16-no-update.patch
fdf4c273
JP
78Patch11: %{pname}-all-translations.patch
79Patch12: x32.patch
80Patch13: %{pname}-no-scrextend.patch
81Patch14: %{pname}-multipython.patch
82Patch15: %{pname}-lightdm-1.19.2.patch
83Patch16: %{pname}-no-vboxvideo.patch
07fc1266 84Patch17: %{pname}-kerndir.patch
48363591 85URL: http://www.virtualbox.org/
83ffcfa8 86%if %{with userspace}
ce9843cd 87%ifarch %{x8664}
c0749bd0 88BuildRequires: gcc-multilib-32
ce9843cd 89BuildRequires: glibc-devel(i686)
c0749bd0
JR
90BuildRequires: libstdc++-multilib-32-devel
91BuildRequires: libstdc++-multilib-32-static
ce9843cd 92%endif
ce9843cd
ER
93%if "%{pld_release}" == "ac"
94BuildRequires: XFree86-devel
95%else
22b6f11e 96BuildRequires: xorg-lib-libX11-devel
1abc0217 97BuildRequires: xorg-lib-libXcomposite-devel
ce9843cd 98BuildRequires: xorg-lib-libXcursor-devel
22b6f11e
JP
99BuildRequires: xorg-lib-libXdamage-devel
100BuildRequires: xorg-lib-libXext-devel
101BuildRequires: xorg-lib-libXinerama-devel
ce9843cd 102BuildRequires: xorg-lib-libXmu-devel
22b6f11e 103BuildRequires: xorg-lib-libXrandr-devel
e649d11e 104BuildRequires: xorg-proto-glproto-devel
acf12a87 105BuildRequires: xorg-xserver-server-devel
ce9843cd 106%endif
00149140 107BuildRequires: OpenGL-GLU-devel
523e7409 108BuildRequires: OpenGL-devel
d19b622b
JP
109BuildRequires: Qt5Core-devel >= %{qtver}
110BuildRequires: Qt5DBus-devel >= %{qtver}
111BuildRequires: Qt5Gui-devel >= %{qtver}
112BuildRequires: Qt5Network-devel >= %{qtver}
113BuildRequires: Qt5OpenGL-devel >= %{qtver}
114BuildRequires: Qt5PrintSupport-devel >= %{qtver}
115BuildRequires: Qt5Widgets-devel >= %{qtver}
116BuildRequires: Qt5X11Extras-devel >= %{qtver}
117BuildRequires: Qt5Xml-devel >= %{qtver}
c574efad 118BuildRequires: SDL-devel >= 1.2.7
9a1cb119 119BuildRequires: acpica
ba702945 120BuildRequires: alsa-lib-devel >= 1.0.6
e5aaadde 121BuildRequires: bash
48363591 122BuildRequires: bcc
123BuildRequires: bin86
22b6f11e
JP
124BuildRequires: curl-devel >= 7.19.1
125BuildRequires: device-mapper-devel >= 1.02
8da42f47 126%{?with_doc:BuildRequires: docbook-dtd44-xml}
44a0c82d 127BuildRequires: fakeroot
df3c39bd 128%{?with_lightdm:BuildRequires: fltk-devel}
eba4b2aa 129BuildRequires: gcc >= 5:3.2.3
55f7d7d3 130%{?with_webservice:BuildRequires: gsoap-devel}
e9aa839a 131BuildRequires: issue
fdf4c273 132BuildRequires: kBuild >= 0.1.9998.3093
48363591 133BuildRequires: libIDL-devel
fa974331 134BuildRequires: libcap-static
acf12a87 135BuildRequires: libdrm-devel
ff01a704 136BuildRequires: libpng-devel >= 1.2.5
d22f0a53 137BuildRequires: libstdc++-devel >= 5:3.2.3
4fff279a 138BuildRequires: libstdc++-static >= 5:3.2.3
48363591 139BuildRequires: libuuid-devel
b75fd17a 140BuildRequires: libvncserver-devel >= 0.9.9
22b6f11e 141BuildRequires: libvpx-devel >= 0.9.5
ba702945 142BuildRequires: libxml2-devel >= 2.6.26
76ea5ecb 143BuildRequires: libxslt-devel >= 1.1.17
ba702945 144BuildRequires: libxslt-progs >= 1.1.17
d19b622b 145%{?with_lightdm:BuildRequires: lightdm-libs-qt5-devel}
744bc35e 146BuildRequires: makeself
90de3b27 147BuildRequires: mkisofs
22b6f11e 148BuildRequires: openssl-devel >= 0.9.8
3613936b 149BuildRequires: pam-devel
acf12a87 150BuildRequires: pixman-devel
0bf43862 151BuildRequires: pkgconfig
ba702945 152BuildRequires: pulseaudio-devel >= 0.9.0
22b6f11e 153BuildRequires: python-devel >= 2.3
6055e733 154BuildRequires: python-modules
d19b622b
JP
155BuildRequires: qt5-build
156BuildRequires: qt5-linguist
f198c53b 157BuildRequires: rpmbuild(macros) >= 1.715
1e840a77 158BuildRequires: sed >= 4.0
8da42f47 159%if %{with doc}
744bc35e
JR
160BuildRequires: texlive-fonts-bitstream
161BuildRequires: texlive-fonts-other
162BuildRequires: texlive-fonts-type1-bitstream
163BuildRequires: texlive-format-pdflatex
acf12a87 164BuildRequires: texlive-latex-ucs
660fb056 165BuildRequires: texlive-xetex
8da42f47 166%endif
0bf43862 167BuildRequires: which
e5aaadde 168BuildRequires: xalan-c-devel >= 1.10.0
e5aaadde 169BuildRequires: xerces-c-devel >= 2.6.0
22b6f11e 170BuildRequires: yasm >= 0.5.1
e5aaadde 171BuildRequires: zlib-devel >= 1.2.1
23d9d34e 172%endif
a59a82ea 173%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
0afa64ad 174Requires(post,preun): /sbin/chkconfig
5f1cec1f
ER
175Requires(postun): /usr/sbin/groupdel
176Requires(pre): /usr/bin/getgid
177Requires(pre): /usr/sbin/groupadd
b75fd17a 178Requires: libvncserver >= 0.9.9
12db98a7 179Requires: udev-core
5f1cec1f 180Provides: group(vbox)
873b17cf 181Obsoletes: VirtualBox-udev < 4.2.10-5
fdeecb8f 182ExclusiveArch: %{ix86} %{x8664} %{?with_kernel:x32}
48363591 183BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
184
eba4b2aa 185%ifarch %{x8664}
f377eb62 186%define vbox_arch amd64
5088674d 187%else
f377eb62 188%define vbox_arch x86
5088674d 189%endif
f377eb62 190%define vbox_platform linux.%{vbox_arch}
27a1aef6 191%define outdir out/%{vbox_platform}/release/bin
8d08b907 192%define objdir out/%{vbox_platform}/release/obj
5088674d 193
5750e90b
JP
194%define filterout -Werror=format-security
195
48363591 196%description
393ec35d 197Oracle VirtualBox is a general-purpose full virtualizer for x86
48363591 198hardware. Targeted at server, desktop and embedded use, it is now the
199only professional-quality virtualization solution that is also Open
200Source Software.
201
393ec35d 202Some of the features of VirtualBox are:
48363591 203
393ec35d 204Modularity: VirtualBox has an extremely modular design with
48363591 205well-defined internal programming interfaces and a client/server
206design. This makes it easy to control it from several interfaces at
207once: for example, you can start a virtual machine in a typical
208virtual machine GUI and then control that machine from the command
393ec35d
ER
209line. VirtualBox also comes with a full Software Development Kit: even
210though it is Open Source Software, you don't have to hack the source
211to write a new interface for VirtualBox.
48363591 212
213Virtual machine descriptions in XML: the configuration settings of
214virtual machines are stored entirely in XML and are independent of the
215local machines. Virtual machine definitions can therefore easily be
216ported to other computers.
217
1067d08d
ER
218You should install this package in your Host OS.
219
fd8fc899 220%description -l pl.UTF-8
393ec35d
ER
221Oracle VirtualBox jest emulatorem sprzętu x86. Kierowany do zastosowań
222serwerowych, desktopowych oraz wbudowanych jest obecnie jedynym
223wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym również jako
224Otwarte Oprogramowanie.
48363591 225
fd8fc899 226Przykładowe cechy VirtualBoksa:
48363591 227
393ec35d 228Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
fd8fc899
JR
229dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
230klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
231różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
232poziomu interfejsu graficznego, a później kontrolować ją z linii
393ec35d
ER
233poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
234pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
48363591 235
fd8fc899
JR
236Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
237wirtualnych są w całości przechowywane w XML-u i są niezależne od
238lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
239konfigurację maszyny wirtualnej na inny komputer.
48363591 240
501bee39
ER
241%package gui
242Summary: Qt GUI part for VirtualBox
243Group: X11/Applications
244Requires: %{name} = %{version}-%{release}
d19b622b 245Requires: Qt5Core >= %{qtver}
923cea18 246Requires: Qt5Gui-platform-xcb >= %{qtver}
501bee39
ER
247Requires: desktop-file-utils
248Requires: desktop-file-utils
249Requires: fontconfig
250Requires: fonts-Type1-urw
44a0c82d
ER
251Requires: gtk-update-icon-cache
252Requires: hicolor-icon-theme
501bee39 253Requires: shared-mime-info
923cea18
JR
254Suggests: Qt5Gui-platform-xcb-glx >= %{qtver}
255Suggests: Qt5Gui-platform-xcb-egl >= %{qtver}
501bee39 256Suggests: gxmessage
6f37454e 257Conflicts: %{name} < 4.3.8-3
501bee39
ER
258
259%description gui
260Qt GUI part for VirtualBox.
261
90de3b27
ER
262%package doc
263Summary: VirtualBox documentation
264Group: Documentation
265
266%description doc
267This package contains VirtualBox User Manual.
268
ffb38bb6
ER
269%package additions
270Summary: VirtualBox Guest Additions
271Group: Base
b9cc0b23 272Requires: %{name} = %{version}
44a0c82d
ER
273%if "%{_rpmversion}" >= "5"
274BuildArch: noarch
275%endif
ffb38bb6 276
00a4a7ca 277%description additions
ffb38bb6
ER
278VirtualBox Guest Additions.
279
280This package contains ISO9660 image with drivers for Guest OS.
281
1067d08d
ER
282You should install this package in your Host OS.
283
284%package guest
c0372ee9
ER
285Summary: VirtualBox Guest tools
286Group: Base
551622b8 287Provides: group(vboxsf)
4365ecaf 288Requires(post): systemd-units >= 38
551622b8
ER
289Requires(post,preun): /sbin/chkconfig
290Requires(postun): /usr/sbin/groupdel
291Requires(pre): /usr/bin/getgid
292Requires(pre): /usr/sbin/groupadd
ffb104d5 293Requires: rc-scripts
2e3636e9 294Requires: systemd-units >= 38
3d9b19d8
ER
295Suggests: kernel(vboxguest)
296Suggests: kernel(vboxsf)
bf131a21 297Suggests: pam-pam_vbox
c0372ee9
ER
298
299%description guest
300Tools that utilize kernel modules for supporting integration with the
301Host, including file sharing.
302
3d9b19d8
ER
303You should install this package in your Guest OS for base VirtualBox
304communication
c0372ee9
ER
305
306%package guest-x11
307e824c
ER
307Summary: VirtualBox Guest X11 Additions
308Group: X11/Applications
c0372ee9 309Requires: %{name}-guest = %{version}-%{release}
307e824c 310Requires: xorg-app-xrandr
1067d08d 311Requires: xorg-driver-video-vboxvideo = %{version}-%{release}
bff0e4ba 312Requires: kernel(vboxvideo)
873b17cf 313Obsoletes: xorg-driver-input-vboxmouse < %{version}-%{release}
1067d08d 314
c0372ee9 315%description guest-x11
3d9b19d8
ER
316Tools for X11 session that utilize kernel modules for supporting
317integration with the Host, like tracking of mouse pointer movement and
318X.org X11 video and mouse drivers
1067d08d 319
c0372ee9 320You should install this package in your Guest OS for X11 session.
1067d08d 321
21a1d8ab
ER
322%package webservice
323Summary: VirtualBox Web Service
324Group: Applications/Emulators
325Requires: %{name} = %{version}-%{release}
326
327%description webservice
328This package contains VirtualBox web service API daemon. It allows to
329control virtual machines via web interface.
330
9e4dd6a9 331%package -n lightdm-greeter-vbox
8d08b907
ER
332Summary: VirtualBox greeter for lightdm
333Group: Themes
22380dc7
ER
334# NOTE: '#' in url is lost because rpm treats it as comment, even hacking with
335# macros doesn't help as rpmbuild takes final result to parse
8d08b907 336URL: http://www.virtualbox.org/manual/ch09.html#autologon_unix_lightdm
650ee651 337Requires: %{name} = %{version}-%{release}
4365ecaf 338Requires: kernel(vboxguest)
8d08b907 339Requires: lightdm >= 1.0.1
7d778590 340Requires: pam-pam_vbox = %{version}-%{release}
8d08b907
ER
341Provides: lightdm-greeter
342
9e4dd6a9 343%description -n lightdm-greeter-vbox
8d08b907
ER
344VirtualBox greeter for LightDM.
345
3613936b
JR
346%package -n pam-pam_vbox
347Summary: PAM module to perform automated guest logons
348Group: Base
349
350%description -n pam-pam_vbox
3ee6b9d9
ER
351PAM module (Pluggable Authentication Module) which can be used to
352perform automated guest logons.
3613936b 353
fbea1005 354%package -n xorg-driver-video-vboxvideo
393ec35d
ER
355Summary: X.org video driver for VirtualBox guest OS
356Summary(pl.UTF-8): Sterownik grafiki dla systemu gościa w VirtualBoksie
fbea1005 357Group: X11/Applications
20b8335d 358Requires: Mesa-dri-driver-swrast
0ad0a572 359Requires: xorg-driver-video-modesetting
fbea1005
ER
360Requires: xorg-xserver-libdri >= 1.7.4
361Requires: xorg-xserver-server >= 1.0.99.901
a4654d40 362%{?requires_xorg_xserver_videodrv}
7e84622a
ER
363Provides: OpenGL = 2.1
364Provides: OpenGL-GLX = 1.3
7e84622a 365Provides: xorg-xserver-module(glx)
fbea1005
ER
366
367%description -n xorg-driver-video-vboxvideo
393ec35d 368X.org video driver for VirtualBox guest OS.
fbea1005
ER
369
370%description -n xorg-driver-video-vboxvideo -l pl.UTF-8
393ec35d 371Sterownik grafiki dla systemu gościa w VirtualBoksie.
fbea1005 372
988a8f09
ER
373%package -n dkms-vboxguest
374Summary: VirtualBox kernel modules source for Linux Guest
375Summary(pl.UTF-8): Moduły VirtualBoksa do jądra Linuksa dla systemu gościa
376License: GPL v2+
377Group: Base/Kernel
62c43b99 378Requires: dkms
988a8f09
ER
379%if "%{_rpmversion}" >= "5"
380BuildArch: noarch
381%endif
382
383%description -n dkms-vboxguest
384This package contains DKMS-ready VirtualBox Guest Additions for Linux
385Module, host file system access (Shared Folders) and DRM support for
386Linux guest system.
387
388%description -n dkms-vboxguest -l pl.UTF-8
389Ten pakiet zawiera moduł jądra Linuksa vboxguest dla VirtualBoksa -
390dodatki dla systemu gościa, dostęp do plików systemu głównego z
391poziomu systemu gościa i sterownik obsługi DRM.
392
393%package -n dkms-vboxhost
394Summary: VirtualBox Support Drivers source
395Summary(pl.UTF-8): Moduły jądra Linuksa dla VirtualBoksa
396License: GPL v2+
397Group: Base/Kernel
62c43b99 398Requires: dkms
988a8f09
ER
399%if "%{_rpmversion}" >= "5"
400BuildArch: noarch
401%endif
402
403%description -n dkms-vboxhost
404This package contains DKMS enabled sourcecode of VirtualBox Support
405Driver, Network Adapter Driver, Network Filter Driver and PCI card
406passthrough driver that works as host proxy between guest and PCI
407hardware.
408
409%description -n dkms-vboxhost -l pl.UTF-8
410Ten pakiet zawiera sterownik wsparcia dla systemu głównego, sterownik
411witrualnej karty sieciowej, sterownik filtrowania sieci dla systemu
412głównego oraz sterownik, ktory działa jako proxy między gościem i
413gospodarzem sprzętu PCI.
414
18adabff 415# KERNEL PACKAGES
b980c81c 416
18adabff 417# KEEP ALL REGULAR SUBPACKAGES BEFORE KERNEL PACKAGES.
b980c81c 418
163ddb28
JR
419%define kernel_pkg()\
420%package -n kernel%{_alt_kernel}-virtualbox-guest\
421Summary: VirtualBox kernel modules for Linux Guest\
422Summary(pl.UTF-8): Moduły VirtualBoksa do jądra Linuksa dla systemu gościa\
423Release: %{rel}@%{_kernel_ver_str}\
424Group: Base/Kernel\
425Requires(post,postun): /sbin/depmod\
426Requires(post): systemd-units >= 38\
427Requires: dev >= 2.9.0-7\
428Requires: systemd-units >= 38\
163ddb28 429%requires_releq_kernel\
eb3ec0e6 430Requires: %{releq_kernel -n drm}\
163ddb28 431Requires(postun): %releq_kernel\
163ddb28
JR
432Provides: kernel(vboxguest) = %{version}-%{rel}\
433Provides: kernel(vboxsf) = %{version}-%{rel}\
434Provides: kernel(vboxvideo) = %{version}-%{rel}\
435Obsoletes: kernel-init-guest\
436Conflicts: kernel%{_alt_kernel}-virtualbox-host\
437\
438%description -n kernel%{_alt_kernel}-virtualbox-guest\
439This package contains VirtualBox Guest Additions for Linux Module,\
440host file system access (Shared Folders) and DRM support for\
441Linux guest system.\
442\
443%description -n kernel%{_alt_kernel}-virtualbox-guest -l pl.UTF-8\
444Ten pakiet zawiera moduł jądra Linuksa vboxguest dla VirtualBoksa -\
445dodatki dla systemu gościa, dostęp do plików systemu głównego z\
446poziomu systemu gościa i sterownik obsługi DRM.\
447\
448%package -n kernel%{_alt_kernel}-virtualbox-host\
449Summary: VirtualBox Support Drivers\
450Summary(pl.UTF-8): Moduły jądra Linuksa dla VirtualBoksa\
451Release: %{rel}@%{_kernel_ver_str}\
452Group: Base/Kernel\
453Requires(post,postun): /sbin/depmod\
454Requires(post): systemd-units >= 38\
455Requires: dev >= 2.9.0-7\
163ddb28
JR
456%requires_releq_kernel\
457Requires(postun): %releq_kernel\
163ddb28 458Requires: systemd-units >= 38\
163ddb28
JR
459Provides: kernel(vboxdrv) = %{version}-%{rel}\
460Provides: kernel(vboxnetadp) = %{version}-%{rel}\
461Provides: kernel(vboxnetflt) = %{version}-%{rel}\
462Provides: kernel(vboxpci) = %{version}-%{rel}\
463Obsoletes: kernel-init-host\
464\
465%description -n kernel%{_alt_kernel}-virtualbox-host\
466This package contains VirtualBox Support Driver, Network Adapter\
467Driver, Network Filter Driver and PCI card passthrough driver that\
468works as host proxy between guest and PCI hardware.\
469\
470%description -n kernel%{_alt_kernel}-virtualbox-host -l pl.UTF-8\
471Ten pakiet zawiera sterownik wsparcia dla systemu głównego, sterownik\
472witrualnej karty sieciowej, sterownik filtrowania sieci dla systemu\
473głównego oraz sterownik, ktory działa jako proxy między gościem i\
474gospodarzem sprzętu PCI.\
475\
476%if %{with kernel}\
477%files -n kernel%{_alt_kernel}-virtualbox-guest\
478%defattr(644,root,root,755)\
479%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/virtualbox-guest.conf\
480/lib/modules/%{_kernel_ver}/misc/vboxguest.ko*\
481/lib/modules/%{_kernel_ver}/misc/vboxsf.ko*\
14c2cd1f 482%if %{_kernel_version_code} < %{_kernel_version_magic 4 13 0}\
163ddb28 483/lib/modules/%{_kernel_ver}/misc/vboxvideo.ko*\
14c2cd1f 484%endif\
163ddb28
JR
485\
486%files -n kernel%{_alt_kernel}-virtualbox-host\
487%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/virtualbox-host.conf\
488/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*\
489/lib/modules/%{_kernel_ver}/misc/vboxnetadp.ko*\
490/lib/modules/%{_kernel_ver}/misc/vboxnetflt.ko*\
491/lib/modules/%{_kernel_ver}/misc/vboxpci.ko*\
492%endif\
493\
494%post -n kernel%{_alt_kernel}-virtualbox-guest\
495%depmod %{_kernel_ver}\
496\
497%postun -n kernel%{_alt_kernel}-virtualbox-guest\
498%depmod %{_kernel_ver}\
499\
500%post -n kernel%{_alt_kernel}-virtualbox-host\
501%depmod %{_kernel_ver}\
502\
503%postun -n kernel%{_alt_kernel}-virtualbox-host\
504%depmod %{_kernel_ver}\
505%{nil}
506
507%define build_kernel_pkg()\
508export KERN_DIR=%{_kernelsrcdir}\
509cd PLD-MODULE-BUILD/HostDrivers\
510%build_kernel_modules -m vboxdrv -C vboxdrv\
511%build_kernel_modules -m vboxnetadp -C vboxnetadp\
512%build_kernel_modules -m vboxnetflt -C vboxnetflt\
513%build_kernel_modules -m vboxpci -C vboxpci\
514cd ../GuestDrivers\
515%build_kernel_modules -m vboxguest -C vboxguest\
516cp -a vboxguest/Module.symvers vboxsf\
517%build_kernel_modules -m vboxsf -C vboxsf -c\
14c2cd1f 518%if %{_kernel_version_code} < %{_kernel_version_magic 4 13 0}\
163ddb28 519%build_kernel_modules -m vboxvideo -C vboxvideo\
14c2cd1f 520%endif\
163ddb28 521cd ../..\
801a2b31 522%install_kernel_modules -D PLD-MODULE-BUILD/installed -m PLD-MODULE-BUILD/HostDrivers/vboxdrv/vboxdrv,PLD-MODULE-BUILD/HostDrivers/vboxnetadp/vboxnetadp,PLD-MODULE-BUILD/HostDrivers/vboxnetflt/vboxnetflt,PLD-MODULE-BUILD/HostDrivers/vboxpci/vboxpci,PLD-MODULE-BUILD/GuestDrivers/vboxsf/vboxsf -d misc\
801a2b31 523%install_kernel_modules -D PLD-MODULE-BUILD/installed -m PLD-MODULE-BUILD/GuestDrivers/vboxguest/vboxguest -d misc\
14c2cd1f
JP
524%if %{_kernel_version_code} < %{_kernel_version_magic 4 13 0}\
525%install_kernel_modules -D PLD-MODULE-BUILD/installed -m PLD-MODULE-BUILD/GuestDrivers/vboxvideo/vboxvideo -d misc\
526%endif\
163ddb28
JR
527%{nil}
528
a59a82ea 529%{?with_kernel:%{expand:%create_kernel_packages}}
67a4f3c1 530
48363591 531%prep
33aeed61 532%setup -q -n %{pname}-%{version}
e709ce6b 533%patch0 -p1
db6f33e3 534%patch1 -p1
006342ee 535%patch2 -p1
8473a80d 536%patch3 -p1
44a0c82d 537%patch4 -p1
9a7b1cdc 538%patch5 -p1
44a0c82d 539%patch6 -p1
d3884acf 540%patch7 -p1
8d08b907 541%patch8 -p1
621cd96c 542%patch9 -p1
077e37dc 543%patch10 -p1
8c008609 544%if %{with all_langs}
fdf4c273 545%patch11 -p0
8c008609 546%endif
fdf4c273 547%patch12 -p1
d5e18103 548%patch13 -p1
fdf4c273 549%patch14 -p0
66afd212 550%patch15 -p0
1792543c 551%patch16 -p0
07fc1266 552%patch17 -p1
fddcb741 553
744bc35e
JR
554%{__sed} -i -e 's,@VBOX_DOC_PATH@,%{_docdir}/%{name}-%{version},' \
555 -e 's/Categories=.*/Categories=Utility;Emulator;/' src/VBox/Installer/common/virtualbox.desktop.in
0b6de2b7 556
f471b832
ER
557# Respect LDFLAGS
558%{__sed} -i -e "s@_LDFLAGS\.%{vbox_arch}*.*=@& %{rpmldflags}@g" \
559 -i Config.kmk src/libs/xpcom18a4/Config.kmk
560
44a0c82d 561%{__sed} -i -e 's#@INSTALL_DIR@#%{_libdir}/%{pname}#' src/VBox/Installer/linux/VBox.sh
fa19f650 562
bc1ca596 563%if %{with kernel}
1794e74d
ER
564install -d PLD-MODULE-BUILD/{GuestDrivers,HostDrivers}
565cd PLD-MODULE-BUILD
fdf4c273 566../src/VBox/Additions/linux/export_modules.sh guest-modules.tar.gz
1794e74d
ER
567tar -zxf guest-modules.tar.gz -C GuestDrivers
568
fdf4c273 569../src/VBox/HostDrivers/linux/export_modules.sh host-modules.tar.gz --without-hardening
1794e74d
ER
570tar -zxf host-modules.tar.gz -C HostDrivers
571cd -
077e37dc 572%endif
59d12745 573
e9ed9ec1
ER
574# using system kBuild package
575%{__rm} -r kBuild
576
621cd96c
ER
577# use linux icon for now
578cp -p src/VBox/Frontends/VirtualBox/images/os_{linux26,pld}.png
579cp -p src/VBox/Frontends/VirtualBox/images/os_{linux26,pld}_64.png
580
29ed465a
JP
581# don't force whole userspace to be built with -fPIC
582# see https://www.virtualbox.org/pipermail/vbox-dev/2015-February/012863.html
583%define filterout_c -fPIC
584%define filterout_cxx -fPIC
585
316a5697
ER
586cat <<'EOF'>> LocalConfig.kmk
587%{?with_verbose:KBUILD_VERBOSE=3}
588USERNAME=%(id -un)
a174188e 589VBOX_BUILD_PUBLISHER=_PLD
316a5697
ER
590VBOX_VERSION_STRING=$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)_PLD
591XSERVER_VERSION=%(rpm -q --queryformat '%{V}\n' xorg-xserver-server-devel | awk -F. '{ print $1 $2 }' 2>/dev/null || echo ERROR)
592VBOX_USE_SYSTEM_XORG_HEADERS=1
fdf4c273 593VBOX_USE_SYSTEM_GL_HEADERS=1
316a5697
ER
594%if %{with lightdm}
595VBOX_WITH_LIGHTDM_GREETER=1
596VBOX_WITH_LIGHTDM_GREETER_PACKING=1
597%endif
598TOOL_GCC3_CFLAGS=%{rpmcflags}
599TOOL_GCC3_CXXFLAGS=%{rpmcxxflags}
600VBOX_GCC_OPT=%{rpmcxxflags}
44a0c82d
ER
601
602VBOX_PATH_APP_PRIVATE_ARCH := %{_libdir}/%{pname}
603VBOX_PATH_APP_PRIVATE := %{_datadir}/%{pname}
604VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH)
605VBOX_WITH_ORIGIN :=
606VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH)
607#VBOX_PATH_APP_DOCS := %{_docdir}/%{pname}-doc-%{version}
8c008609 608VBOX_PATH_DOCBOOK_DTD := %{_datadir}/sgml/docbook/xml-dtd-4.4
44a0c82d
ER
609
610# don't build testcases to save time, they are not needed for the package
611VBOX_WITH_TESTCASES :=
612VBOX_WITH_TESTSUITE :=
640931aa
JP
613
614VBOX_WITH_VRDP_RDESKTOP=
077fc60d 615VBOX_WITH_MULTIVERSION_PYTHON=0
316a5697
ER
616EOF
617
29ed465a
JP
618%undefine filterout_c
619%undefine filterout_cxx
620
fddcb741 621%build
83ffcfa8 622%if %{with userspace}
106d8451 623./configure \
ae1bbc88 624 --with-gcc="%{__cc}" \
625 --with-g++="%{__cxx}" \
8da42f47 626 %{!?with_doc:--disable-docs} \
744bc35e 627 --disable-java \
5a497466 628 --disable-hardening \
01e414ba 629 --disable-kmods \
55f7d7d3 630 --enable-vnc \
d7e93912 631 %{!?with_gui:--disable-qt} \
55f7d7d3
ER
632 %{__enable webservice} \
633 %{nil}
48363591 634
147c698e 635. "$PWD/env.sh"
316a5697 636kmk %{?_smp_mflags}
d1c4ec5b 637%endif
48363591 638
a59a82ea 639%{?with_kernel:%{expand:%build_kernel_packages}}
51ef4838 640
48363591 641%install
642rm -rf $RPM_BUILD_ROOT
643
d1c4ec5b 644%if %{with userspace}
c11f39b3 645install -d $RPM_BUILD_ROOT{%{_bindir},/sbin,%{_sbindir},%{_libdir}/%{pname}/ExtensionPacks} \
501bee39 646 $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_datadir}/mime/packages} \
eee69130 647 $RPM_BUILD_ROOT/etc/sysconfig \
2daf9ea4 648 $RPM_BUILD_ROOT%{_sysconfdir}/vbox/autostart \
12db98a7 649 $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,dri,input} \
4365ecaf 650 $RPM_BUILD_ROOT{/lib/udev,/etc/udev/rules.d} \
44a0c82d 651 $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},%{_usrsrc}}
a70507fb 652
dca6c443 653# test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
632ec0b7 654if cp -al COPYING $RPM_BUILD_ROOT/COPYING; then
dca6c443 655 l=l
44a0c82d 656 %{__rm} $RPM_BUILD_ROOT/COPYING
dca6c443
ER
657fi
658
244b344b
JP
659install -d $RPM_BUILD_ROOT%{_datadir}/%{pname}
660
33aeed61 661cp -a$l %{outdir}/* $RPM_BUILD_ROOT%{_libdir}/%{pname}
244b344b
JP
662cp -p$l %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{pname}/VBoxGuestAdditions.iso ||
663cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{pname}/VBoxGuestAdditions.iso
48363591 664
d7e93912
ER
665%if %{without gui}
666%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{pname}/icons
667%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/virtualbox.xml
668%endif
669
44a0c82d 670# vboxvideo
ffd7f18a 671%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions/VBoxOGL.so,%{_libdir}/xorg/modules/dri/vboxvideo_dri.so}
27a1aef6 672# XXX: where else to install them that vboxvideo_dri.so finds them? patch with rpath?
349989a6 673%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxEGL.so
ffd7f18a
JR
674%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLarrayspu.so
675%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLcrutil.so
676%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLerrorspu.so
677%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLfeedbackspu.so
678%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLpackspu.so
679%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_libdir}}/VBoxOGLpassthroughspu.so
d1c4ec5b 680
1067d08d 681# Guest Only Tools
ffd7f18a
JR
682%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_bindir}}/VBoxClient
683%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_bindir}}/VBoxControl
44a0c82d 684%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_bindir}}/VBoxService
4e3859c5 685install -d $RPM_BUILD_ROOT/etc/xdg/autostart
90de3b27
ER
686cp -p src/VBox/Additions/x11/Installer/vboxclient.desktop \
687 $RPM_BUILD_ROOT/etc/xdg/autostart/vboxclient.desktop
4e3859c5 688install -p src/VBox/Additions/x11/Installer/98vboxadd-xclient $RPM_BUILD_ROOT%{_bindir}/VBoxClient-all
44a0c82d 689install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxservice
122ca0f2
ER
690cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/vboxservice.service
691cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/vboxservice
1067d08d 692
38d06cb9
ER
693install -p %{SOURCE9} $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxautostart
694%{__sed} -i -e 's#@INSTALL_DIR@#%{_libdir}/%{pname}#' $RPM_BUILD_ROOT/etc/rc.d/init.d/vboxautostart
695cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/vbox
696
8d08b907
ER
697%if %{with lightdm}
698install -d $RPM_BUILD_ROOT%{_datadir}/xgreeters
29c4b6b6 699%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,%{_sbindir}}/vbox-greeter
fdf4c273 700cp -p %{objdir}/Additions/Installer/linux/other/vbox-greeter.desktop $RPM_BUILD_ROOT%{_datadir}/xgreeters
8d08b907
ER
701%endif
702
bc1ca596
ER
703%if %{with dkms}
704mv $RPM_BUILD_ROOT%{_libdir}/%{pname}/additions/src $RPM_BUILD_ROOT%{_usrsrc}/vboxguest-%{version}-%{rel}
705%endif
706
44a0c82d
ER
707# pam
708install -d $RPM_BUILD_ROOT/%{_lib}/security
709%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname}/additions,/%{_lib}/security}/pam_vbox.so
710
711# mount.vboxsf
fa478ef5 712%{__mv} $RPM_BUILD_ROOT%{_libdir}/%{pname}/additions/mount.vboxsf $RPM_BUILD_ROOT/sbin/mount.vboxsf
44a0c82d
ER
713
714# mount.vdi
715install -p %{SOURCE5} $RPM_BUILD_ROOT/sbin/mount.vdi
716
717# these belong to .iso
718%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/additions/autorun.sh
719%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/additions/runasroot.sh
720
ce061de6
ER
721# unknown - checkme
722%if 1
ffd7f18a
JR
723%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/SUPInstall
724%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/SUPLoggerCtl
725%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/SUPUninstall
ffd7f18a
JR
726%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/load.sh
727%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/loadall.sh
44a0c82d
ER
728%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/vboxshell.py
729%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/xpidl
1067d08d 730%endif
dca6c443 731
d19b622b
JP
732# manual installation steps based on src/VBox/Installer/linux/install.sh
733ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VirtualBox
734ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxManage
735ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxSDL
736ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxVRDP
737ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxHeadless
738ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxBalloonCtrl
739ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxAutostart
740ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/vboxwebsrv
741ln -sf %{_libdir}/%{pname}/vbox-img $RPM_BUILD_ROOT%{_bindir}/vbox-img
742ln -sf %{_libdir}/%{pname}/VBox.sh $RPM_BUILD_ROOT%{_bindir}/VBoxDTrace
d19b622b
JP
743cp -p $RPM_BUILD_ROOT%{_libdir}/%{pname}/icons/128x128/virtualbox.png $RPM_BUILD_ROOT%{_pixmapsdir}/virtualbox.png
744mv $RPM_BUILD_ROOT%{_libdir}/%{pname}/virtualbox.desktop $RPM_BUILD_ROOT%{_desktopdir}/virtualbox.desktop
745mv $RPM_BUILD_ROOT%{_libdir}/%{pname}/virtualbox.xml $RPM_BUILD_ROOT%{_datadir}/mime/packages/virtualbox.xml
746
c88c6ac8
JP
747mv $RPM_BUILD_ROOT%{_libdir}/%{pname}/nls $RPM_BUILD_ROOT%{_datadir}/%{pname}
748
d19b622b
JP
749(
750cd $RPM_BUILD_ROOT%{_libdir}/%{pname}/icons
751for i in *; do
752cd $i
753 for j in *; do
754 if expr "$j" : "virtualbox\..*" > /dev/null; then
755 dst=apps
756 else
757 dst=mimetypes
758 fi
759 if [ ! -e $RPM_BUILD_ROOT%{_iconsdir}/hicolor/$i/$dst ]; then
760 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/$i/$dst
761 fi
762 mv $RPM_BUILD_ROOT%{_libdir}/%{pname}/icons/$i/$j $RPM_BUILD_ROOT%{_iconsdir}/hicolor/$i/$dst/$j
763 done
764cd -
765done
766)
e56dcfeb 767
e6d149f0 768rm -r $RPM_BUILD_ROOT%{_libdir}/%{pname}/icons
d19b622b
JP
769
770%{__mv} $RPM_BUILD_ROOT{%{_libdir}/%{pname},/lib/udev}/VBoxCreateUSBNode.sh
aac4c380 771cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/udev/rules.d/60-vboxdrv.rules
44a0c82d 772
bc1ca596 773%if %{with dkms}
d19b622b 774mv $RPM_BUILD_ROOT%{_libdir}/%{pname}/src $RPM_BUILD_ROOT%{_usrsrc}/vboxhost-%{version}-%{rel}
bc1ca596
ER
775%endif
776
44a0c82d
ER
777# cleanup unpackaged
778%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{pname}/{sdk,testcase}
779%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{pname}/dtrace
44a0c82d
ER
780%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/vboxkeyboard.tar.bz2
781%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/tst*
782%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/scripts/generated.sh
783%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{pname}/ExtensionPacks/VNC/ExtPack-license.*
44a0c82d 784
d7e93912 785%if %{with gui}
44a0c82d
ER
786# weird icon size
787%{__rm} -r $RPM_BUILD_ROOT%{_iconsdir}/hicolor/40x40
d7e93912
ER
788%endif
789
44a0c82d 790# duplicate, we already have virtualbox.png (128x128), this is 32x32
d19b622b 791%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{pname}/VBox.png
44a0c82d
ER
792
793%if %{with doc}
794ln -sf %{_docdir}/%{pname}-doc-%{version}/UserManual.pdf $RPM_BUILD_ROOT%{_libdir}/%{pname}/UserManual.pdf
8c008609 795%if %{with all_langs}
4f88ff56 796ln -sf %{_docdir}/%{pname}-doc-%{version}/UserManual_fr_FR.pdf $RPM_BUILD_ROOT%{_libdir}/%{pname}/UserManual_fr_FR.pdf
44a0c82d 797%endif
c38a3946 798%endif
8c008609 799%endif
988a8f09 800
da083e45 801%if %{with kernel}
4365ecaf 802install -d $RPM_BUILD_ROOT{/etc/modules-load.d,/sbin}
163ddb28
JR
803
804cp -a PLD-MODULE-BUILD/installed/* $RPM_BUILD_ROOT
fa974331 805
35ccdfcc 806# Tell systemd to load modules
4365ecaf
JR
807cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/modules-load.d/virtualbox-host.conf
808cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/modules-load.d/virtualbox-guest.conf
d1c4ec5b 809%endif
05f1b1f5 810
48363591 811%clean
812rm -rf $RPM_BUILD_ROOT
813
3b63d3e8 814%pre
815%groupadd -g 221 -r -f vbox
816
14561782 817%post
38d06cb9
ER
818/sbin/chkconfig --add vboxautostart
819%service -n vboxautostart restart
820
12db98a7
JR
821for i in /sys/bus/usb/devices/*; do
822 if [ -r "$i/dev" ]; then
823 dev="`cat "$i/dev" 2>/dev/null || true`"
824 major="`expr "$dev" : '\(.*\):' 2> /dev/null || true`"
825 minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null || true`"
826 class="`cat $i/bDeviceClass 2> /dev/null || true`"
827 /lib/udev/VBoxCreateUSBNode.sh "$major" "$minor" "$class" vbox 2>/dev/null
828 fi
829done
1403ac49 830
d8ed80f4 831cat << 'EOF'
4365ecaf 832You must install vboxdrv kernel modules for this software to work:
163ddb28 833 kernel*-virtualbox-host-%{version}-%{rel}@*
05f12a30 834
fa974331 835On Guest Linux system you might want to install:
163ddb28 836 kernel*-virtualbox-guest-%{version}-%{rel}@*
7841ddfd 837
d8ed80f4 838EOF
839
38d06cb9
ER
840%preun
841if [ "$1" = "0" ]; then
842 /sbin/chkconfig --del vboxautostart
843 %service vboxautostart -q stop
844fi
845
846
3b63d3e8 847%postun
848if [ "$1" = "0" ]; then
849 %groupremove vbox
850fi
851
501bee39
ER
852%post gui
853%update_desktop_database
44a0c82d 854%update_icon_cache hicolor
501bee39
ER
855%update_mime_database
856
857%postun gui
858%update_desktop_database
44a0c82d 859%update_icon_cache hicolor
501bee39
ER
860%update_mime_database
861
551622b8
ER
862%pre guest
863# Add a group "vboxsf" for Shared Folders access
864# All users which want to access the auto-mounted Shared Folders have to be added to this group.
865%groupadd -g 266 -r -f vboxsf
866
07e9b84d 867%post guest
31e46441
ER
868/sbin/chkconfig --add vboxservice
869%service vboxservice restart
4365ecaf 870%systemd_post vboxservice.service
07e9b84d 871
b93128e2 872%preun guest
07e9b84d 873if [ "$1" = "0" ]; then
31e46441
ER
874 /sbin/chkconfig --del vboxservice
875 %service vboxservice -q stop
07e9b84d 876fi
4365ecaf 877%systemd_preun vboxservice.service
07e9b84d 878
4365ecaf 879%postun guest
551622b8
ER
880if [ "$1" = "0" ]; then
881 %groupremove vboxsf
882fi
4365ecaf 883%systemd_reload
ece7f2f1 884
4365ecaf
JR
885%triggerpostun guest -- VirtualBox-guest < 4.3.0-1
886%systemd_trigger vboxservice.service
ece7f2f1 887
4365ecaf
JR
888%pre -n lightdm-greeter-vbox
889%addusertogroup xdm vbox
74268e47 890
988a8f09 891%post -n dkms-vboxguest
988a8f09
ER
892dkms add -m vboxguest -v %{version}-%{rel} --rpm_safe_upgrade && \
893dkms build -m vboxguest -v %{version}-%{rel} --rpm_safe_upgrade && \
894dkms install -m vboxguest -v %{version}-%{rel} --rpm_safe_upgrade || :
895
896%preun -n dkms-vboxguest
988a8f09
ER
897dkms remove -m vboxguest -v %{version}-%{rel} --rpm_safe_upgrade --all || :
898
899%post -n dkms-vboxhost
988a8f09
ER
900dkms add -m vboxhost -v %{version}-%{rel} --rpm_safe_upgrade && \
901dkms build -m vboxhost -v %{version}-%{rel} --rpm_safe_upgrade && \
902dkms install -m vboxhost -v %{version}-%{rel} --rpm_safe_upgrade || :
903
904%preun -n dkms-vboxhost
988a8f09
ER
905dkms remove -m vboxhost -v %{version}-%{rel} --rpm_safe_upgrade --all || :
906
d1c4ec5b 907%if %{with userspace}
48363591 908%files
909%defattr(644,root,root,755)
2daf9ea4
ER
910%dir %attr(751,root,root) %{_sysconfdir}/vbox
911%dir %attr(770,root,vbox) %{_sysconfdir}/vbox/autostart
38d06cb9
ER
912%attr(640,root,vbox) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vbox/autostart.cfg
913%attr(754,root,root) /etc/rc.d/init.d/vboxautostart
44a0c82d 914%attr(755,root,root) /sbin/mount.vdi
753cf356
ER
915%attr(755,root,root) %{_bindir}/VBoxAutostart
916%attr(755,root,root) %{_bindir}/VBoxBalloonCtrl
8c008609 917%attr(755,root,root) %{_bindir}/VBoxDTrace
85b005e2 918%attr(755,root,root) %{_bindir}/VBoxHeadless
919%attr(755,root,root) %{_bindir}/VBoxManage
920%attr(755,root,root) %{_bindir}/VBoxSDL
4c9a69b2 921%attr(755,root,root) %{_bindir}/VBoxVRDP
8c008609 922%attr(755,root,root) %{_bindir}/vbox-img
44a0c82d 923%dir %{_libdir}/%{pname}
753cf356 924# libraries
8c008609 925%attr(755,root,root) %{_libdir}/%{pname}/DbgPlugInDiggers.so
23790586
ER
926%attr(755,root,root) %{_libdir}/%{pname}/VBoxAuth.so
927%attr(755,root,root) %{_libdir}/%{pname}/VBoxAuthSimple.so
23790586 928%attr(755,root,root) %{_libdir}/%{pname}/VBoxDD.so
753cf356 929%attr(755,root,root) %{_libdir}/%{pname}/VBoxDD2.so
23790586
ER
930%attr(755,root,root) %{_libdir}/%{pname}/VBoxDDU.so
931%attr(755,root,root) %{_libdir}/%{pname}/VBoxDragAndDropSvc.so
23790586
ER
932%attr(755,root,root) %{_libdir}/%{pname}/VBoxGuestControlSvc.so
933%attr(755,root,root) %{_libdir}/%{pname}/VBoxGuestPropSvc.so
23790586
ER
934%attr(755,root,root) %{_libdir}/%{pname}/VBoxHostChannel.so
935%attr(755,root,root) %{_libdir}/%{pname}/VBoxKeyboard.so
23790586
ER
936%attr(755,root,root) %{_libdir}/%{pname}/VBoxOGLhostcrutil.so
937%attr(755,root,root) %{_libdir}/%{pname}/VBoxOGLhosterrorspu.so
938%attr(755,root,root) %{_libdir}/%{pname}/VBoxOGLrenderspu.so
939%attr(755,root,root) %{_libdir}/%{pname}/VBoxPython*.so
940%attr(755,root,root) %{_libdir}/%{pname}/VBoxREM.so
753cf356
ER
941%attr(755,root,root) %{_libdir}/%{pname}/VBoxRT.so
942%attr(755,root,root) %{_libdir}/%{pname}/VBoxSharedClipboard.so
943%attr(755,root,root) %{_libdir}/%{pname}/VBoxSharedCrOpenGL.so
944%attr(755,root,root) %{_libdir}/%{pname}/VBoxSharedFolders.so
945%attr(755,root,root) %{_libdir}/%{pname}/VBoxVMM.so
946%attr(755,root,root) %{_libdir}/%{pname}/VBoxXPCOM.so
947%attr(755,root,root) %{_libdir}/%{pname}/VBoxXPCOMC.so
f701b529 948%ifarch %{ix86}
23790586
ER
949%attr(755,root,root) %{_libdir}/%{pname}/VBoxREM32.so
950%attr(755,root,root) %{_libdir}/%{pname}/VBoxREM64.so
f701b529 951%endif
753cf356
ER
952
953# binaries
d19b622b 954%attr(755,root,root) %{_libdir}/%{pname}/VBox.sh
753cf356
ER
955%attr(755,root,root) %{_libdir}/%{pname}/VBoxAutostart
956%attr(755,root,root) %{_libdir}/%{pname}/VBoxBalloonCtrl
d19b622b 957%attr(755,root,root) %{_libdir}/%{pname}/VBoxDTrace
753cf356
ER
958%attr(755,root,root) %{_libdir}/%{pname}/VBoxExtPackHelperApp
959%attr(755,root,root) %{_libdir}/%{pname}/VBoxHeadless
960%attr(755,root,root) %{_libdir}/%{pname}/VBoxManage
961%attr(755,root,root) %{_libdir}/%{pname}/VBoxNetAdpCtl
962%attr(755,root,root) %{_libdir}/%{pname}/VBoxNetDHCP
963%attr(755,root,root) %{_libdir}/%{pname}/VBoxNetNAT
23790586 964%attr(755,root,root) %{_libdir}/%{pname}/VBoxSDL
23790586 965%attr(755,root,root) %{_libdir}/%{pname}/VBoxSVC
d19b622b 966%attr(755,root,root) %{_libdir}/%{pname}/VBoxTunctl
23790586 967%attr(755,root,root) %{_libdir}/%{pname}/VBoxVMMPreload
753cf356 968%attr(755,root,root) %{_libdir}/%{pname}/VBoxVolInfo
23790586 969%attr(755,root,root) %{_libdir}/%{pname}/VBoxXPCOMIPCD
753cf356
ER
970%attr(755,root,root) %{_libdir}/%{pname}/iPxeBaseBin
971%if %{with doc}
972%attr(755,root,root) %{_libdir}/%{pname}/VBoxManageHelp
973%endif
28b5d8a8 974%dir %{_libdir}/%{pname}/tools
fdf4c273
JP
975%attr(755,root,root) %{_libdir}/%{pname}/tools/RTCat
976%attr(755,root,root) %{_libdir}/%{pname}/tools/RTChMod
8c008609 977%attr(755,root,root) %{_libdir}/%{pname}/tools/RTDbgSymCache
28b5d8a8 978%attr(755,root,root) %{_libdir}/%{pname}/tools/RTGzip
f93501c2 979%attr(755,root,root) %{_libdir}/%{pname}/tools/RTHttp
fdf4c273
JP
980%attr(755,root,root) %{_libdir}/%{pname}/tools/RTIsoMaker
981%attr(755,root,root) %{_libdir}/%{pname}/tools/RTKrnlModInfo
28b5d8a8 982%attr(755,root,root) %{_libdir}/%{pname}/tools/RTLdrFlt
fdf4c273 983%attr(755,root,root) %{_libdir}/%{pname}/tools/RTLs
28b5d8a8 984%attr(755,root,root) %{_libdir}/%{pname}/tools/RTManifest
fdf4c273 985%attr(755,root,root) %{_libdir}/%{pname}/tools/RTMkDir
28b5d8a8 986%attr(755,root,root) %{_libdir}/%{pname}/tools/RTRm
fdf4c273 987%attr(755,root,root) %{_libdir}/%{pname}/tools/RTRmDir
28b5d8a8
JP
988%attr(755,root,root) %{_libdir}/%{pname}/tools/RTShutdown
989%attr(755,root,root) %{_libdir}/%{pname}/tools/RTSignTool
990%attr(755,root,root) %{_libdir}/%{pname}/tools/RTTar
8c008609
JP
991%attr(755,root,root) %{_libdir}/%{pname}/tools/RTUnzip
992%attr(755,root,root) %{_libdir}/%{pname}/tools/scm
44a0c82d
ER
993
994%dir %{_libdir}/%{pname}/ExtensionPacks
995%{_libdir}/%{pname}/ExtensionPacks/VNC/ExtPack.xml
996%dir %{_libdir}/%{pname}/ExtensionPacks/VNC
997%dir %{_libdir}/%{pname}/ExtensionPacks/VNC/linux*
23790586 998%attr(755,root,root) %{_libdir}/%{pname}/ExtensionPacks/VNC/linux*/VBoxVNC*.so
8c008609
JP
999%dir %{_libdir}/%{pname}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack
1000%{_libdir}/%{pname}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/ExtPack.xml
1001%dir %{_libdir}/%{pname}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux*
1002%attr(755,root,root) %{_libdir}/%{pname}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux*/VBoxDTrace*.so
1003%{_libdir}/%{pname}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux*/VBoxDTraceR0.debug
1004%{_libdir}/%{pname}/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux*/VBoxDTraceR0.r0
1005
b8593b70 1006%{_libdir}/%{pname}/VBoxBugReport
8c008609 1007%{_libdir}/%{pname}/VBoxCpuReport
7733446a 1008%{_libdir}/%{pname}/VBoxDD2R0.debug
23790586 1009%{_libdir}/%{pname}/VBoxDD2R0.r0
8c008609
JP
1010%{_libdir}/%{pname}/VBoxDD2RC.debug
1011%{_libdir}/%{pname}/VBoxDD2RC.rc
1012%{_libdir}/%{pname}/VBoxDDRC.debug
1013%{_libdir}/%{pname}/VBoxDDRC.rc
7733446a 1014%{_libdir}/%{pname}/VBoxDDR0.debug
23790586 1015%{_libdir}/%{pname}/VBoxDDR0.r0
23790586
ER
1016%{_libdir}/%{pname}/VBoxEFI32.fd
1017%{_libdir}/%{pname}/VBoxEFI64.fd
8c008609
JP
1018%{_libdir}/%{pname}/VMMRC.debug
1019%{_libdir}/%{pname}/VMMRC.rc
7733446a
JR
1020%{_libdir}/%{pname}/VMMR0.debug
1021%{_libdir}/%{pname}/VMMR0.r0
44a0c82d
ER
1022
1023%dir %{_libdir}/%{pname}/components
501bee39 1024%{_libdir}/%{pname}/components/VBoxXPCOMBase.xpt
23790586
ER
1025%{_libdir}/%{pname}/components/VirtualBox_XPCOM.xpt
1026%attr(755,root,root) %{_libdir}/%{pname}/components/VBoxC.so
1027%attr(755,root,root) %{_libdir}/%{pname}/components/VBoxSVCM.so
1028%attr(755,root,root) %{_libdir}/%{pname}/components/VBoxXPCOMIPCC.so
d19b622b 1029%attr(755,root,root) %{_libdir}/%{pname}/VBoxSysInfo.sh
44a0c82d 1030
fdf4c273
JP
1031%{_libdir}/%{pname}/UnattendedTemplates
1032
c88c6ac8
JP
1033%dir %{_datadir}/%{pname}
1034
e10592b2 1035%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/*.rules
501bee39
ER
1036%attr(755,root,root) /lib/udev/VBoxCreateUSBNode.sh
1037
d7e93912 1038%if %{with gui}
501bee39
ER
1039%files gui
1040%defattr(644,root,root,755)
1041%attr(755,root,root) %{_bindir}/VirtualBox
501bee39
ER
1042%attr(755,root,root) %{_libdir}/%{pname}/VBoxDbg.so
1043%attr(755,root,root) %{_libdir}/%{pname}/VBoxTestOGL
753cf356 1044%attr(755,root,root) %{_libdir}/%{pname}/VirtualBox
c88c6ac8
JP
1045%dir %{_datadir}/%{pname}/nls
1046%lang(bg) %{_datadir}/%{pname}/nls/*_bg.qm
1047%lang(ca) %{_datadir}/%{pname}/nls/*_ca.qm
1048%lang(ca_VA) %{_datadir}/%{pname}/nls/*_ca_VA.qm
1049%lang(cs) %{_datadir}/%{pname}/nls/*_cs.qm
1050%lang(da) %{_datadir}/%{pname}/nls/*_da.qm
1051%lang(de) %{_datadir}/%{pname}/nls/*_de.qm
1052%lang(en) %{_datadir}/%{pname}/nls/*_el.qm
1053%lang(en) %{_datadir}/%{pname}/nls/*_en.qm
1054%lang(es) %{_datadir}/%{pname}/nls/*_es.qm
1055%lang(eu) %{_datadir}/%{pname}/nls/*_eu.qm
fdf4c273 1056%lang(fa) %{_datadir}/%{pname}/nls/*_fa.qm
c88c6ac8
JP
1057%lang(fi) %{_datadir}/%{pname}/nls/*_fi.qm
1058%lang(fr) %{_datadir}/%{pname}/nls/*_fr.qm
fdf4c273 1059%lang(gl) %{_datadir}/%{pname}/nls/*_gl.qm
c88c6ac8
JP
1060%lang(he) %{_datadir}/%{pname}/nls/*_he.qm
1061%lang(hu) %{_datadir}/%{pname}/nls/*_hu.qm
1062%lang(id) %{_datadir}/%{pname}/nls/*_id.qm
1063%lang(it) %{_datadir}/%{pname}/nls/*_it.qm
1064%lang(ja) %{_datadir}/%{pname}/nls/*_ja.qm
1065%lang(km_KH) %{_datadir}/%{pname}/nls/*_km_KH.qm
1066%lang(ko) %{_datadir}/%{pname}/nls/*_ko.qm
1067%lang(lt) %{_datadir}/%{pname}/nls/*_lt.qm
1068%lang(nl) %{_datadir}/%{pname}/nls/*_nl.qm
1069%lang(pl) %{_datadir}/%{pname}/nls/*_pl.qm
1070%lang(pt) %{_datadir}/%{pname}/nls/*_pt.qm
1071%lang(pt_BR) %{_datadir}/%{pname}/nls/*_pt_BR.qm
1072%lang(ro) %{_datadir}/%{pname}/nls/*_ro.qm
1073%lang(ru) %{_datadir}/%{pname}/nls/*_ru.qm
1074%lang(sk) %{_datadir}/%{pname}/nls/*_sk.qm
1075%lang(sk) %{_datadir}/%{pname}/nls/*_sl.qm
1076%lang(sr) %{_datadir}/%{pname}/nls/*_sr.qm
1077%lang(sv) %{_datadir}/%{pname}/nls/*_sv.qm
70211746 1078%lang(th) %{_datadir}/%{pname}/nls/*_th.qm
c88c6ac8
JP
1079%lang(tr) %{_datadir}/%{pname}/nls/*_tr.qm
1080%lang(uk) %{_datadir}/%{pname}/nls/*_uk.qm
1081%lang(zh_CN) %{_datadir}/%{pname}/nls/*_zh_CN.qm
1082%lang(zh_TW) %{_datadir}/%{pname}/nls/*_zh_TW.qm
501bee39 1083%{_desktopdir}/virtualbox.desktop
44a0c82d
ER
1084%{_pixmapsdir}/virtualbox.png
1085%{_iconsdir}/hicolor/*/apps/virtualbox.png
1086%{_iconsdir}/hicolor/*/apps/virtualbox.svg
1087%{_iconsdir}/hicolor/*/mimetypes/virtualbox-*.png
501bee39 1088%{_datadir}/mime/packages/virtualbox.xml
d7e93912 1089%endif
12db98a7 1090
ffb38bb6 1091%files additions
9dda6415 1092%defattr(644,root,root,755)
244b344b 1093%{_datadir}/%{pname}/VBoxGuestAdditions.iso
ffb38bb6 1094
1067d08d
ER
1095%files guest
1096%defattr(644,root,root,755)
c11f39b3 1097%attr(755,root,root) /sbin/mount.vboxsf
07e9b84d 1098%attr(754,root,root) /etc/rc.d/init.d/vboxservice
122ca0f2 1099%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/vboxservice
4365ecaf 1100%{systemdunitdir}/vboxservice.service
c0372ee9
ER
1101%attr(755,root,root) %{_bindir}/VBoxControl
1102%attr(755,root,root) %{_bindir}/VBoxService
1103
1104%files guest-x11
3d9b19d8 1105%defattr(644,root,root,755)
90de3b27 1106/etc/xdg/autostart/vboxclient.desktop
4e3859c5
ER
1107%attr(755,root,root) %{_bindir}/VBoxClient
1108%attr(755,root,root) %{_bindir}/VBoxClient-all
1067d08d 1109
21a1d8ab
ER
1110%if %{with webservice}
1111%files webservice
1112%defattr(644,root,root,755)
44a0c82d 1113%attr(755,root,root) %{_bindir}/vboxwebsrv
21a1d8ab
ER
1114%attr(755,root,root) %{_libdir}/%{pname}/vboxwebsrv
1115%attr(755,root,root) %{_libdir}/%{pname}/webtest
1116%endif
1117
8d08b907 1118%if %{with lightdm}
9e4dd6a9 1119%files -n lightdm-greeter-vbox
8d08b907
ER
1120%defattr(644,root,root,755)
1121%attr(755,root,root) %{_sbindir}/vbox-greeter
1122%{_datadir}/xgreeters/vbox-greeter.desktop
1123%endif
1124
3613936b
JR
1125%files -n pam-pam_vbox
1126%defattr(644,root,root,755)
3ee6b9d9 1127%attr(755,root,root) /%{_lib}/security/pam_vbox.so
3613936b 1128
90de3b27
ER
1129%if %{with doc}
1130%files doc
1131%defattr(644,root,root,755)
f0a66b84
JR
1132# this is a symlink...
1133%doc %{_libdir}/%{pname}/UserManual.pdf
8c008609 1134%if %{with all_langs}
4f88ff56 1135%lang(fr) %doc %{_libdir}/%{pname}/UserManual_fr_FR.pdf
8c008609 1136%endif
f0a66b84 1137# ..to this file
90de3b27 1138%doc %{outdir}/UserManual.pdf
8c008609 1139%if %{with all_langs}
4f88ff56 1140%lang(fr) %doc %{outdir}/UserManual_fr_FR.pdf
90de3b27 1141%endif
8c008609 1142%endif
90de3b27 1143
09c79ddb 1144%files -n xorg-driver-video-vboxvideo
1145%defattr(644,root,root,755)
27a1aef6
ER
1146%attr(755,root,root) %{_libdir}/xorg/modules/dri/vboxvideo_dri.so
1147# vboxvideo_dri.so deps
349989a6 1148%attr(755,root,root) %{_libdir}/VBoxEGL.so
1067d08d 1149%attr(755,root,root) %{_libdir}/VBoxOGLarrayspu.so
27a1aef6
ER
1150%attr(755,root,root) %{_libdir}/VBoxOGLcrutil.so
1151%attr(755,root,root) %{_libdir}/VBoxOGLerrorspu.so
1152%attr(755,root,root) %{_libdir}/VBoxOGLfeedbackspu.so
1153%attr(755,root,root) %{_libdir}/VBoxOGLpackspu.so
1154%attr(755,root,root) %{_libdir}/VBoxOGLpassthroughspu.so
988a8f09
ER
1155
1156%if %{with dkms}
1157%files -n dkms-vboxguest
1158%defattr(644,root,root,755)
1159%{_usrsrc}/vboxguest-%{version}-%{rel}
1160
1161%files -n dkms-vboxhost
1162%defattr(644,root,root,755)
1163%{_usrsrc}/vboxhost-%{version}-%{rel}
1164%endif
c38a3946 1165%endif
This page took 1.78502 seconds and 4 git commands to generate.