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