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 BuildRequires: SDL-devel
42 BuildRequires: gcc >= 5:3.2.3
44 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
45 BuildRequires: libIDL-devel
46 BuildRequires: libstdc++-static
47 BuildRequires: libuuid-devel
48 BuildRequires: libxslt-progs
49 BuildRequires: qt-devel >= 6:3.3.6
50 BuildRequires: qt-linguist
51 BuildRequires: rpmbuild(macros) >= 1.329
52 BuildRequires: xalan-c-devel >= 1.10.0
53 #BuildRequires: xcursor-devel
54 BuildRequires: xerces-c-devel >= 2.6.0
55 BuildRequires: xorg-lib-libXcursor-devel
56 BuildRequires: zlib-devel >= 1.2.1
57 ExclusiveArch: %{ix86} %{x8664}
58 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 InnoTek VirtualBox is a general-purpose full virtualizer for x86
68 hardware. Targeted at server, desktop and embedded use, it is now the
69 only professional-quality virtualization solution that is also Open
72 Some of the features of VirtualBox are:
74 Modularity: VirtualBox has an extremely modular design with
75 well-defined internal programming interfaces and a client/server
76 design. This makes it easy to control it from several interfaces at
77 once: for example, you can start a virtual machine in a typical
78 virtual machine GUI and then control that machine from the command
79 line. VirtualBox also comes with a full Software Development Kit: even
80 though it is Open Source Software, you don't have to hack the source
81 to write a new interface for VirtualBox.
83 Virtual machine descriptions in XML: the configuration settings of
84 virtual machines are stored entirely in XML and are independent of the
85 local machines. Virtual machine definitions can therefore easily be
86 ported to other computers.
88 %description -l pl.UTF-8
89 InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
90 zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
91 jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
92 również jako Otwarte Oprogramowanie.
94 Przykładowe cechy VirtualBoksa:
96 Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
97 dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
98 klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
99 różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
100 poziomu interfejsu graficznego, a później kontrolować ją z linii
101 poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
102 pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
104 Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
105 wirtualnych są w całości przechowywane w XML-u i są niezależne od
106 lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
107 konfigurację maszyny wirtualnej na inny komputer.
109 %package -n kernel%{_alt_kernel}-misc-vboxdrv
110 Summary: Linux kernel module for VirtualBox
111 Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
112 Release: %{_rel}@%{_kernel_ver_str}
114 Requires(post,postun): /sbin/depmod
115 Requires: dev >= 2.9.0-7
116 %if %{with dist_kernel}
117 %requires_releq_kernel
118 Requires(postun): %releq_kernel
120 Provides: kernel(vboxdrv) = %{version}-%{_rel}
122 %description -n kernel%{_alt_kernel}-misc-vboxdrv
123 Linux kernel module vboxdrv for VirtualBox.
125 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
126 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
129 %setup -q -n %{name}-%{version}_OSE
133 cat > VBox.sh <<'EOF'
136 if [ ! -c /dev/vboxdrv ]; then
137 echo "Special character device /dev/vboxdrv doesn't exists!"
138 echo "Check your installation and if vboxdrv kernel module is loaded."
142 if [ ! -w /dev/vboxdrv ]; then
143 echo "You don't have write access to /dev/vboxdrv!"
144 echo "Correct this situation or contact with your system administrator."
148 BINFILE=$(basename "$0")
149 LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"}
155 KDIR="%{_builddir}/%{buildsubdir}/kernel"
157 cp -a %{_kernelsrcdir}/include $KDIR
159 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
161 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
163 ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
166 --with-gcc="%{__cc}" \
167 --with-g++="%{__cxx}" \
173 cd out/linux.%{_outdir}/release/bin/src
174 for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do
175 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
179 install -d o/include/linux
180 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
181 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
182 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
183 %if %{with dist_kernel}
184 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
186 touch o/include/config/MARKER
187 ln -sf %{_kernelsrcdir}/scripts o/scripts
189 ln -sf ../../include/VBox o/include/VBox
190 ln -sf ../../include/iprt o/include/iprt
191 %{__make} -C %{_kernelsrcdir} clean \
192 SYSSRC=%{_kernelsrcdir} \
196 %{__make} -C %{_kernelsrcdir} modules \
197 CC="%{__cc}" CPP="%{__cpp}" \
198 SYSSRC=%{_kernelsrcdir} \
202 mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
207 rm -rf $RPM_BUILD_ROOT
209 %if %{with userspace}
211 $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
212 $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
213 $RPM_BUILD_ROOT/etc/rc.d/init.d
215 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
216 install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
217 install VBox.sh $RPM_BUILD_ROOT%{_bindir}/$f
220 install out/linux.%{_outdir}/release/bin/VBox*.so \
221 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
222 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
223 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
225 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
226 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
228 install ./out/linux.x86/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
229 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
233 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
234 install vboxdrv-dist.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko
238 rm -rf $RPM_BUILD_ROOT
241 /sbin/chkconfig --add virtualbox
242 %service virtualbox restart "VBoxSVC daemon"
245 if [ "$1" = "0" ]; then
246 %service virtualbox stop
247 /sbin/chkconfig --del virtualbox
250 %post -n kernel%{_alt_kernel}-misc-vboxdrv
251 %depmod %{_kernel_ver}
253 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
254 %depmod %{_kernel_ver}
256 %if %{with userspace}
258 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/VBox*
261 %attr(755,root,root) %{_bindir}/VirtualBox
262 %dir %{_libdir}/VirtualBox
263 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
264 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
265 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
266 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
267 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
268 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
269 %{_libdir}/VirtualBox/*.gc
270 %{_libdir}/VirtualBox/*.r0
271 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
272 %{_libdir}/VirtualBox/*.xpt
273 %dir %{_libdir}/VirtualBox/components
274 %{_libdir}/VirtualBox/components/*
275 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
276 %{_pixmapsdir}/VBox.png
277 %{_desktopdir}/%{name}.desktop
281 %files -n kernel%{_alt_kernel}-misc-vboxdrv
282 %defattr(644,root,root,755)
283 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*