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