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