1 |
ahmad |
1459 |
%define ver 4.0.0 |
2 |
|
|
%define rel 2 |
3 |
|
|
%define version %{ver}%{?svndate:.%{svndate}} |
4 |
|
|
%define release %mkrel %{rel} |
5 |
|
|
%define kname vboxdrv |
6 |
|
|
%define oname VirtualBox |
7 |
|
|
%define srcname %{oname}-%{version} |
8 |
|
|
%define distname %{oname}-%{version}_OSE |
9 |
|
|
%define dirname vbox-ose |
10 |
|
|
%define pkgver %{ver}%{?svndate:-%{svndate}} |
11 |
|
|
|
12 |
|
|
%define vboxlibdir %{_libdir}/%{name} |
13 |
|
|
%define vboxdatadir %{_datadir}/%{name} |
14 |
|
|
|
15 |
|
|
%define build_additions 1 |
16 |
|
|
%define build_doc 1 |
17 |
|
|
|
18 |
|
|
%ifarch %{ix86} |
19 |
|
|
%define vbox_platform linux.x86 |
20 |
|
|
%endif |
21 |
|
|
%ifarch x86_64 |
22 |
|
|
%define vbox_platform linux.amd64 |
23 |
|
|
%endif |
24 |
|
|
|
25 |
|
|
# nuke vbox-specific dependencies |
26 |
|
|
%define _provides_exceptions ^VBox |
27 |
|
|
%define _requires_exceptions ^VBox |
28 |
|
|
|
29 |
|
|
%define x11_server_majorver %(pkg-config --modversion xorg-server|awk -F. '{print $1$2}') |
30 |
|
|
|
31 |
|
|
Summary: A general-purpose full virtualizer for x86 hardware |
32 |
|
|
Name: virtualbox |
33 |
|
|
Version: %{version} |
34 |
|
|
Release: %{release} |
35 |
|
|
Source0: http://download.virtualbox.org/virtualbox/%ver/%{srcname}.tar.bz2 |
36 |
|
|
Source2: virtualbox.init |
37 |
|
|
Source4: 60-vboxadd.perms |
38 |
|
|
Source10: virtualbox.png |
39 |
|
|
Source11: virtualbox.16.png |
40 |
|
|
Source12: virtualbox.48.png |
41 |
|
|
Patch1: VirtualBox-libpath.patch |
42 |
|
|
Patch2: VirtualBox-1.5.6_OSE-kernelrelease.patch |
43 |
|
|
Patch4: VirtualBox-1.6.0_OSE-futex.patch |
44 |
|
|
Patch5: virtualbox-fix-vboxadd-req.patch |
45 |
|
|
# (fc) 1.6.0-2mdv fix initscript name in VBox.sh script |
46 |
|
|
Patch6: VirtualBox-1.6.0_OSE-initscriptname.patch |
47 |
|
|
# (fc) 2.0.0-2mdv fix QT4 detection on x86-64 on Mdv 2008.1 |
48 |
|
|
Patch7: VirtualBox-2.0.0-mdv20081.patch |
49 |
|
|
# (hk) fix build kernel-headers-2.6.29* |
50 |
|
|
Patch10: VirtualBox-kernel-headers-2.6.29.patch |
51 |
|
|
# (fc) 2.2.0-1mdv disable update notification (Debian) |
52 |
|
|
Patch12: 16-no-update.patch |
53 |
|
|
Patch16: virtualbox-default-to-mandriva.patch |
54 |
|
|
|
55 |
|
|
# use courier font instead of beramono for older releases where beramono isn't |
56 |
|
|
# available in tetex-latex (it's available since only tetex-latex-3.0-53mdv2011.0) |
57 |
|
|
Patch17: virtualbox-4.0.0-user-courier-instead-of-beramono.patch |
58 |
|
|
# don't check for: |
59 |
|
|
# mkisofs: we're not going to build the additions .iso file |
60 |
|
|
# makeself: we're not going to create the stanalone .run installers |
61 |
|
|
Patch18: virtualbox-4.0.0-dont-check-for-mkisofs-or-makeself.patch |
62 |
|
|
|
63 |
|
|
License: GPLv2 |
64 |
|
|
Group: Emulators |
65 |
|
|
Url: http://www.virtualbox.org/ |
66 |
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
67 |
|
|
ExclusiveArch: %{ix86} x86_64 |
68 |
|
|
Requires(post): rpm-helper |
69 |
|
|
Requires(preun): rpm-helper |
70 |
|
|
Requires(postun): rpm-helper |
71 |
|
|
%if %{mdkversion} >= 200800 |
72 |
|
|
Requires: kmod(vboxdrv) = %{version} |
73 |
|
|
%else |
74 |
|
|
Requires: dkms-%{name} = %{version}-%{release} |
75 |
|
|
%endif |
76 |
|
|
Conflicts: dkms-%{name} <= 1.5.0-%{mkrel 4} |
77 |
|
|
Suggests: %{name}-doc |
78 |
|
|
BuildRequires: dev86, iasl |
79 |
|
|
BuildRequires: zlib-devel |
80 |
|
|
%if %{mdkversion} >= 200700 |
81 |
|
|
BuildRequires: libxcursor-devel |
82 |
|
|
BuildRequires: libxmu-devel |
83 |
|
|
%else |
84 |
|
|
BuildRequires: X11-devel |
85 |
|
|
%endif |
86 |
|
|
BuildRequires: SDL-devel, libqt4-devel >= 4.4.0 |
87 |
|
|
BuildRequires: qt4-linguist |
88 |
|
|
BuildRequires: libIDL-devel, libext2fs-devel |
89 |
|
|
BuildRequires: libxslt-proc, libxslt-devel |
90 |
|
|
BuildRequires: hal-devel, libxt-devel, libstdc++-static-devel |
91 |
|
|
BuildRequires: python-devel |
92 |
|
|
BuildRequires: libcap-devel |
93 |
|
|
BuildRequires: libxrandr-devel libxinerama-devel |
94 |
|
|
%if %{mdkversion} >= 200810 |
95 |
|
|
BuildRequires: pulseaudio-devel |
96 |
|
|
%endif |
97 |
|
|
%if %{mdkversion} >= 200800 |
98 |
|
|
BuildRequires: kernel-devel-latest |
99 |
|
|
%else |
100 |
|
|
BuildRequires: kernel-source |
101 |
|
|
%endif |
102 |
|
|
BuildRequires: mesaglu-devel mesagl-devel libxmu-devel |
103 |
|
|
BuildRequires: gsoap |
104 |
|
|
BuildRequires: openssl-devel |
105 |
|
|
BuildRequires: curl-devel |
106 |
|
|
BuildRequires: dkms-minimal |
107 |
|
|
BuildRequires: libpam-devel |
108 |
|
|
BuildRequires: gawk |
109 |
|
|
BuildRequires: x11-server-devel |
110 |
|
|
BuildRequires: java-rpmbuild |
111 |
|
|
%if %build_doc |
112 |
|
|
# for building the user manual pdf file |
113 |
|
|
%if %{mdvver} < 201100 |
114 |
|
|
BuildRequires: tetex-latex |
115 |
|
|
%else |
116 |
|
|
BuildRequires: tetex-latex >= 3.0-53 |
117 |
|
|
%endif |
118 |
|
|
%endif |
119 |
|
|
BuildRequires: libxslt-devel |
120 |
|
|
|
121 |
|
|
%description |
122 |
|
|
VirtualBox Open Source Edition (OSE) is a general-purpose full |
123 |
|
|
virtualizer for x86 hardware. |
124 |
|
|
|
125 |
|
|
%package -n dkms-%{name} |
126 |
|
|
Summary: VirtualBox OSE kernel module |
127 |
|
|
Group: System/Kernel and hardware |
128 |
|
|
Requires(post): dkms |
129 |
|
|
Requires(preun): dkms |
130 |
|
|
Conflicts: dkms-vboxadditions |
131 |
|
|
|
132 |
|
|
%description -n dkms-%{name} |
133 |
|
|
Kernel support for VirtualBox OSE. |
134 |
|
|
|
135 |
|
|
%if %{build_additions} |
136 |
|
|
%package guest-additions |
137 |
|
|
Summary: Additions for VirtualBox OSE guest systems |
138 |
|
|
Group: Emulators |
139 |
|
|
%if %{mdkversion} >= 200800 |
140 |
|
|
Requires: kmod(vboxguest) |
141 |
|
|
Requires: kmod(vboxsf) |
142 |
|
|
Requires: kmod(vboxvideo) |
143 |
|
|
%else |
144 |
|
|
Requires: dkms-vboxadditions = %{version}-%{release} |
145 |
|
|
%endif |
146 |
|
|
Requires: x11-driver-input-vboxmouse |
147 |
|
|
Requires: x11-driver-video-vboxvideo |
148 |
|
|
Requires(post): rpm-helper |
149 |
|
|
Requires(preun): rpm-helper |
150 |
|
|
|
151 |
|
|
%description guest-additions |
152 |
|
|
This packages contains additions for VirtualBox OSE guest systems. |
153 |
|
|
It allows to share files with the host system, copy/paste between |
154 |
|
|
guest and host, and sync time with host. |
155 |
|
|
|
156 |
|
|
%package -n dkms-vboxadditions |
157 |
|
|
Summary: Kernel module for VirtualBox OSE additions |
158 |
|
|
Group: System/Kernel and hardware |
159 |
|
|
Requires(post): dkms |
160 |
|
|
Requires(preun): dkms |
161 |
|
|
Obsoletes: dkms-vboxadd < %{version}-%{release} |
162 |
|
|
Provides: dkms-vboxvfs = %{version}-%{release} |
163 |
|
|
Obsoletes: dkms-vboxvfs < %{version}-%{release} |
164 |
|
|
Provides: dkms-vboxsf = %{version}-%{release} |
165 |
|
|
Obsoletes: dkms-vboxsf < %{version}-%{release} |
166 |
|
|
Provides: dkms-vboxvideo = %{version}-%{release} |
167 |
|
|
Obsoletes: dkms-vboxvideo < %{version}-%{release} |
168 |
|
|
Conflicts: dkms-%{name} |
169 |
|
|
|
170 |
|
|
%description -n dkms-vboxadditions |
171 |
|
|
Kernel module for VirtualBox OSE additions. |
172 |
|
|
|
173 |
|
|
%package -n x11-driver-input-vboxmouse |
174 |
|
|
Summary: The X.org driver for mouse in VirtualBox guests |
175 |
|
|
Group: System/X11 |
176 |
|
|
Suggests: virtualbox-guest-additions |
177 |
|
|
Requires: x11-server-common %(xserver-sdk-abi-requires xinput) |
178 |
|
|
|
179 |
|
|
%description -n x11-driver-input-vboxmouse |
180 |
|
|
The X.org driver for mouse in VirtualBox guests |
181 |
|
|
|
182 |
|
|
%package -n x11-driver-video-vboxvideo |
183 |
|
|
Summary: The X.org driver for video in VirtualBox guests |
184 |
|
|
Group: System/X11 |
185 |
|
|
Suggests: virtualbox-guest-additions |
186 |
|
|
Conflicts: virtualbox-guest-additions < 2.2.0-2mdv |
187 |
|
|
Requires: x11-server-common %(xserver-sdk-abi-requires videodrv) |
188 |
|
|
|
189 |
|
|
|
190 |
|
|
%description -n x11-driver-video-vboxvideo |
191 |
|
|
The X.org driver for video in VirtualBox guests |
192 |
|
|
%endif |
193 |
|
|
|
194 |
|
|
%if %build_doc |
195 |
|
|
%package doc |
196 |
|
|
Summary: The user manual PDF file for %{name} |
197 |
|
|
Group: System/X11 |
198 |
|
|
|
199 |
|
|
%description doc |
200 |
|
|
This package contains the user manual PDF file for %{name}. |
201 |
|
|
%endif |
202 |
|
|
|
203 |
|
|
%prep |
204 |
|
|
%setup -q -n %{distname} |
205 |
|
|
%patch1 -p1 -b .libpath-3.2.6 |
206 |
|
|
%patch2 -p1 -b .kernelrelease |
207 |
|
|
%patch4 -p1 -b .futex |
208 |
|
|
%patch5 -p1 -b .fix-timesync-req |
209 |
|
|
%patch6 -p1 -b .initscriptname |
210 |
|
|
%if %{mdkversion} < 200900 |
211 |
|
|
%patch7 -p1 -b .mdv20081 |
212 |
|
|
%endif |
213 |
|
|
%patch10 -p1 -b .kernel-headers-2.6.29 |
214 |
|
|
%patch12 -p1 -b .disable-update |
215 |
|
|
%patch16 -p1 -b .default-to-mandriva |
216 |
|
|
|
217 |
|
|
%if %build_doc |
218 |
|
|
%if %{mdvver} < 201100 |
219 |
|
|
%patch17 -p1 -b .courier |
220 |
|
|
%endif |
221 |
|
|
%endif |
222 |
|
|
|
223 |
|
|
%patch18 -p1 -b .mkisofs-makeself |
224 |
|
|
|
225 |
|
|
rm -rf fake-linux/ |
226 |
|
|
cp -a $(ls -1dtr /usr/src/linux-* | tail -n 1) fake-linux |
227 |
|
|
|
228 |
|
|
cat << EOF > LocalConfig.kmk |
229 |
|
|
VBOX_PATH_APP_PRIVATE_ARCH:=%{vboxlibdir} |
230 |
|
|
VBOX_WITH_ORIGIN:= |
231 |
|
|
VBOX_WITH_RUNPATH:=%{vboxlibdir} |
232 |
|
|
VBOX_PATH_APP_PRIVATE:=%{vboxdatadir} |
233 |
|
|
VBOX_WITH_TESTCASES = |
234 |
|
|
VBOX_WITH_TESTSUITE:= |
235 |
|
|
VBOX_JAVA_HOME := %{java_home} |
236 |
|
|
VBOX_WITHOUT_ADDITIONS_ISO := 1 |
237 |
|
|
EOF |
238 |
|
|
|
239 |
|
|
%build |
240 |
|
|
#make -C fake-linux prepare |
241 |
|
|
export LIBPATH_LIB="%{_lib}" |
242 |
|
|
./configure --enable-webservice \ |
243 |
|
|
--with-linux=$PWD/fake-linux \ |
244 |
|
|
%if %{mdkversion} <= 200800 |
245 |
|
|
--disable-pulse \ |
246 |
|
|
%endif |
247 |
|
|
%if ! %build_doc |
248 |
|
|
--disable-docs |
249 |
|
|
%endif |
250 |
|
|
|
251 |
|
|
%if !%{build_additions} |
252 |
|
|
sed -rie 's/(VBOX_WITH_LINUX_ADDITIONS\s+:=\s+).*/\1/' AutoConfig.kmk |
253 |
|
|
echo VBOX_WITHOUT_ADDITIONS=1 >> LocalConfig.kmk |
254 |
|
|
%endif |
255 |
|
|
|
256 |
|
|
. ./env.sh |
257 |
|
|
kmk %_smp_mflags all |
258 |
|
|
|
259 |
|
|
%install |
260 |
|
|
rm -rf %{buildroot} |
261 |
|
|
|
262 |
|
|
# install vbox components |
263 |
|
|
mkdir -p %{buildroot}%{vboxlibdir} %{buildroot}%{vboxdatadir} |
264 |
|
|
|
265 |
|
|
(cd out/%{vbox_platform}/release/bin && tar cf - --exclude=additions .) | \ |
266 |
|
|
(cd %{buildroot}%{vboxlibdir} && tar xf -) |
267 |
|
|
|
268 |
|
|
# move noarch files to vboxdatadir |
269 |
|
|
mv %{buildroot}%{vboxlibdir}/{VBox*.sh,nls,*.desktop,*.png} %{buildroot}%{vboxdatadir} |
270 |
|
|
|
271 |
|
|
# install service |
272 |
|
|
mkdir -p %{buildroot}%{_initrddir} |
273 |
|
|
install -m755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name} |
274 |
|
|
|
275 |
|
|
# install wrappers |
276 |
|
|
mkdir -p %{buildroot}%{_sysconfdir}/vbox |
277 |
|
|
cat > %{buildroot}%{_sysconfdir}/vbox/vbox.cfg << EOF |
278 |
|
|
# VirtualBox installation directory |
279 |
|
|
INSTALL_DIR="%{vboxlibdir}" |
280 |
|
|
EOF |
281 |
|
|
mkdir -p %{buildroot}%{_bindir} |
282 |
|
|
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/%{oname} |
283 |
|
|
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxManage |
284 |
|
|
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxSDL |
285 |
|
|
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/VBoxHeadless |
286 |
|
|
ln -s %{vboxdatadir}/VBox.sh %{buildroot}%{_bindir}/vboxwebsrv |
287 |
|
|
|
288 |
|
|
# provide network control tools in bindir |
289 |
|
|
ln -s %{vboxlibdir}/VBoxTunctl %{buildroot}%{_bindir}/VBoxTunctl |
290 |
|
|
ln -s %{vboxlibdir}/VBoxNetAdpCtl %{buildroot}%{_bindir}/VBoxNetAdpCtl |
291 |
|
|
ln -s %{vboxlibdir}/VBoxNetDHCP %{buildroot}%{_bindir}/VBoxNetDHCP |
292 |
|
|
|
293 |
|
|
install -d %{buildroot}/var/run/%{oname} |
294 |
|
|
|
295 |
|
|
# install dkms sources |
296 |
|
|
mkdir -p %{buildroot}%{_usr}/src/%{name}-%{version}-%{release} |
297 |
|
|
cat > vboxbuild << EOF |
298 |
|
|
#!/bin/sh |
299 |
|
|
set -e |
300 |
|
|
make -C %{kname} KERN_DIR=\$1 |
301 |
|
|
cp -f %{kname}/Module.symvers vboxnetflt |
302 |
|
|
cp -f %{kname}/Module.symvers vboxnetadp |
303 |
|
|
make -C vboxnetflt KERN_DIR=\$1 |
304 |
|
|
make -C vboxnetadp KERN_DIR=\$1 |
305 |
|
|
EOF |
306 |
|
|
install -m 0755 vboxbuild %{buildroot}%{_usr}/src/%{name}-%{version}-%{release} |
307 |
|
|
mv %{buildroot}%{vboxlibdir}/src/* %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ |
308 |
|
|
cat > %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/dkms.conf << EOF |
309 |
|
|
MAKE[0]="./vboxbuild \$kernel_source_dir" |
310 |
|
|
PACKAGE_NAME=%{name} |
311 |
|
|
PACKAGE_VERSION=%{version}-%{release} |
312 |
|
|
DEST_MODULE_LOCATION[0]=/kernel/3rdparty/vbox |
313 |
|
|
BUILT_MODULE_LOCATION[0]=%{kname}/ |
314 |
|
|
BUILT_MODULE_NAME[0]=%{kname} |
315 |
|
|
DEST_MODULE_LOCATION[1]=/kernel/3rdparty/vbox |
316 |
|
|
BUILT_MODULE_LOCATION[1]=vboxnetflt/ |
317 |
|
|
BUILT_MODULE_NAME[1]=vboxnetflt |
318 |
|
|
DEST_MODULE_LOCATION[2]=/kernel/3rdparty/vbox |
319 |
|
|
BUILT_MODULE_LOCATION[2]=vboxnetadp/ |
320 |
|
|
BUILT_MODULE_NAME[2]=vboxnetadp |
321 |
|
|
AUTOINSTALL=yes |
322 |
|
|
EOF |
323 |
|
|
|
324 |
|
|
# install udev rules |
325 |
|
|
mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d/ |
326 |
|
|
cat > %{buildroot}%{_sysconfdir}/udev/rules.d/%{name}.rules << EOF |
327 |
|
|
KERNEL=="%{kname}", MODE="0600" |
328 |
|
|
EOF |
329 |
|
|
cat > %{buildroot}%{_sysconfdir}/udev/rules.d/vbox-additions.rules << EOF |
330 |
|
|
KERNEL=="vboxguest", NAME="vboxguest", OWNER="root", MODE="0660" |
331 |
|
|
KERNEL=="vboxuser", NAME="vboxuser", OWNER="root", MODE="0666" |
332 |
|
|
EOF |
333 |
|
|
|
334 |
|
|
# install additions |
335 |
|
|
%if %{build_additions} |
336 |
|
|
# vboxadd-timesync should probably be renamed vboxadd now, but renaming initscripts |
337 |
|
|
# cleanly is hacky business |
338 |
|
|
install -m755 src/VBox/Additions/linux/installer/vboxadd-service.sh %{buildroot}%{_initrddir}/vboxadd-timesync |
339 |
|
|
|
340 |
|
|
# install .fdi file for releases older than 2011.0; and the udev rule and |
341 |
|
|
# 50-vboxmouse.conf for newer releases with Xserver >= 1.9 |
342 |
|
|
%if %{mdvver} < 201100 |
343 |
|
|
install -D -m644 src/VBox/Additions/linux/installer/90-vboxguest.fdi %{buildroot}%{_datadir}/hal/fdi/policy/20thirdparty/90-vboxguest.fdi |
344 |
|
|
%else |
345 |
|
|
install -m644 src/VBox/Additions/linux/installer/70-xorg-vboxmouse.rules %{buildroot}%{_sysconfdir}/udev/rules.d/ |
346 |
|
|
install -D -m644 src/VBox/Additions/x11/Installer/50-vboxmouse.conf %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/50-vboxmouse.conf |
347 |
|
|
%endif |
348 |
|
|
|
349 |
|
|
install -d %{buildroot}%{_sysconfdir}/X11/xinit.d |
350 |
|
|
install -m755 src/VBox/Additions/x11/Installer/98vboxadd-xclient %{buildroot}%{_sysconfdir}/X11/xinit.d |
351 |
|
|
|
352 |
|
|
pushd out/%{vbox_platform}/release/bin/additions |
353 |
|
|
install -d %{buildroot}/sbin %{buildroot}%{_sbindir} %{buildroot}/%{_libdir}/dri |
354 |
|
|
install -m755 mount.vboxsf %{buildroot}/sbin/mount.vboxsf |
355 |
|
|
install -m755 VBoxService %{buildroot}%{_sbindir} |
356 |
|
|
|
357 |
|
|
%if %{mdkversion} <= 200910 |
358 |
|
|
install -d %{buildroot}%{_sysconfdir}/security/console.perms.d/ |
359 |
|
|
install -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/security/console.perms.d/ |
360 |
|
|
%endif |
361 |
|
|
|
362 |
|
|
install -m755 VBoxClient %{buildroot}%{_bindir} |
363 |
|
|
install -m755 VBoxControl %{buildroot}%{_bindir} |
364 |
|
|
|
365 |
|
|
install -m755 VBoxOGL*.so %{buildroot}%{_libdir} |
366 |
|
|
ln -s -f ../VBoxOGL.so %{buildroot}%{_libdir}/dri/vboxvideo_dri.so |
367 |
|
|
|
368 |
|
|
install -d %{buildroot}%{_sysconfdir}/modprobe.preload.d |
369 |
|
|
cat > %{buildroot}%{_sysconfdir}/modprobe.preload.d/vbox-guest-additions << EOF |
370 |
|
|
vboxguest |
371 |
|
|
EOF |
372 |
|
|
install -d %{buildroot}%{_libdir}/xorg/modules/{input,drivers} |
373 |
|
|
%if %{mdkversion} >= 200810 |
374 |
|
|
install vboxmouse_drv_%{x11_server_majorver}.so %{buildroot}%{_libdir}/xorg/modules/input/vboxmouse_drv.so |
375 |
|
|
install vboxvideo_drv_%{x11_server_majorver}.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so |
376 |
|
|
%else |
377 |
|
|
install vboxmouse_drv_71.so %{buildroot}%{_libdir}/xorg/modules/input/vboxmouse_drv.so |
378 |
|
|
%if %{mdkversion} >= 200800 |
379 |
|
|
install vboxvideo_drv_13.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so |
380 |
|
|
%else |
381 |
|
|
install vboxvideo_drv_71.so %{buildroot}%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so |
382 |
|
|
%endif |
383 |
|
|
%endif |
384 |
|
|
mkdir -p %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release} |
385 |
|
|
cat > %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF |
386 |
|
|
PACKAGE_NAME=vboxadditions |
387 |
|
|
PACKAGE_VERSION=%{version}-%{release} |
388 |
|
|
MAKE[0]="make -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxguest && |
389 |
|
|
cp \$dkms_tree/\$module/\$module_version/build/vboxguest/Module.symvers \$dkms_tree/\$module/\$module_version/build/vboxsf && |
390 |
|
|
make -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxsf && |
391 |
|
|
cp \$dkms_tree/\$module/\$module_version/build/vboxsf/Module.symvers \$dkms_tree/\$module/\$module_version/build/vboxvideo && |
392 |
|
|
make -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxvideo" |
393 |
|
|
EOF |
394 |
|
|
i=0 |
395 |
|
|
for kmod in vboxguest vboxsf vboxvideo; do |
396 |
|
|
mkdir -p %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/$kmod |
397 |
|
|
cp -a src/$kmod/* %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/$kmod/ |
398 |
|
|
cat >> %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF |
399 |
|
|
DEST_MODULE_LOCATION[$i]=/kernel/3rdparty/vbox |
400 |
|
|
BUILT_MODULE_LOCATION[$i]=$kmod/ |
401 |
|
|
BUILT_MODULE_NAME[$i]=$kmod |
402 |
|
|
EOF |
403 |
|
|
i=$((i+1)) |
404 |
|
|
done |
405 |
|
|
cat >> %{buildroot}%{_usr}/src/vboxadditions-%{version}-%{release}/dkms.conf << EOF |
406 |
|
|
CLEAN="make -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxguest clean && |
407 |
|
|
make -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxsf clean && |
408 |
|
|
make -C \$kernel_source_dir M=\$dkms_tree/\$module/\$module_version/build/vboxvideo clean " |
409 |
|
|
AUTOINSTALL=yes |
410 |
|
|
EOF |
411 |
|
|
popd |
412 |
|
|
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 |
413 |
|
|
%endif |
414 |
|
|
|
415 |
|
|
# install icons |
416 |
|
|
mkdir -p %{buildroot}%{_iconsdir} |
417 |
|
|
install -m644 %{SOURCE10} %{buildroot}%{_iconsdir}/%{name}.png |
418 |
|
|
mkdir -p %{buildroot}%{_miconsdir} |
419 |
|
|
install -m644 %{SOURCE11} %{buildroot}%{_miconsdir}/%{name}.png |
420 |
|
|
mkdir -p %{buildroot}%{_liconsdir} |
421 |
|
|
install -m644 %{SOURCE12} %{buildroot}%{_liconsdir}/%{name}.png |
422 |
|
|
|
423 |
|
|
# install menu entries |
424 |
|
|
|
425 |
|
|
mkdir -p %{buildroot}%{_datadir}/applications |
426 |
|
|
cat > %{buildroot}%{_datadir}/applications/mandriva-%{name}.desktop << EOF |
427 |
|
|
[Desktop Entry] |
428 |
|
|
Name=VirtualBox OSE |
429 |
|
|
Comment=Full virtualizer for x86 hardware |
430 |
|
|
Exec=%{_bindir}/%{oname} |
431 |
|
|
Icon=%{name} |
432 |
|
|
Type=Application |
433 |
|
|
Terminal=false |
434 |
|
|
Categories=X-MandrivaLinux-MoreApplications-Emulators;Emulator; |
435 |
|
|
EOF |
436 |
|
|
|
437 |
|
|
# add missing makefile for kernel module |
438 |
|
|
install -m644 src/VBox/HostDrivers/Support/linux/Makefile %{buildroot}%{_usr}/src/%{name}-%{version}-%{release}/ |
439 |
|
|
|
440 |
|
|
# remove unpackaged files |
441 |
|
|
rm -rf %{buildroot}%{vboxlibdir}/{src,sdk,testcase} |
442 |
|
|
rm -f %{buildroot}%{vboxlibdir}/tst* |
443 |
|
|
rm -f %{buildroot}%{vboxlibdir}/vboxkeyboard.tar.gz |
444 |
|
|
rm -f %{buildroot}%{vboxlibdir}/SUP* |
445 |
|
|
rm -f %{buildroot}%{vboxlibdir}/xpidl |
446 |
|
|
|
447 |
|
|
# install PAM module: |
448 |
|
|
install -D -m755 out/%{vbox_platform}/release/bin/additions/pam_vbox.so %{buildroot}/%{_lib}/security/pam_vbox.so |
449 |
|
|
|
450 |
|
|
%clean |
451 |
|
|
rm -rf %{buildroot} |
452 |
|
|
|
453 |
|
|
%post |
454 |
|
|
%if %mdkversion < 200900 |
455 |
|
|
%update_menus |
456 |
|
|
%endif |
457 |
|
|
%_post_service %{name} |
458 |
|
|
|
459 |
|
|
%postun |
460 |
|
|
%if %mdkversion < 200900 |
461 |
|
|
%clean_menus |
462 |
|
|
%endif |
463 |
|
|
if [ "$1" -ge "1" ]; then |
464 |
|
|
/sbin/service %{name} condrestart > /dev/null 2>&1 || : |
465 |
|
|
fi |
466 |
|
|
|
467 |
|
|
%preun |
468 |
|
|
%_preun_service %{name} |
469 |
|
|
|
470 |
|
|
%post -n dkms-%{name} |
471 |
|
|
set -x |
472 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade add -m %{name} -v %{version}-%{release} |
473 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade build -m %{name} -v %{version}-%{release} && |
474 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade install -m %{name} -v %{version}-%{release} |
475 |
|
|
/sbin/rmmod vboxnetflt &>/dev/null |
476 |
|
|
/sbin/rmmod vboxnetadp &>/dev/null |
477 |
|
|
/sbin/rmmod %{kname} &>/dev/null |
478 |
|
|
/sbin/modprobe %{kname} &>/dev/null |
479 |
|
|
/sbin/modprobe vboxnetflt &>/dev/null |
480 |
|
|
/sbin/modprobe vboxnetadp &>/dev/null |
481 |
|
|
: |
482 |
|
|
|
483 |
|
|
%preun -n dkms-%{name} |
484 |
|
|
if [ "$1" = "0" ]; then |
485 |
|
|
/sbin/rmmod vboxnetadp >/dev/null 2>&1 |
486 |
|
|
/sbin/rmmod vboxnetflt >/dev/null 2>&1 |
487 |
|
|
/sbin/rmmod %{kname} >/dev/null 2>&1 |
488 |
|
|
fi |
489 |
|
|
set -x |
490 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade remove -m %{name} -v %{version}-%{release} --all || : |
491 |
|
|
|
492 |
|
|
%if %{build_additions} |
493 |
|
|
%post guest-additions |
494 |
|
|
%_post_service vboxadd-timesync |
495 |
|
|
|
496 |
|
|
%preun guest-additions |
497 |
|
|
%_preun_service vboxadd-timesync |
498 |
|
|
|
499 |
|
|
%post -n dkms-vboxadditions |
500 |
|
|
set -x |
501 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade add -m vboxadditions -v %{version}-%{release} |
502 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade build -m vboxadditions -v %{version}-%{release} && |
503 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade install -m vboxadditions -v %{version}-%{release} |
504 |
|
|
: |
505 |
|
|
|
506 |
|
|
%preun -n dkms-vboxadditions |
507 |
|
|
set -x |
508 |
|
|
/usr/sbin/dkms --rpm_safe_upgrade remove -m vboxadditions -v %{version}-%{release} --all |
509 |
|
|
: |
510 |
|
|
|
511 |
|
|
%endif |
512 |
|
|
|
513 |
|
|
%files |
514 |
|
|
%defattr(-,root,root) |
515 |
|
|
%config %{_sysconfdir}/vbox/vbox.cfg |
516 |
|
|
%{_bindir}/%{oname} |
517 |
|
|
%{_bindir}/VBoxManage |
518 |
|
|
%{_bindir}/VBoxSDL |
519 |
|
|
%{_bindir}/VBoxHeadless |
520 |
|
|
%{_bindir}/VBoxTunctl |
521 |
|
|
%{_bindir}/VBoxNetAdpCtl |
522 |
|
|
%{_bindir}/VBoxNetDHCP |
523 |
|
|
%{_bindir}/vboxwebsrv |
524 |
|
|
%{vboxlibdir} |
525 |
|
|
%attr(4711,root,root) %{vboxlibdir}/VBoxHeadless |
526 |
|
|
%attr(4711,root,root) %{vboxlibdir}/VBoxSDL |
527 |
|
|
%attr(4711,root,root) %{vboxlibdir}/VirtualBox |
528 |
|
|
%attr(4711,root,root) %{vboxlibdir}/VBoxNetAdpCtl |
529 |
|
|
%attr(4711,root,root) %{vboxlibdir}/VBoxNetDHCP |
530 |
|
|
%attr(644,root,root) %{vboxlibdir}/*.gc |
531 |
|
|
%attr(644,root,root) %{vboxlibdir}/*.r0 |
532 |
|
|
%if %build_doc |
533 |
|
|
%exclude %{vboxlibdir}/UserManual.pdf |
534 |
|
|
%endif |
535 |
|
|
%{vboxdatadir} |
536 |
|
|
# initscripts integration |
537 |
|
|
%{_initrddir}/%{name} |
538 |
|
|
%config %{_sysconfdir}/udev/rules.d/%{name}.rules |
539 |
|
|
%dir /var/run/%{oname} |
540 |
|
|
# desktop integration |
541 |
|
|
%{_iconsdir}/*.png |
542 |
|
|
%{_miconsdir}/*.png |
543 |
|
|
%{_liconsdir}/*.png |
544 |
|
|
%{_datadir}/applications/mandriva-%{name}.desktop |
545 |
|
|
|
546 |
|
|
%files -n dkms-%{name} |
547 |
|
|
%defattr(-,root,root) |
548 |
|
|
%{_usr}/src/%{name}-%{version}-%{release} |
549 |
|
|
|
550 |
|
|
%if %{build_additions} |
551 |
|
|
%files guest-additions |
552 |
|
|
%defattr(-,root,root) |
553 |
|
|
/%{_lib}/security/pam_vbox.so |
554 |
|
|
/sbin/mount.vboxsf |
555 |
|
|
%{_initrddir}/vboxadd-timesync |
556 |
|
|
%{_sbindir}/VBoxService |
557 |
|
|
%{_bindir}/VBoxClient |
558 |
|
|
%{_bindir}/VBoxControl |
559 |
|
|
%if %{mdkversion} <= 200910 |
560 |
|
|
%{_sysconfdir}/security/console.perms.d/60-vboxadd.perms |
561 |
|
|
%endif |
562 |
|
|
%{_sysconfdir}/udev/rules.d/vbox-additions.rules |
563 |
|
|
%{_sysconfdir}/X11/xinit.d/98vboxadd-xclient |
564 |
|
|
%{_sysconfdir}/modprobe.preload.d/vbox-guest-additions |
565 |
|
|
|
566 |
|
|
%files -n x11-driver-input-vboxmouse |
567 |
|
|
%defattr(-,root,root) |
568 |
|
|
%{_libdir}/xorg/modules/input/vboxmouse_drv.so |
569 |
|
|
%if %{mdvver} < 201100 |
570 |
|
|
%{_datadir}/hal/fdi/policy/20thirdparty/90-vboxguest.fdi |
571 |
|
|
%else |
572 |
|
|
%{_sysconfdir}/udev/rules.d/70-xorg-vboxmouse.rules |
573 |
|
|
%{_sysconfdir}/X11/xorg.conf.d/50-vboxmouse.conf |
574 |
|
|
%endif |
575 |
|
|
|
576 |
|
|
%files -n x11-driver-video-vboxvideo |
577 |
|
|
%defattr(-,root,root) |
578 |
|
|
%{_libdir}/VBoxOGL* |
579 |
|
|
%{_libdir}/xorg/modules/drivers/vboxvideo_drv.so |
580 |
|
|
%{_libdir}/dri/vboxvideo_dri.so |
581 |
|
|
|
582 |
|
|
%files -n dkms-vboxadditions |
583 |
|
|
%defattr(-,root,root) |
584 |
|
|
%{_usr}/src/vbox*-%{version}-%{release} |
585 |
|
|
|
586 |
|
|
%endif |
587 |
|
|
|
588 |
|
|
%if %build_doc |
589 |
|
|
%files doc |
590 |
|
|
%defattr(-,root,root) |
591 |
|
|
%{vboxlibdir}/UserManual.pdf |
592 |
|
|
%endif |
593 |
|
|
|
594 |
|
|
|