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