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