3 # - Find how to compile with PLD CFLAGS/CXXFLAGS/LDFLAGS.
4 # - How to package video and mouse drivers for Guest OS ?
5 # (There are binaries for multiple versions of X11)
9 %bcond_without dist_kernel # without distribution kernel
10 %bcond_without kernel # don't build kernel module
11 %bcond_without userspace # don't build userspace package
15 Summary: VirtualBox - x86 hardware virtualizer
16 Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86
21 Group: Applications/Emulators
22 Source0: http://www.virtualbox.org/download/%{version}/%{name}-%{version}_OSE.tar.bz2
23 # Source0-md5: 56c074900260c109ed735c08e726fe81
24 Source1: virtualbox.init
25 Source2: http://www.virtualbox.org/download/UserManual.pdf
26 # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284
27 Source3: %{name}.desktop
29 Patch0: %{name}-configure.patch
30 Patch1: %{name}-qt-paths.patch
31 Patch2: %{name}-shared-libstdc++.patch
32 URL: http://www.virtualbox.org/
33 BuildRequires: SDL-devel
37 BuildRequires: gcc >= 5:3.2.3
39 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
40 BuildRequires: libIDL-devel
41 BuildRequires: libuuid-devel
42 BuildRequires: libxslt-progs
43 BuildRequires: qt-devel >= 6:3.3.6
44 BuildRequires: qt-linguist
45 BuildRequires: rpmbuild(macros) >= 1.329
46 BuildRequires: xalan-c-devel >= 1.10.0
47 #BuildRequires: xcursor-devel
48 BuildRequires: xerces-c-devel >= 2.6.0
49 BuildRequires: xorg-lib-libXcursor-devel
50 BuildRequires: zlib-devel >= 1.2.1
51 Requires(postun): /usr/sbin/groupdel
52 Requires(pre): /usr/bin/getgid
53 Requires(pre): /usr/sbin/groupadd
56 ExclusiveArch: %{ix86} %{x8664}
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 InnoTek VirtualBox is a general-purpose full virtualizer for x86
67 hardware. Targeted at server, desktop and embedded use, it is now the
68 only professional-quality virtualization solution that is also Open
71 Some of the features of VirtualBox are:
73 Modularity: VirtualBox has an extremely modular design with
74 well-defined internal programming interfaces and a client/server
75 design. This makes it easy to control it from several interfaces at
76 once: for example, you can start a virtual machine in a typical
77 virtual machine GUI and then control that machine from the command
78 line. VirtualBox also comes with a full Software Development Kit: even
79 though it is Open Source Software, you don't have to hack the source
80 to write a new interface for VirtualBox.
82 Virtual machine descriptions in XML: the configuration settings of
83 virtual machines are stored entirely in XML and are independent of the
84 local machines. Virtual machine definitions can therefore easily be
85 ported to other computers.
87 %description -l pl.UTF-8
88 InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
89 zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
90 jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
91 również jako Otwarte Oprogramowanie.
93 Przykładowe cechy VirtualBoksa:
95 Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
96 dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
97 klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
98 różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
99 poziomu interfejsu graficznego, a później kontrolować ją z linii
100 poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
101 pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
103 Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
104 wirtualnych są w całości przechowywane w XML-u i są niezależne od
105 lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
106 konfigurację maszyny wirtualnej na inny komputer.
108 %package -n kernel%{_alt_kernel}-misc-vboxadd
109 Summary: Linux kernel module for VirtualBox
110 Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
111 Release: %{_rel}@%{_kernel_ver_str}
113 Requires(post,postun): /sbin/depmod
114 Requires: dev >= 2.9.0-7
115 %if %{with dist_kernel}
116 %requires_releq_kernel
117 Requires(postun): %releq_kernel
119 Provides: kernel(vboxadd) = %{version}-%{_rel}
121 %description -n kernel%{_alt_kernel}-misc-vboxadd
122 Linux kernel module vboxadd for VirtualBox.
124 %description -n kernel%{_alt_kernel}-misc-vboxadd -l pl.UTF-8
125 Moduł jądra Linuksa vboxadd dla VirtualBoksa.
127 %package -n kernel%{_alt_kernel}-misc-vboxdrv
128 Summary: Linux kernel module for VirtualBox
129 Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
130 Release: %{_rel}@%{_kernel_ver_str}
132 Requires(post,postun): /sbin/depmod
133 Requires: dev >= 2.9.0-7
134 %if %{with dist_kernel}
135 %requires_releq_kernel
136 Requires(postun): %releq_kernel
138 Provides: kernel(vboxdrv) = %{version}-%{_rel}
140 %description -n kernel%{_alt_kernel}-misc-vboxdrv
141 Linux kernel module vboxdrv for VirtualBox.
143 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
144 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
146 %package -n kernel%{_alt_kernel}-misc-vboxvfs
147 Summary: Linux kernel module for VirtualBox
148 Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
149 Release: %{_rel}@%{_kernel_ver_str}
151 Requires(post,postun): /sbin/depmod
152 Requires: dev >= 2.9.0-7
153 %if %{with dist_kernel}
154 %requires_releq_kernel
155 Requires(postun): %releq_kernel
157 Provides: kernel(vboxvfs) = %{version}-%{_rel}
159 %description -n kernel%{_alt_kernel}-misc-vboxvfs
160 Linux kernel module vboxvfs for VirtualBox.
162 %description -n kernel%{_alt_kernel}-misc-vboxvfs -l pl.UTF-8
163 Moduł jądra Linuksa vboxvfs dla VirtualBoksa.
166 %setup -q -n %{name}-%{version}_OSE
173 KDIR="%{_builddir}/%{buildsubdir}/kernel"
175 cp -Ra %{_kernelsrcdir}/include $KDIR
177 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
179 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
182 %if %{with dist_kernel}
183 [ ! -f $KDIR/include/linux/autoconf.h ] && \
184 ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
186 [ ! -f $KDIR/include/linux/autoconf.h ] && \
187 ln -sf $KDIR/include/linux/autoconf-nondist.h $KDIR/include/linux/autoconf.h
191 --with-gcc="%{__cc}" \
192 --with-g++="%{__cxx}" \
195 %if %{with userspace}
196 . ./env.sh && kmk -j1
200 rm -rf PLD-MODULE-BUILD && mkdir PLD-MODULE-BUILD && cd PLD-MODULE-BUILD
202 ../src/VBox/HostDrivers/Support/linux/export_modules modules.tar.gz && \
203 tar -zxf modules.tar.gz && rm -f modules.tar.gz
204 ../src/VBox/Additions/linux/export_modules modules.tar.gz
205 tar -zxf modules.tar.gz && rm -f modules.tar.gz
207 %build_kernel_modules -m vboxadd -C vboxadd
208 %build_kernel_modules -m vboxdrv -C vboxdrv
209 %build_kernel_modules -m vboxvfs -C vboxvfs
214 rm -rf $RPM_BUILD_ROOT
216 %if %{with userspace}
218 $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
219 $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
220 $RPM_BUILD_ROOT/etc/rc.d/init.d
222 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
223 install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
224 install %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/$f
227 install out/linux.%{_outdir}/release/bin/VBox*.so \
228 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
229 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
230 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
232 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
233 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
235 install out/linux.%{_outdir}/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
236 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
242 [ ! -d $MODULE ] && continue;
245 %install_kernel_modules -m $MODULE -d misc
252 rm -rf $RPM_BUILD_ROOT
255 %groupadd -g 221 -r -f vbox
258 /sbin/chkconfig --add virtualbox
259 %service virtualbox restart "VBoxSVC daemon"
260 if [ "$1" = 1 ]; then
261 %banner -e %{name} <<'EOF'
262 Remember to add users which will use VirtualBox to vbox group or they won't be
263 able to write to /dev/vboxdrv.
269 if [ "$1" = "0" ]; then
270 %service virtualbox stop
271 /sbin/chkconfig --del virtualbox
275 if [ "$1" = "0" ]; then
279 %post -n kernel%{_alt_kernel}-misc-vboxadd
280 %depmod %{_kernel_ver}
282 %postun -n kernel%{_alt_kernel}-misc-vboxadd
283 %depmod %{_kernel_ver}
285 %post -n kernel%{_alt_kernel}-misc-vboxdrv
286 %depmod %{_kernel_ver}
288 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
289 %depmod %{_kernel_ver}
291 %post -n kernel%{_alt_kernel}-misc-vboxvfs
292 %depmod %{_kernel_ver}
294 %postun -n kernel%{_alt_kernel}-misc-vboxvfs
295 %depmod %{_kernel_ver}
297 %if %{with userspace}
299 %defattr(644,root,root,755)
301 %attr(755,root,root) %{_bindir}/VBox*
302 %attr(755,root,root) %{_bindir}/VirtualBox
303 %dir %{_libdir}/VirtualBox
304 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
305 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
306 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
307 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
308 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
309 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
310 %{_libdir}/VirtualBox/*.gc
311 %{_libdir}/VirtualBox/*.r0
312 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
313 %{_libdir}/VirtualBox/*.xpt
314 %dir %{_libdir}/VirtualBox/components
315 %{_libdir}/VirtualBox/components/*
316 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
317 %{_pixmapsdir}/VBox.png
318 %{_desktopdir}/%{name}.desktop
322 %files -n kernel%{_alt_kernel}-misc-vboxadd
323 %defattr(644,root,root,755)
324 /lib/modules/%{_kernel_ver}/misc/vboxadd.ko*
326 %files -n kernel%{_alt_kernel}-misc-vboxdrv
327 %defattr(644,root,root,755)
328 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
330 %files -n kernel%{_alt_kernel}-misc-vboxvfs
331 %defattr(644,root,root,755)
332 /lib/modules/%{_kernel_ver}/misc/vboxvfs.ko*