3 # - finish kernel/userspace bconds (deps, limit build to only selected part)
4 # - Home page says that some addons should be compiled, I don't see any except.
5 # vboxaddon kernel module and {vboxmouse,vboxvideo)_drv.so. Are they required?
7 # - it seems that VBoxSVC should not be started by init script but I'm still
9 # - /dev/vboxdrv should belong to vboxusers group and have rw rights to it
10 # - Devel stuff is not packaged yet.
11 # - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that
12 # code may be compiled exclusively for i686.
13 # - use %kernel_build macros
16 %bcond_without dist_kernel # without distribution kernel
17 %bcond_without kernel # don't build kernel module
18 %bcond_without up # without up packages
19 %bcond_without smp # without SMP kernel modules
20 %bcond_without userspace # don't build userspace package
24 Summary: VirtualBox - x86 hardware virtualizer
25 Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86
30 Group: Applications/Emulators
31 Source0: http://www.virtualbox.org/download/%{version}/VirtualBox-OSE-%{version}.tar.bz2
32 # Source0-md5: 8e89d32a67a3a39271f44039d0583a16
33 Source1: virtualbox.init
34 Source2: http://www.virtualbox.org/download/UserManual.pdf
35 # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284
36 Patch0: %{name}-configure.patch
37 Patch1: %{name}-qt-paths.patch
38 URL: http://www.virtualbox.org/
39 BuildRequires: SDL-devel
43 BuildRequires: gcc >= 5:3.2.3
45 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
46 BuildRequires: libIDL-devel
47 BuildRequires: libuuid-devel
48 BuildRequires: libxslt-progs
49 BuildRequires: qt-devel >= 6:3.3.6
50 BuildRequires: rpmbuild(macros) >= 1.329
51 BuildRequires: xalan-c-devel >= 1.10.0
52 #BuildRequires: xcursor-devel
53 BuildRequires: xerces-c-devel >= 2.6.0
54 BuildRequires: xorg-lib-libXcursor-devel
55 BuildRequires: zlib-devel >= 1.2.1
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-vboxdrv
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_up
117 Requires(postun): %releq_kernel_up
119 Provides: kernel(vboxdrv) = %{version}-%{_rel}
121 %description -n kernel%{_alt_kernel}-misc-vboxdrv
122 Linux kernel module vboxdrv for VirtualBox.
124 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
125 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
127 %package -n kernel%{_alt_kernel}-smp-misc-vboxdrv
128 Summary: Linux SMP kernel module for VirtualBox
129 Summary(pl.UTF-8): Moduł jądra Linuksa SMP 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_smp
136 Requires(postun): %releq_kernel_smp
138 Provides: kernel(vboxdrv) = %{version}-%{_rel}
140 %description -n kernel%{_alt_kernel}-smp-misc-vboxdrv
141 Linux SMP kernel module vboxdrv for VirtualBox.
143 %description -n kernel%{_alt_kernel}-smp-misc-vboxdrv -l pl.UTF-8
144 Moduł jądra Linuksa SMP vboxdrv dla VirtualBoksa.
147 %setup -q -n %{name}-OSE-%{version}
151 cat > VBox.sh <<'EOF'
154 if [ ! -c /dev/vboxdrv ]; then
155 echo "Special character device /dev/vboxdrv doesn't exists!"
156 echo "Check your installation and if vboxdrv kernel module is loaded."
160 if [ ! -w /dev/vboxdrv ]; then
161 echo "You don't have write access to /dev/vboxdrv!"
162 echo "Correct this situation or contact with your system administrator."
166 BINFILE=$(basename "$0")
167 LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"}
173 KDIR="%{_builddir}/%{buildsubdir}/kernel"
175 cp -a %{_kernelsrcdir}/include $KDIR
177 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
179 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
181 ln -sf $KDIR/include/linux/autoconf-up.h $KDIR/include/linux/autoconf.h
184 --with-gcc="%{__cc}" \
185 --with-g++="%{__cxx}" \
191 cd out/linux.%{_outdir}/release/bin/src
192 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
193 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
197 install -d o/include/linux
198 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
199 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
200 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
201 %if %{with dist_kernel}
202 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
204 touch o/include/config/MARKER
205 ln -sf %{_kernelsrcdir}/scripts o/scripts
207 ln -sf ../../include/VBox o/include/VBox
208 ln -sf ../../include/iprt o/include/iprt
209 %{__make} -C %{_kernelsrcdir} clean \
210 SYSSRC=%{_kernelsrcdir} \
214 %{__make} -C %{_kernelsrcdir} modules \
215 CC="%{__cc}" CPP="%{__cpp}" \
216 SYSSRC=%{_kernelsrcdir} \
220 mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
225 rm -rf $RPM_BUILD_ROOT
227 %if %{with userspace}
229 $RPM_BUILD_ROOT%{_bindir} \
230 $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
231 $RPM_BUILD_ROOT/etc/rc.d/init.d
233 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
234 install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
235 install VBox.sh $RPM_BUILD_ROOT%{_bindir}/$f
238 install out/linux.%{_outdir}/release/bin/VBox{C,DD,DD2,DDU,REM,REMImp,RT,SVCM,VMM,XML,XPCOM,XPCOMIPCC}.so \
239 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
240 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
241 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
243 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
244 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
248 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
249 install vboxdrv-up.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko
250 %if %{with smp} && %{with dist_kernel}
251 install vboxdrv-smp.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko
256 rm -rf $RPM_BUILD_ROOT
259 /sbin/chkconfig --add virtualbox
260 %service virtualbox restart "VBoxSVC daemon"
263 if [ "$1" = "0" ]; then
264 %service virtualbox stop
265 /sbin/chkconfig --del virtualbox
268 %post -n kernel%{_alt_kernel}-misc-vboxdrv
269 %depmod %{_kernel_ver}
271 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
272 %depmod %{_kernel_ver}
274 %post -n kernel%{_alt_kernel}-smp-misc-vboxdrv
275 %depmod %{_kernel_ver}smp
277 %postun -n kernel%{_alt_kernel}-smp-misc-vboxdrv
278 %depmod %{_kernel_ver}smp
280 %if %{with userspace}
282 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_bindir}/VBox*
285 %attr(755,root,root) %{_bindir}/VirtualBox
286 %dir %{_libdir}/VirtualBox
287 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
288 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
289 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
290 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
291 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
292 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
293 %{_libdir}/VirtualBox/*.gc
294 %{_libdir}/VirtualBox/*.r0
295 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
296 %{_libdir}/VirtualBox/*.xpt
297 %dir %{_libdir}/VirtualBox/components
298 %{_libdir}/VirtualBox/components/*
299 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
303 %if %{with up} || %{without dist_kernel}
304 %files -n kernel%{_alt_kernel}-misc-vboxdrv
305 %defattr(644,root,root,755)
306 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
309 %if %{with smp} && %{with dist_kernel}
310 %files -n kernel%{_alt_kernel}-smp-misc-vboxdrv
311 %defattr(644,root,root,755)
312 /lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko*