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 userspace # don't build userspace package
22 Summary: VirtualBox - x86 hardware virtualizer
23 Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86
28 Group: Applications/Emulators
29 Source0: http://www.virtualbox.org/download/%{version}/VirtualBox-%{version}_OSE.tar.bz2
30 # Source0-md5: 56c074900260c109ed735c08e726fe81
31 Source1: virtualbox.init
32 Source2: http://www.virtualbox.org/download/UserManual.pdf
33 # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284
34 Source3: %{name}.desktop
35 Patch0: %{name}-configure.patch
36 Patch1: %{name}-qt-paths.patch
37 URL: http://www.virtualbox.org/
38 Requires(postun): /usr/sbin/groupdel
39 Requires(postun): /usr/sbin/userdel
40 Requires(pre): /bin/id
41 Requires(pre): /usr/sbin/groupadd
42 Requires(pre): /usr/sbin/useradd
43 BuildRequires: SDL-devel
47 BuildRequires: gcc >= 5:3.2.3
49 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
50 BuildRequires: libIDL-devel
51 BuildRequires: libstdc++-static
52 BuildRequires: libuuid-devel
53 BuildRequires: libxslt-progs
54 BuildRequires: qt-devel >= 6:3.3.6
55 BuildRequires: qt-linguist
56 BuildRequires: rpmbuild(macros) >= 1.329
57 BuildRequires: xalan-c-devel >= 1.10.0
58 #BuildRequires: xcursor-devel
59 BuildRequires: xerces-c-devel >= 2.6.0
60 BuildRequires: xorg-lib-libXcursor-devel
61 BuildRequires: zlib-devel >= 1.2.1
62 ExclusiveArch: %{ix86} %{x8664}
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 InnoTek VirtualBox is a general-purpose full virtualizer for x86
73 hardware. Targeted at server, desktop and embedded use, it is now the
74 only professional-quality virtualization solution that is also Open
77 Some of the features of VirtualBox are:
79 Modularity: VirtualBox has an extremely modular design with
80 well-defined internal programming interfaces and a client/server
81 design. This makes it easy to control it from several interfaces at
82 once: for example, you can start a virtual machine in a typical
83 virtual machine GUI and then control that machine from the command
84 line. VirtualBox also comes with a full Software Development Kit: even
85 though it is Open Source Software, you don't have to hack the source
86 to write a new interface for VirtualBox.
88 Virtual machine descriptions in XML: the configuration settings of
89 virtual machines are stored entirely in XML and are independent of the
90 local machines. Virtual machine definitions can therefore easily be
91 ported to other computers.
93 %description -l pl.UTF-8
94 InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
95 zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
96 jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
97 również jako Otwarte Oprogramowanie.
99 Przykładowe cechy VirtualBoksa:
101 Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
102 dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
103 klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
104 różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
105 poziomu interfejsu graficznego, a później kontrolować ją z linii
106 poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
107 pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
109 Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
110 wirtualnych są w całości przechowywane w XML-u i są niezależne od
111 lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
112 konfigurację maszyny wirtualnej na inny komputer.
114 %package -n kernel%{_alt_kernel}-misc-vboxdrv
115 Summary: Linux kernel module for VirtualBox
116 Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
117 Release: %{_rel}@%{_kernel_ver_str}
119 Requires(post,postun): /sbin/depmod
120 Requires: dev >= 2.9.0-7
121 %if %{with dist_kernel}
122 %requires_releq_kernel
123 Requires(postun): %releq_kernel
125 Provides: kernel(vboxdrv) = %{version}-%{_rel}
127 %description -n kernel%{_alt_kernel}-misc-vboxdrv
128 Linux kernel module vboxdrv for VirtualBox.
130 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
131 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
134 %setup -q -n %{name}-%{version}_OSE
138 cat > VBox.sh <<'EOF'
141 if [ ! -c /dev/vboxdrv ]; then
142 echo "Special character device /dev/vboxdrv doesn't exists!"
143 echo "Check your installation and if vboxdrv kernel module is loaded."
147 if [ ! -w /dev/vboxdrv ]; then
148 echo "You don't have write access to /dev/vboxdrv!"
149 echo "Correct this situation or contact with your system administrator."
153 BINFILE=$(basename "$0")
154 LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"}
160 KDIR="%{_builddir}/%{buildsubdir}/kernel"
162 cp -a %{_kernelsrcdir}/include $KDIR
164 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
166 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
168 ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
171 --with-gcc="%{__cc}" \
172 --with-g++="%{__cxx}" \
178 cd out/linux.%{_outdir}/release/bin/src
179 for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do
180 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
184 install -d o/include/linux
185 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
186 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
187 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
188 %if %{with dist_kernel}
189 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
191 touch o/include/config/MARKER
192 ln -sf %{_kernelsrcdir}/scripts o/scripts
194 ln -sf ../../include/VBox o/include/VBox
195 ln -sf ../../include/iprt o/include/iprt
196 %{__make} -C %{_kernelsrcdir} clean \
197 SYSSRC=%{_kernelsrcdir} \
201 %{__make} -C %{_kernelsrcdir} modules \
202 CC="%{__cc}" CPP="%{__cpp}" \
203 SYSSRC=%{_kernelsrcdir} \
207 mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
212 rm -rf $RPM_BUILD_ROOT
214 %if %{with userspace}
216 $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
217 $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
218 $RPM_BUILD_ROOT/etc/rc.d/init.d
220 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
221 install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
222 install VBox.sh $RPM_BUILD_ROOT%{_bindir}/$f
225 install out/linux.%{_outdir}/release/bin/VBox*.so \
226 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
227 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
228 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
230 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
231 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
233 install out/linux.%{_outdir}/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
234 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
238 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
239 install vboxdrv-dist.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko
243 rm -rf $RPM_BUILD_ROOT
246 %groupadd -g 221 -r -f vbox
249 /sbin/chkconfig --add virtualbox
250 %service virtualbox restart "VBoxSVC daemon"
251 if [ "$1" = 1 ]; then
252 %banner -e %{name} <<'EOF'
253 Remember to add users which will use VirtualBox to vbox group or they won't be
254 able to write to /dev/vboxdrv.
260 if [ "$1" = "0" ]; then
261 %service virtualbox stop
262 /sbin/chkconfig --del virtualbox
266 if [ "$1" = "0" ]; then
270 %post -n kernel%{_alt_kernel}-misc-vboxdrv
271 %depmod %{_kernel_ver}
273 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
274 %depmod %{_kernel_ver}
276 %if %{with userspace}
278 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_bindir}/VBox*
281 %attr(755,root,root) %{_bindir}/VirtualBox
282 %dir %{_libdir}/VirtualBox
283 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
284 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
285 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
286 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
287 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
288 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
289 %{_libdir}/VirtualBox/*.gc
290 %{_libdir}/VirtualBox/*.r0
291 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
292 %{_libdir}/VirtualBox/*.xpt
293 %dir %{_libdir}/VirtualBox/components
294 %{_libdir}/VirtualBox/components/*
295 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
296 %{_pixmapsdir}/VBox.png
297 %{_desktopdir}/%{name}.desktop
301 %files -n kernel%{_alt_kernel}-misc-vboxdrv
302 %defattr(644,root,root,755)
303 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*