1 |
# Note! When updating this package, remember to push |
2 |
# kmod-vboxadditions and kmod-virtualbox too |
3 |
# |
4 |
%define ver 5.1.16 |
5 |
%define rel 1 |
6 |
%define kname vboxdrv |
7 |
%define oname VirtualBox |
8 |
%define srcname %{oname}-%{version} |
9 |
%define distname %{oname}-%{version} |
10 |
%define dirname vbox-ose |
11 |
%define pkgver %{ver}%{?svndate:-%{svndate}} |
12 |
|
13 |
%define vboxlibdir %{_libdir}/%{name} |
14 |
%define vboxdatadir %{_datadir}/%{name} |
15 |
%define vboxpydir %{py_puresitedir}/vboxapi |
16 |
|
17 |
# (doktor5000) add conditional for build of the webservice, takes quite long to build locally |
18 |
%define build_gsoap 1 |
19 |
|
20 |
# (tmb) add conditional to build vboxvideo ddx (obsolete since switch to virtualbox 5.1 series) |
21 |
%define build_vboxvideo 0 |
22 |
|
23 |
%define build_additions 1 |
24 |
%define build_doc 1 |
25 |
%define build_sdk 1 |
26 |
|
27 |
%ifarch %{ix86} |
28 |
%define vbox_platform linux.x86 |
29 |
%endif |
30 |
%ifarch x86_64 |
31 |
%define vbox_platform linux.amd64 |
32 |
%endif |
33 |
|
34 |
# nuke vbox-specific dependencies, dont provide libGL.so.1 |
35 |
%global __provides_exclude ^VBox|\^libGL\\.so\\.1 |
36 |
%global __requires_exclude ^VBox |
37 |
|
38 |
%define x11_server_majorver %(pkg-config --modversion xorg-server|awk -F. '{print $1$2}') |
39 |
|
40 |
Summary: A general-purpose full virtualizer for x86 hardware |
41 |
Name: virtualbox |
42 |
Version: %{ver}%{?svndate:.%{svndate}} |
43 |
Release: %mkrel %{rel} |
44 |
Source0: http://download.virtualbox.org/virtualbox/%ver/%{srcname}.tar.bz2 |
45 |
# (cg) NB, this module loading "init" script should just be replaced with |
46 |
# /usr/lib/modules-load.d/ snippets to load it statically (assuming it's even |
47 |
# needed at all these days) |
48 |
Source2: virtualbox.init |
49 |
Source3: vboxadd.service |
50 |
Source4: virtualbox-tmpfiles.conf |
51 |
Source10: virtualbox.png |
52 |
Source11: virtualbox.16.png |
53 |
Source12: virtualbox.48.png |
54 |
# (tmb: mga icons submitted upstream 2011-10-22) |
55 |
Source20: os_mageia.png |
56 |
Source21: os_mageia_64.png |
57 |
Patch2: VirtualBox-5.1.0-kernelrelease.patch |
58 |
Patch3: VirtualBox-5.1.0-futex.patch |
59 |
Patch4: VirtualBox-5.1.0-fix-vboxadd-req.patch |
60 |
# don't check for: |
61 |
# - mkisofs: we're not going to build the additions .iso file |
62 |
# - makeself: we're not going to create the stanalone .run installers |
63 |
Patch9: VirtualBox-5.1.0-dont-check-for-mkisofs-or-makeself.patch |
64 |
# add Mageia support (tmb: submitted upstream 2011-10-22) |
65 |
Patch13: VirtualBox-5.1.0-add-Mageia-support.patch |
66 |
# (tmb) Default to Mageia |
67 |
Patch14: VirtualBox-5.1.0-default-to-Mageia.patch |
68 |
# (tmb) default to no update checks as we provide rpms |
69 |
Patch15: VirtualBox-5.1.0-noupdate-check.patch |
70 |
# (tmb) fix build with gsoap >= 2.8.13 |
71 |
Patch16: VirtualBox-5.1.4-fix-build-with-gsoap-2.8.13-and-up.patch |
72 |
# (tmb) revert to working Vbox.sh reading config file |
73 |
Patch18: VirtualBox-5.1.0-revert-VBox.sh.patch |
74 |
# fix problems with compiling xpcom18a4/python/src/PyIID.cpp under i586 arch |
75 |
Patch19: VirtualBox-5.1.6-python.patch |
76 |
|
77 |
### |
78 |
### RPMfusion patches |
79 |
### https://pkgs.rpmfusion.org/cgit/free/VirtualBox.git |
80 |
### |
81 |
# add missing checks for VBOX_USE_SYSTEM_XORG_HEADERS |
82 |
# https://www.virtualbox.org/ticket/16052 |
83 |
Patch50: VirtualBox-5.0.18-xserver_guest.patch |
84 |
%if ! %{build_vboxvideo} |
85 |
# dont build vboxvideo ddx: |
86 |
Patch51: VirtualBox-5.0.18-xserver_guest_xorg19.patch |
87 |
%endif |
88 |
# build against system libs |
89 |
Patch52: VirtualBox-5.1.0-no-bundles.patch |
90 |
|
91 |
License: GPLv2 |
92 |
Group: Emulators |
93 |
Url: http://www.virtualbox.org/ |
94 |
ExclusiveArch: %{ix86} x86_64 |
95 |
Requires(post): systemd >= %{systemd_required_version} |
96 |
Requires(post): rpm-helper |
97 |
Requires(preun): rpm-helper |
98 |
Requires(postun): rpm-helper |
99 |
Requires: kmod(vboxdrv.ko) = %{version} |
100 |
Conflicts: dkms-%{name} <= 1.5.0-5 |
101 |
Recommends: %{name}-doc |
102 |
BuildRequires: gsoap |
103 |
BuildRequires: dev86 |
104 |
BuildRequires: iasl |
105 |
BuildRequires: nasm |
106 |
BuildRequires: zlib-devel |
107 |
BuildRequires: libxcursor-devel |
108 |
BuildRequires: libxmu-devel |
109 |
BuildRequires: SDL-devel |
110 |
BuildRequires: pkgconfig(Qt5Core) |
111 |
BuildRequires: pkgconfig(Qt5Gui) |
112 |
BuildRequires: pkgconfig(Qt5Widgets) |
113 |
BuildRequires: pkgconfig(Qt5X11Extras) |
114 |
BuildRequires: pkgconfig(Qt5PrintSupport) |
115 |
BuildRequires: pkgconfig(Qt5OpenGL) |
116 |
BuildRequires: qttools5 |
117 |
BuildRequires: libIDL-devel |
118 |
BuildRequires: libext2fs-devel |
119 |
BuildRequires: libxslt-proc |
120 |
BuildRequires: libxslt-devel |
121 |
BuildRequires: pkgconfig(egl) |
122 |
BuildRequires: libxt-devel |
123 |
BuildRequires: libstdc++-static-devel |
124 |
BuildRequires: python-devel |
125 |
BuildRequires: libcap-devel |
126 |
BuildRequires: libxrandr-devel |
127 |
BuildRequires: libxinerama-devel |
128 |
BuildRequires: libxcomposite-devel |
129 |
BuildRequires: pulseaudio-devel |
130 |
BuildRequires: kernel-devel-latest |
131 |
BuildRequires: mesaglu-devel |
132 |
BuildRequires: mesagl-devel |
133 |
BuildRequires: libxmu-devel |
134 |
BuildRequires: openssl-devel |
135 |
BuildRequires: curl-devel |
136 |
BuildRequires: dkms-minimal |
137 |
BuildRequires: libpam-devel |
138 |
BuildRequires: gawk |
139 |
BuildRequires: x11-server-devel |
140 |
BuildRequires: javapackages-tools |
141 |
BuildRequires: java-devel |
142 |
BuildRequires: device-mapper-devel |
143 |
BuildRequires: boost-devel |
144 |
BuildRequires: libvpx-devel |
145 |
%if %{build_doc} |
146 |
# for building the user manual pdf file |
147 |
BuildRequires: texlive |
148 |
BuildRequires: texlive-fontsextra |
149 |
BuildRequires: docbook-dtds |
150 |
%endif |
151 |
BuildRequires: libxslt-devel |
152 |
|
153 |
%description |
154 |
VirtualBox is a general-purpose full virtualizer for x86 hardware. |
155 |
|
156 |
%package -n dkms-%{name} |
157 |
Summary: VirtualBox kernel module |
158 |
Group: System/Kernel and hardware |
159 |
Provides: kmod(vboxdrv.ko) = %{version} |
160 |
BuildArch: noarch |
161 |
Requires: dkms >= 2.0.19-37 |
162 |
Requires(post): dkms >= 2.0.19-37 |
163 |
Requires(preun): dkms >= 2.0.19-37 |
164 |
Conflicts: dkms-vboxadditions < 4.0.6 |
165 |
|
166 |
%description -n dkms-%{name} |
167 |
Kernel support for VirtualBox. |
168 |
|
169 |
%if %{build_additions} |
170 |
%package guest-additions |
171 |
Summary: Additions for VirtualBox guest systems |
172 |
Group: Emulators |
173 |
Requires: kmod(vboxguest.ko) |
174 |
Requires: kmod(vboxsf.ko) |
175 |
Requires: kmod(vboxvideo.ko) |
176 |
Requires: x11-driver-video-vboxvideo |
177 |
# guest-additions should require xrandr for auto-resizing of guest display to |
178 |
# work without having to restart the X server in the guest VM |
179 |
Requires: xrandr |
180 |
Requires(post): rpm-helper |
181 |
Requires(preun): rpm-helper |
182 |
|
183 |
%description guest-additions |
184 |
This package contains additions for VirtualBox guest systems. |
185 |
It allows to share files with the host system and sync time with host. |
186 |
|
187 |
%package -n dkms-vboxadditions |
188 |
Summary: Kernel module for VirtualBox additions |
189 |
Group: System/Kernel and hardware |
190 |
Provides: kmod(vboxguest.ko) = %{version} |
191 |
Provides: kmod(vboxsf.ko) = %{version} |
192 |
Provides: kmod(vboxvideo.ko) = %{version} |
193 |
BuildArch: noarch |
194 |
Requires: dkms >= 2.0.19-37 |
195 |
Requires(post): dkms >= 2.0.19-37 |
196 |
Requires(preun): dkms >= 2.0.19-37 |
197 |
Obsoletes: dkms-vboxadd < %{version}-%{release} |
198 |
Provides: dkms-vboxvfs = %{version}-%{release} |
199 |
Obsoletes: dkms-vboxvfs < %{version}-%{release} |
200 |
Provides: dkms-vboxsf = %{version}-%{release} |
201 |
Obsoletes: dkms-vboxsf < %{version}-%{release} |
202 |
Provides: dkms-vboxvideo = %{version}-%{release} |
203 |
Obsoletes: dkms-vboxvideo < %{version}-%{release} |
204 |
Conflicts: dkms-%{name} < 4.0.6 |
205 |
|
206 |
%description -n dkms-vboxadditions |
207 |
Kernel module for VirtualBox additions (ideally only needs to be installed |
208 |
on the guest OS not on the host OS). |
209 |
|
210 |
%package -n x11-driver-video-vboxvideo |
211 |
Summary: The X.org driver for video in VirtualBox guests |
212 |
Group: System/X11 |
213 |
Recommends: virtualbox-guest-additions |
214 |
%if %{build_vboxvideo} |
215 |
Requires: x11-server-common %(xserver-sdk-abi-requires videodrv) |
216 |
%endif |
217 |
|
218 |
|
219 |
%description -n x11-driver-video-vboxvideo |
220 |
The X.org driver for video in VirtualBox guests. |
221 |
%endif |
222 |
|
223 |
%if %build_doc |
224 |
%package doc |
225 |
Summary: The user manual PDF file for %{name} |
226 |
Group: Documentation |
227 |
BuildArch: noarch |
228 |
|
229 |
%description doc |
230 |
This package contains the user manual PDF file for %{name}. |
231 |
%endif |
232 |
|
233 |
%if %{build_sdk} |
234 |
%package devel |
235 |
Summary: %{name} SDK |
236 |
Group: Development/Other |
237 |
Requires: %{name} = %{version}-%{release} |
238 |
Requires: python-%{name} = %{version}-%{release} |
239 |
|
240 |
%description devel |
241 |
This package contains the SDK for %{name}. |
242 |
|
243 |
|
244 |
%package -n python-%{name} |
245 |
Summary: %{name} SDK |
246 |
Group: Development/Python |
247 |
Requires: %{name} = %{version}-%{release} |
248 |
|
249 |
%description -n python-%{name} |
250 |
Python XPCOM bindings to %{name}. |
251 |
%endif |
252 |
|
253 |
%prep |
254 |
%setup -q -n %{distname} |
255 |
%autopatch -p1 |
256 |
|
257 |
# add Mageia images |
258 |
cp -a %{SOURCE20} %{SOURCE21} src/VBox/Frontends/VirtualBox/images/ |
259 |
|
260 |
# add our kernel headers in place |
261 |
rm -rf fake-linux/ |
262 |
|
263 |
# (doktor5000) this is not safe, on kernel removal sometimes empty directories will be leftover, and build breaks here |
264 |
#cp -a $(ls -1dtr /usr/src/kernel-* | tail -n 1) fake-linux |
265 |
|
266 |
# check all kernel header directories descendingly by age, if the folder we want to copy is owned by rpm |
267 |
# FIXME: is an additional check necessary if headers are suitable for the running kernel ? We may want to build for a different kernel here ... |
268 |
for src in $(ls -dt /usr/src/kernel-*); do rpm -qf $src 2>&1 >/dev/null && { cp -a $src fake-linux ; } || continue; done |
269 |
|
270 |
# Remove some bundled sources before patching. |
271 |
rm -rf src/VBox/Additions/x11/x11include |
272 |
rm -rf src/VBox/Additions/x11/x11stubs |
273 |
rm include/VBox/HostServices/glext.h |
274 |
rm include/VBox/HostServices/glxext.h |
275 |
# remove unwanted bundled libs |
276 |
rm -rf src/libs/libxml2-2.9.2/ |
277 |
rm -rf src/libs/libpng-1.2.54/ |
278 |
rm -rf src/libs/zlib-1.2.8/ |
279 |
|
280 |
cat << EOF > LocalConfig.kmk |
281 |
VBOX_PATH_APP_PRIVATE_ARCH:=%{vboxlibdir} |
282 |
VBOX_WITH_ORIGIN:= |
283 |
VBOX_WITH_RUNPATH:=%{vboxlibdir} |
284 |
VBOX_PATH_APP_PRIVATE:=%{vboxlibdir} |
285 |
VBOX_WITH_TESTCASES = |
286 |
VBOX_WITH_TESTSUITE:= |
287 |
VBOX_JAVA_HOME := %{java_home} |
288 |
VBOX_WITHOUT_ADDITIONS_ISO := 1 |
289 |
VBOX_USE_SYSTEM_XORG_HEADERS := 1 |
290 |
XSERVER_VERSION := %{x11_server_majorver} |
291 |
VBOX_PATH_APP_DOCS :=%{_defaultdocdir}/virtualbox |
292 |
SVN := |
293 |
%ifarch %{ix86} |
294 |
VBOX_WITH_MULTIVERSION_PYTHON = 0 |
295 |
%else |
296 |
VBOX_WITH_MULTIVERSION_PYTHON = 1 |
297 |
%endif |
298 |
EOF |
299 |
|
300 |
%build |
301 |
#make -C fake-linux prepare |
302 |
export LIBPATH_LIB="%{_lib}" |
303 |
./configure \ |
304 |
%if %build_gsoap |
305 |
--enable-webservice \ |
306 |
%endif |
307 |
--with-linux=$PWD/fake-linux \ |
308 |
%if ! %build_doc |
309 |
--disable-docs |
310 |
%endif |
311 |
|
312 |
%if !%{build_additions} |
313 |
sed -rie 's/(VBOX_WITH_LINUX_ADDITIONS\s+:=\s+).*/\1/' AutoConfig.kmk |
314 |
echo VBOX_WITHOUT_ADDITIONS=1 >> LocalConfig.kmk |
315 |
%endif |
316 |
|
317 |
. ./env.sh |
318 |
# (tmb) parallell build is problematic, restrict to -j 4 |
319 |
kmk -j4 all |
320 |
|
321 |
%install |
322 |
# install vbox components |
323 |
mkdir -p %{buildroot}%{vboxlibdir} %{buildroot}%{vboxdatadir} |
324 |
|
325 |
(cd out/%{vbox_platform}/release/bin && tar cf - --exclude=additions .) | \ |
326 |
(cd %{buildroot}%{vboxlibdir} && tar xf -) |
327 |
|
328 |
# move noarch files to vboxdatadir |
329 |
mv %{buildroot}%{vboxlibdir}/{VBox*.sh,*.desktop,*.png} %{buildroot}%{vboxdatadir} |
330 |
|
331 |
# install service |
332 |
mkdir -p %{buildroot}%{_initrddir} |
333 |
install -m755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name} |
334 |
|
335 |
# install wrappers |
336 |
mkdir -p %{buildroot}%{_sysconfdir}/vbox |
337 |
cat > %{buildroot}%{_sysconfdir}/vbox/vbox.cfg << EOF |
338 |
# VirtualBox installation directory |
339 |
INSTALL_DIR="%{vboxlibdir}" |
340 |
EOF |
341 |
mkdir -p %{buildroot}%{_bindir} |
342 |
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/%{oname} |
343 |
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxManage |
344 |
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxSDL |
345 |
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxHeadless |
346 |
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/vboxwebsrv |
347 |
|
348 |
# provide network control tools in bindir |
349 |
ln -s %{vboxlibdir}/VBoxTunctl %{buildroot}%{_bindir}/VBoxTunctl |
350 |
ln -s %{vboxlibdir}/VBoxNetAdpCtl %{buildroot}%{_bindir}/VBoxNetAdpCtl |
351 |
ln -s %{vboxlibdir}/VBoxNetDHCP %{buildroot}%{_bindir}/VBoxNetDHCP |
352 |
|
353 |
# add tmpfs dir in /run |
354 |
install -m644 -D %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf |
355 |
|
356 |
# install dkms sources |
357 |
mkdir -p %{buildroot}%{_usr}/src/%{name}-%{version}-%{release} |
358 |
cat > vboxbuild << EOF |
359 |
#!/bin/sh |
360 |
set -e |
361 |
make -C %{kname} KERN_DIR=\$1 |
362 |
cp -f %{kname}/Module.symvers vboxnetflt |
363 |
cp -f %{kname}/Module.symvers vboxnetadp |
364 |
cp -f %{kname}/Module.symvers vboxpci |
365 |
make -C vboxnetflt KERN_DIR=\$1 |
366 |
make -C vboxnetadp KERN_DIR=\$1 |
367 |
make -C vboxpci KERN_DIR=\$1 |
368 |
EOF |
369 |
install -m 0755 vboxbuild %{buildroot}%{_usr}/src/%{name}-%{version}-%{release} |
370 |
mv %{buildroot}%{vboxlibdir}/src/* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ |
371 |
cat > %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf << EOF |
372 |
MAKE[0]="./vboxbuild \$kernel_source_dir" |
373 |
PACKAGE_NAME=%{name} |
374 |
PACKAGE_VERSION=%{version}-%{release} |
375 |
DEST_MODULE_LOCATION[0]=/kernel/3rdparty/vbox |
376 |
BUILT_MODULE_LOCATION[0]=%{kname}/ |
377 |
BUILT_MODULE_NAME[0]=%{kname} |
378 |
DEST_MODULE_LOCATION[1]=/kernel/3rdparty/vbox |
379 |
BUILT_MODULE_LOCATION[1]=vboxnetflt/ |
380 |
BUILT_MODULE_NAME[1]=vboxnetflt |
381 |
DEST_MODULE_LOCATION[2]=/kernel/3rdparty/vbox |
382 |
BUILT_MODULE_LOCATION[2]=vboxnetadp/ |
383 |
BUILT_MODULE_NAME[2]=vboxnetadp |
384 |
DEST_MODULE_LOCATION[3]=/kernel/3rdparty/vbox |
385 |
BUILT_MODULE_LOCATION[3]=vboxpci/ |
386 |
BUILT_MODULE_NAME[3]=vboxpci |
387 |
AUTOINSTALL=yes |
388 |
EOF |
389 |
|
390 |
# install udev rules |
391 |
mkdir -p %{buildroot}%{_udevrulesdir} |
392 |
cat > %{buildroot}%{_udevrulesdir}/%{name}.rules << EOF |
393 |
KERNEL=="%{kname}", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600" |
394 |
SUBSYSTEM=="usb_device", ACTION=="add", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass} vboxusers" |
395 |
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh \$major \$minor \$attr{bDeviceClass} vboxusers" |
396 |
SUBSYSTEM=="usb_device", ACTION=="remove", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh --remove \$major \$minor" |
397 |
SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN+="%{_datadir}/%{name}/VBoxCreateUSBNode.sh --remove \$major \$minor" |
398 |
EOF |
399 |
cat > %{buildroot}%{_udevrulesdir}/vbox-additions.rules << EOF |
400 |
KERNEL=="vboxguest", NAME="vboxguest", OWNER="root", MODE="0660" |
401 |
KERNEL=="vboxuser", NAME="vboxuser", OWNER="root", MODE="0666" |
402 |
EOF |
403 |
|
404 |
# install vboxweb |
405 |
install -m755 src/VBox/Installer/linux/vboxweb-service.sh %{buildroot}%{_initrddir}/vboxweb-service |
406 |
|
407 |
# install additions |
408 |
%if %{build_additions} |
409 |
# vboxadd-timesync should probably be renamed vboxadd now, but renaming initscripts |
410 |
# cleanly is hacky business |
411 |
install -D -m644 %{SOURCE3} %{buildroot}%{_unitdir}/vboxadd-timesync.service |
412 |
|
413 |
install -d %{buildroot}%{_sysconfdir}/X11/xinit.d |
414 |
install -m755 src/VBox/Additions/x11/Installer/98vboxadd-xclient %{buildroot}%{_sysconfdir}/X11/xinit.d |
415 |
|
416 |
pushd out/%{vbox_platform}/release/bin/additions |
417 |
install -d %{buildroot}/sbin %{buildroot}%{_sbindir} %{buildroot}/%{_libdir}/dri |
418 |
install -m755 mount.vboxsf %{buildroot}%{_sbindir}/mount.vboxsf |
419 |
install -m755 VBoxService %{buildroot}%{_sbindir} |
420 |
|
421 |
install -m755 VBoxClient %{buildroot}%{_bindir} |
422 |
install -m755 VBoxControl %{buildroot}%{_bindir} |
423 |
|
424 |
install -m755 VBoxOGL*.so %{buildroot}%{_libdir} |
425 |
|
426 |
%if %{build_vboxvideo} |
427 |
ln -s -f ../VBoxOGL.so %{buildroot}%{_libdir}/dri/vboxvideo_dri.so |
428 |
%endif |
429 |
|
430 |
install -d %{buildroot}%{_sysconfdir}/modprobe.preload.d |
431 |
cat > %{buildroot}%{_sysconfdir}/modprobe.preload.d/vbox-guest-additions << EOF |
432 |
vboxguest |
433 |
vboxsf |
434 |
EOF |
435 |
install -d %{buildroot}%{_libdir}/xorg/modules/{input,drivers} |
436 |
|
437 |
%if %{build_vboxvideo} |
438 |
install vboxvideo_drv_system.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so |
439 |
%endif |
440 |
|
441 |
mkdir -p %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release} |
442 |
cat > %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF |
443 |
PACKAGE_NAME=vboxadditions |
444 |
PACKAGE_VERSION=%{version}-%{release} |
445 |
MAKE[0]="'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxguest && |
446 |
cp \$dkms_tree/\$module/\$module_version/build/vboxguest/Module.symvers \$dkms_tree/\$module/\$module_version/build/vboxsf && |
447 |
'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxsf && |
448 |
cp \$dkms_tree/\$module/\$module_version/build/vboxsf/Module.symvers \$dkms_tree/\$module/\$module_version/build/vboxvideo && |
449 |
'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxvideo" |
450 |
EOF |
451 |
i=0 |
452 |
for kmod in vboxguest vboxsf vboxvideo; do |
453 |
mkdir -p %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/$kmod |
454 |
cp -a src/$kmod/* %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/$kmod/ |
455 |
cat >> %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF |
456 |
DEST_MODULE_LOCATION[$i]=/kernel/3rdparty/vbox |
457 |
BUILT_MODULE_LOCATION[$i]=$kmod/ |
458 |
BUILT_MODULE_NAME[$i]=$kmod |
459 |
EOF |
460 |
i=$((i+1)) |
461 |
done |
462 |
cat >> %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF |
463 |
CLEAN="'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxguest clean && |
464 |
'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxsf clean && |
465 |
'make' -j\${parallel_jobs} -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxvideo clean " |
466 |
AUTOINSTALL=yes |
467 |
EOF |
468 |
popd |
469 |
sed 's/^\(.package.*-kernel-\)\(.*-latest\)\(.*\)\\$/\1\2\3Obsoletes: vboxsf-kernel-\2 vboxvideo-kernel-\2\\n\\/' /etc/dkms/template-dkms-mkrpm.spec > %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/vboxadditions-dkms-mkrpm.spec |
470 |
%endif |
471 |
|
472 |
# desktop integration |
473 |
# |
474 |
# install icons |
475 |
mkdir -p %{buildroot}%{_iconsdir}/hicolor/{16x16,32x32,48x48,64x64,128x128}/{apps,mimetypes} |
476 |
pushd out/%{vbox_platform}/release/bin/icons/ |
477 |
for i in 16 32 48 64 128; do |
478 |
cp -a "$i"x"$i"/virtualbox.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/ |
479 |
cp -a "$i"x"$i"/virtualbox-*.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/mimetypes/ |
480 |
done |
481 |
popd |
482 |
|
483 |
# install menu entries |
484 |
|
485 |
mkdir -p %{buildroot}%{_datadir}/applications |
486 |
cat > %{buildroot}%{_datadir}/applications/mageia-%{name}.desktop << EOF |
487 |
[Desktop Entry] |
488 |
Name=VirtualBox |
489 |
GenericName=Virtual Machine |
490 |
GenericName[de]=Virtuelle Maschine |
491 |
GenericName[ru]=Виртуальная машина |
492 |
Comment=Run several virtual systems on a single host computer |
493 |
Comment[de]=Verschiedene virtuelle Systeme auf einem Hostrechner laufen lassen |
494 |
Comment[it]=Esegue diversi sistemi virtuali su un singolo computer |
495 |
Comment[pl]=Uruchamianie wielu systemów wirtualnych na jednym komputerze gospodarza |
496 |
Comment[sv]=Kör flera virtuella system på en enda värddator |
497 |
Comment[ko]=단일 호스트 컴퓨터에 여러 개의 가상 시스템 실행 |
498 |
Comment[ru]=Управление несколькими виртуальными системами на одном главном компьютере |
499 |
Comment[af]=Loop verskeie virtuele stelsels op 'n enkele gasheerrekenaar |
500 |
Comment[sq]=Nis dis sisteme në një kompjuter të vetëm mbartës |
501 |
Comment[ast]=Execute varios sistemes virtuales nun sólu equipu anfitrión |
502 |
Comment[bn]=একটি একক হোস্ট কম্পিউটারে একাধিক ভার্চুয়াল সিস্টেম চালান |
503 |
Comment[bg]=Изпълнение на няколко виртуални системи на един компютър |
504 |
Comment[bs]=Pokrenite više virtuelnih sistema na jednom domaćinskom računaru |
505 |
Comment[pt_BR]=Execute vários sistemas virtuais em um único computador hospedeiro |
506 |
Comment[ca]=Executeu diversos sistemes virtuals en un únic ordinador hoste |
507 |
Comment[ca@valencia]=Executeu diversos sistemes virtuals en un únic ordinador hoste |
508 |
Comment[zh_HK]=於單一主機電腦執行多個虛擬機器 |
509 |
Comment[zh_CN]=在一个主机上运行多个虚拟系统 |
510 |
Comment[zh_TW]=於單一主機電腦執行多個虛擬機器 |
511 |
Comment[crh]=Tek bir bilgisayar üzerinde birden fazla sanal işletim sistemi çalıştırın |
512 |
Comment[cs]=Spouštění různých virtuálních systémů na hostitelském počítači |
513 |
Comment[da]=Kør flere virtuelle maskiner på en enkelt computer |
514 |
Comment[fi]=Suorita useita virtuaalisia järjestelmiä yhdellä isäntäkoneella |
515 |
Comment[et]=Käivita mitmeid virtuaalseid süsteeme ühel peaarvutil |
516 |
Comment[nl]=Draai verschillende virtuele systemen op één enkele hostcomputer |
517 |
Comment[gl]=Execute varios sistemas virtuais nun único computador |
518 |
Comment[fr]=Exécuter plusieurs systèmes virtuels sur le même ordinateur hôte |
519 |
Comment[el]=Χρήση πολλαπλών εικονικών συστημάτων από έναν υπολογιστή |
520 |
Comment[hu]=Több virtuális rendszer futtatása egy számítógépen |
521 |
Comment[ky]=Бир негизги компьютерде бир нече виртуалдык тутумдарды жүргүзүү |
522 |
Comment[ja]=一つのホストコンピューター上で複数の仮想システムを走らせます |
523 |
Comment[lt]=Leiskite kelias virtualias sistemas viename kompiuteryje |
524 |
Comment[ms]=Jalankan beberapa sistem maya dalam satu komputer hos |
525 |
Comment[oc]=Executar mantun sistèma virtuals sul meteis ordenador òste |
526 |
Comment[nb]=Kjør opptil flere virtuelle systemer på én vertsmaskin |
527 |
Comment[pt]=Corra diversos sistemas virtuais num único computador |
528 |
Comment[ro]=Rulați mai multe sisteme virtuale pe calculatorul gazdă |
529 |
Comment[sl]=Zagon več navideznih sistemov na enem gostiteljskem računalniku |
530 |
Comment[es]=Ejecute varios sistemas virtuales en un sólo equipo anfitrión |
531 |
Comment[vi]=Chạy nhiều hệ thống ảo trên một máy chủ đơn |
532 |
Comment[uk]=Запуск декількох віртуальних систем на одному базовому комп'ютері |
533 |
Comment[tr]=Tek bir bilgisayar üzerinde birden fazla sanal işletim sistemi çalıştırın |
534 |
Exec=%{oname} %U |
535 |
Icon=%{name} |
536 |
Type=Application |
537 |
Terminal=false |
538 |
Categories=Emulator; |
539 |
MimeType=application/x-virtualbox-vbox;application/x-virtualbox-vbox-extpack;application/x-virtualbox-ovf;application/x-virtualbox-ova; |
540 |
EOF |
541 |
|
542 |
# install mime types |
543 |
install -D -m644 out/%{vbox_platform}/release/bin/virtualbox.xml %{buildroot}%{_datadir}/mime/packages/virtualbox.xml |
544 |
|
545 |
|
546 |
# add missing makefile for kernel module |
547 |
install -m644 src/VBox/HostDrivers/Support/linux/Makefile %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ |
548 |
|
549 |
%if %{build_sdk} |
550 |
mkdir -p %{buildroot}%{vboxpydir} |
551 |
|
552 |
pushd out/%{vbox_platform}/release/bin/sdk/installer |
553 |
VBOX_INSTALL_PATH=%{vboxlibdir} \ |
554 |
python vboxapisetup.py install --prefix %{_prefix} --root %{buildroot} |
555 |
popd |
556 |
rm -rf %{buildroot}%{vboxlibdir}/sdk/installer |
557 |
%else |
558 |
rm -rf %{buildroot}%{vboxlibdir}/sdk |
559 |
%endif |
560 |
|
561 |
# remove unpackaged files |
562 |
rm -rf %{buildroot}%{vboxlibdir}/{src,testcase} |
563 |
rm -f %{buildroot}%{vboxlibdir}/tst* |
564 |
rm -f %{buildroot}%{vboxlibdir}/vboxkeyboard.tar.gz |
565 |
rm -f %{buildroot}%{vboxlibdir}/SUP* |
566 |
rm -f %{buildroot}%{vboxlibdir}/xpidl |
567 |
|
568 |
# install PAM module: |
569 |
install -D -m755 out/%{vbox_platform}/release/bin/additions/pam_vbox.so %{buildroot}/%{_lib}/security/pam_vbox.so |
570 |
|
571 |
# install the user manual |
572 |
%if %build_doc |
573 |
install -D -m644 out/%{vbox_platform}/release/bin/UserManual.pdf %{buildroot}/%{_defaultdocdir}/%{name}/UserManual.pdf |
574 |
rm -f %{buildroot}%{vboxlibdir}/UserManual.pdf |
575 |
%endif |
576 |
|
577 |
%post |
578 |
%_tmpfilescreate %{name} |
579 |
%_post_service %{name} |
580 |
|
581 |
%_add_group_helper %{name} 1 vboxusers |
582 |
|
583 |
|
584 |
# (Debian) Build usb device tree |
585 |
for i in /sys/bus/usb/devices/*; do |
586 |
if test -r "$i/dev"; then |
587 |
dev="`cat "$i/dev" 2> /dev/null || true`" |
588 |
major="`expr "$dev" : '\(.*\):' 2> /dev/null || true`" |
589 |
minor="`expr "$dev" : '.*:\(.*\)' 2> /dev/null || true`" |
590 |
class="`cat $i/bDeviceClass 2> /dev/null || true`" |
591 |
/usr/share/virtualbox/VBoxCreateUSBNode.sh "$major" "$minor" "$class" vboxusers 2>/dev/null || true |
592 |
fi |
593 |
done |
594 |
|
595 |
%postun |
596 |
if [ "$1" -ge "1" ]; then |
597 |
/sbin/service %{name} condrestart > /dev/null 2>&1 || : |
598 |
fi |
599 |
|
600 |
%_del_group_helper %{name} 1 vboxusers |
601 |
|
602 |
%preun |
603 |
%_preun_service %{name} |
604 |
|
605 |
%post -n dkms-%{name} |
606 |
set -x |
607 |
/usr/sbin/dkms --rpm_safe_upgrade add -m %{name} -v %{version}-%{release} && |
608 |
/usr/sbin/dkms --rpm_safe_upgrade build -m %{name} -v %{version}-%{release} && |
609 |
/usr/sbin/dkms --rpm_safe_upgrade install -m %{name} -v %{version}-%{release} && |
610 |
/sbin/rmmod vboxpci &>/dev/null |
611 |
/sbin/rmmod vboxnetflt &>/dev/null |
612 |
/sbin/rmmod vboxnetadp &>/dev/null |
613 |
/sbin/rmmod %{kname} &>/dev/null |
614 |
/sbin/modprobe %{kname} &>/dev/null |
615 |
/sbin/modprobe vboxnetflt &>/dev/null |
616 |
/sbin/modprobe vboxnetadp &>/dev/null |
617 |
/sbin/modprobe vboxpci &>/dev/null |
618 |
: |
619 |
|
620 |
%preun -n dkms-%{name} |
621 |
if [ "$1" = "0" ]; then |
622 |
/sbin/rmmod vboxpci >/dev/null 2>&1 |
623 |
/sbin/rmmod vboxnetadp >/dev/null 2>&1 |
624 |
/sbin/rmmod vboxnetflt >/dev/null 2>&1 |
625 |
/sbin/rmmod %{kname} >/dev/null 2>&1 |
626 |
fi |
627 |
set -x |
628 |
/usr/sbin/dkms --rpm_safe_upgrade remove -m %{name} -v %{version}-%{release} --all || : |
629 |
|
630 |
%if %{build_additions} |
631 |
%post guest-additions |
632 |
%_post_service vboxadd-timesync |
633 |
|
634 |
%_add_group_helper %{name} 1 vboxsf |
635 |
|
636 |
%preun guest-additions |
637 |
%_preun_service vboxadd-timesync |
638 |
|
639 |
%postun guest-additions |
640 |
%_del_group_helper %{name} 1 vboxsf |
641 |
|
642 |
%post -n dkms-vboxadditions |
643 |
set -x |
644 |
/usr/sbin/dkms --rpm_safe_upgrade add -m vboxadditions -v %{version}-%{release} && |
645 |
/usr/sbin/dkms --rpm_safe_upgrade build -m vboxadditions -v %{version}-%{release} && |
646 |
/usr/sbin/dkms --rpm_safe_upgrade install -m vboxadditions -v %{version}-%{release} |
647 |
: |
648 |
|
649 |
%preun -n dkms-vboxadditions |
650 |
set -x |
651 |
/usr/sbin/dkms --rpm_safe_upgrade remove -m vboxadditions -v %{version}-%{release} --all |
652 |
: |
653 |
|
654 |
%endif |
655 |
|
656 |
%files |
657 |
%config %{_sysconfdir}/vbox/vbox.cfg |
658 |
%{_bindir}/%{oname} |
659 |
%{_bindir}/VBoxManage |
660 |
%{_bindir}/VBoxSDL |
661 |
%{_bindir}/VBoxHeadless |
662 |
%{_bindir}/VBoxTunctl |
663 |
%{_bindir}/VBoxNetAdpCtl |
664 |
%{_bindir}/VBoxNetDHCP |
665 |
%{_bindir}/vboxwebsrv |
666 |
%exclude %{vboxlibdir}/sdk |
667 |
%dir %{vboxlibdir} |
668 |
%{vboxlibdir}/* |
669 |
%attr(4711,root,root) %{vboxlibdir}/VBoxHeadless |
670 |
%attr(4711,root,root) %{vboxlibdir}/VBoxSDL |
671 |
%attr(4711,root,root) %{vboxlibdir}/VirtualBox |
672 |
%attr(4711,root,root) %{vboxlibdir}/VBoxNetAdpCtl |
673 |
%attr(4711,root,root) %{vboxlibdir}/VBoxNetDHCP |
674 |
%attr(644,root,root) %{vboxlibdir}/*.rc |
675 |
%attr(644,root,root) %{vboxlibdir}/*.r0 |
676 |
%dir %{vboxdatadir} |
677 |
%{vboxdatadir}/* |
678 |
# initscripts integration |
679 |
%{_initrddir}/%{name} |
680 |
%{_initrddir}/vboxweb-service |
681 |
%{_udevrulesdir}/%{name}.rules |
682 |
%{_tmpfilesdir}/%{name}.conf |
683 |
# desktop integration |
684 |
%{_datadir}/icons/hicolor/*/*/*.png |
685 |
%{_datadir}/applications/mageia-%{name}.desktop |
686 |
%{_datadir}/mime/packages/virtualbox.xml |
687 |
|
688 |
%files -n dkms-%{name} |
689 |
%{_usr}/src/%{name}-%{version}-%{release} |
690 |
|
691 |
%if %{build_additions} |
692 |
%files guest-additions |
693 |
/%{_lib}/security/pam_vbox.so |
694 |
%{_sbindir}/mount.vboxsf |
695 |
%{_unitdir}/vboxadd-timesync.service |
696 |
%{_sbindir}/VBoxService |
697 |
%{_bindir}/VBoxClient |
698 |
%{_bindir}/VBoxControl |
699 |
%{_udevrulesdir}/vbox-additions.rules |
700 |
%{_sysconfdir}/X11/xinit.d/98vboxadd-xclient |
701 |
%{_sysconfdir}/modprobe.preload.d/vbox-guest-additions |
702 |
|
703 |
%files -n x11-driver-video-vboxvideo |
704 |
%{_libdir}/VBoxOGL* |
705 |
%if %{build_vboxvideo} |
706 |
%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so |
707 |
%{_libdir}/dri/vboxvideo_dri.so |
708 |
%endif |
709 |
|
710 |
%files -n dkms-vboxadditions |
711 |
%{_usr}/src/vbox*-%{version}-%{release} |
712 |
%endif |
713 |
|
714 |
%if %build_doc |
715 |
%files doc |
716 |
%doc %{_defaultdocdir}/%{name}/UserManual.pdf |
717 |
%endif |
718 |
|
719 |
%if %{build_sdk} |
720 |
%files devel |
721 |
%dir %{vboxlibdir}/sdk |
722 |
%{vboxlibdir}/sdk/* |
723 |
|
724 |
%files -n python-%{name} |
725 |
%{vboxpydir} |
726 |
%{py_puresitedir}/vboxapi*.egg-info |
727 |
%endif |