3 # - Home page says that some addons should be compiled, I don't see any except.
4 # vboxaddon kernel module and {vboxmouse,vboxvideo)_drv.so. Are they required?
6 # - it seems that VBoxSVC should not be started by init script but I'm still
8 # - /dev/vboxdrv should belong to vboxusers group and have rw rights to it
9 # - Devel stuff is not packaged yet.
10 # - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that
11 # code may be compiled exclusively for i686.
12 # - use %kernel_build macros
15 %bcond_without dist_kernel # without distribution kernel
16 %bcond_without up # without up packages
17 %bcond_without smp # without SMP kernel modules
22 Summary(pl.UTF-8): VirtualBox
27 Group: Applications/Emulators
28 Source0: http://www.virtualbox.org/download/%{version}/VirtualBox-OSE-%{version}.tar.bz2
29 # Source0-md5: 8e89d32a67a3a39271f44039d0583a16
30 Source1: virtualbox.init
31 Source2: http://www.virtualbox.org/download/UserManual.pdf
32 # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284
33 Patch0: %{name}-configure.patch
34 Patch1: %{name}-qt-paths.patch
35 URL: http://www.virtualbox.org/
36 BuildRequires: SDL-devel
40 BuildRequires: gcc >= 5:3.2.3
42 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
43 BuildRequires: libIDL-devel
44 BuildRequires: libuuid-devel
45 BuildRequires: libxslt-progs
46 BuildRequires: qt-devel >= 6:3.3.6
47 BuildRequires: rpmbuild(macros) >= 1.329
48 BuildRequires: xalan-c-devel >= 1.10.0
49 #BuildRequires: xcursor-devel
50 BuildRequires: xerces-c-devel >= 2.6.0
51 BuildRequires: xorg-lib-libXcursor-devel
52 BuildRequires: zlib-devel >= 1.2.1
53 Requires: kernel(vboxdrv) = %{version}-%{_rel}
54 ExclusiveArch: %{ix86} %{x8664}
55 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 InnoTek VirtualBox is a general-purpose full virtualizer for x86
65 hardware. Targeted at server, desktop and embedded use, it is now the
66 only professional-quality virtualization solution that is also Open
69 Some of the features of VirtualBox are:
71 Modularity: VirtualBox has an extremely modular design with
72 well-defined internal programming interfaces and a client/server
73 design. This makes it easy to control it from several interfaces at
74 once: for example, you can start a virtual machine in a typical
75 virtual machine GUI and then control that machine from the command
76 line. VirtualBox also comes with a full Software Development Kit: even
77 though it is Open Source Software, you don't have to hack the source
78 to write a new interface for VirtualBox.
80 Virtual machine descriptions in XML: the configuration settings of
81 virtual machines are stored entirely in XML and are independent of the
82 local machines. Virtual machine definitions can therefore easily be
83 ported to other computers.
85 %description -l pl.UTF-8
86 InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
87 zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
88 jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
89 również jako Otwarte Oprogramowanie.
91 Przykładowe cechy VirtualBoksa:
93 Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
94 dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
95 klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
96 różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
97 poziomu interfejsu graficznego, a później kontrolować ją z linii
98 poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
99 pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
101 Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
102 wirtualnych są w całości przechowywane w XML-u i są niezależne od
103 lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
104 konfigurację maszyny wirtualnej na inny komputer.
106 %package -n kernel%{_alt_kernel}-misc-vboxdrv
107 Summary: Linux kernel module for VirtualBox
108 Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
109 Release: %{_rel}@%{_kernel_ver_str}
111 Requires(post,postun): /sbin/depmod
112 Requires: dev >= 2.9.0-7
113 %if %{with dist_kernel}
114 %requires_releq_kernel_up
115 Requires(postun): %releq_kernel_up
117 Provides: kernel(vboxdrv) = %{version}-%{_rel}
119 %description -n kernel%{_alt_kernel}-misc-vboxdrv
120 Linux kernel module vboxdrv for VirtualBox.
122 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
123 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
125 %package -n kernel%{_alt_kernel}-smp-misc-vboxdrv
126 Summary: Linux SMP kernel module for VirtualBox
127 Summary(pl.UTF-8): Moduł jądra Linuksa SMP dla VirtualBoksa
128 Release: %{_rel}@%{_kernel_ver_str}
130 Requires(post,postun): /sbin/depmod
131 Requires: dev >= 2.9.0-7
132 %if %{with dist_kernel}
133 %requires_releq_kernel_smp
134 Requires(postun): %releq_kernel_smp
136 Provides: kernel(vboxdrv) = %{version}-%{_rel}
138 %description -n kernel%{_alt_kernel}-smp-misc-vboxdrv
139 Linux SMP kernel module vboxdrv for VirtualBox.
141 %description -n kernel%{_alt_kernel}-smp-misc-vboxdrv -l pl.UTF-8
142 Moduł jądra Linuksa SMP vboxdrv dla VirtualBoksa.
145 %setup -q -n %{name}-OSE-%{version}
149 cat > VBox.sh <<'EOF'
152 if [ ! -c /dev/vboxdrv ]; then
153 echo "Special character device /dev/vboxdrv doesn't exists!"
154 echo "Check your installation and if vboxdrv kernel module is loaded."
158 if [ ! -w /dev/vboxdrv ]; then
159 echo "You don't have write access to /dev/vboxdrv!"
160 echo "Correct this situation or contact with your system administrator."
164 BINFILE=$(basename "$0")
165 LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"}
171 KDIR="%{_builddir}/%{buildsubdir}/kernel"
173 cp -a %{_kernelsrcdir}/include $KDIR
175 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
177 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
179 ln -sf $KDIR/include/linux/autoconf-up.h $KDIR/include/linux/autoconf.h
182 --with-gcc="%{__cc}" \
183 --with-g++="%{__cxx}" \
188 cd out/linux.%{_outdir}/release/bin/src
189 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
190 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
194 install -d o/include/linux
195 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
196 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
197 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
198 %if %{with dist_kernel}
199 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
201 touch o/include/config/MARKER
202 ln -sf %{_kernelsrcdir}/scripts o/scripts
204 ln -sf ../../include/VBox o/include/VBox
205 ln -sf ../../include/iprt o/include/iprt
206 %{__make} -C %{_kernelsrcdir} clean \
207 SYSSRC=%{_kernelsrcdir} \
211 %{__make} -C %{_kernelsrcdir} modules \
212 CC="%{__cc}" CPP="%{__cpp}" \
213 SYSSRC=%{_kernelsrcdir} \
217 mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
221 rm -rf $RPM_BUILD_ROOT
224 $RPM_BUILD_ROOT%{_bindir} \
225 $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
226 $RPM_BUILD_ROOT/etc/rc.d/init.d
228 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
229 install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
230 install VBox.sh $RPM_BUILD_ROOT%{_bindir}/$f
233 install out/linux.%{_outdir}/release/bin/VBox{C,DD,DD2,DDU,REM,REMImp,RT,SVCM,VMM,XML,XPCOM,XPCOMIPCC}.so \
234 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
235 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
236 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
238 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
239 install vboxdrv-up.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko
240 %if %{with smp} && %{with dist_kernel}
241 install vboxdrv-smp.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko
244 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
245 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
248 rm -rf $RPM_BUILD_ROOT
251 /sbin/chkconfig --add virtualbox
252 %service virtualbox restart "VBoxSVC daemon"
255 if [ "$1" = "0" ]; then
256 %service virtualbox stop
257 /sbin/chkconfig --del virtualbox
260 %post -n kernel%{_alt_kernel}-misc-vboxdrv
261 %depmod %{_kernel_ver}
263 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
264 %depmod %{_kernel_ver}
266 %if %{with smp} && %{with dist_kernel}
267 %post -n kernel%{_alt_kernel}-smp-misc-vboxdrv
268 %depmod %{_kernel_ver}smp
270 %postun -n kernel%{_alt_kernel}-smp-misc-vboxdrv
271 %depmod %{_kernel_ver}smp
275 %defattr(644,root,root,755)
277 %dir %{_libdir}/VirtualBox
278 %dir %{_libdir}/VirtualBox/components
279 %attr(755,root,root) %{_bindir}/VBox*
280 %attr(755,root,root) %{_bindir}/VirtualBox
281 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
282 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
283 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
284 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
285 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
286 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
287 %{_libdir}/VirtualBox/*.gc
288 %{_libdir}/VirtualBox/*.r0
289 %{_libdir}/VirtualBox/VBox*.so
290 %{_libdir}/VirtualBox/*.xpt
291 %{_libdir}/VirtualBox/components/*
292 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
294 %if %{with up} || %{without dist_kernel}
295 %files -n kernel%{_alt_kernel}-misc-vboxdrv
296 %defattr(644,root,root,755)
297 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko.gz
300 %if %{with smp} && %{with dist_kernel}
301 %files -n kernel%{_alt_kernel}-smp-misc-vboxdrv
302 %defattr(644,root,root,755)
303 /lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko.gz