]> git.pld-linux.org Git - packages/VirtualBox.git/blame - VirtualBox.spec
- updated for 1.5.0
[packages/VirtualBox.git] / VirtualBox.spec
CommitLineData
48363591 1#
2# TODO:
d1c4ec5b 3# - finish kernel/userspace bconds (deps, limit build to only selected part)
48363591 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?
05f1b1f5 6# - .desktop file
7# - it seems that VBoxSVC should not be started by init script but I'm still
8# testing this
9# - /dev/vboxdrv should belong to vboxusers group and have rw rights to it
48363591 10# - Devel stuff is not packaged yet.
eba4b2aa
JB
11# - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that
12# code may be compiled exclusively for i686.
32b670ab 13# - use %kernel_build macros
48363591 14#
15# Conditional build:
16%bcond_without dist_kernel # without distribution kernel
d1c4ec5b 17%bcond_without kernel # don't build kernel module
05f1b1f5 18%bcond_without up # without up packages
48363591 19%bcond_without smp # without SMP kernel modules
d1c4ec5b 20%bcond_without userspace # don't build userspace package
05f1b1f5 21
210193ea 22%define _rel 0.1
05f1b1f5 23
d1c4ec5b
JB
24Summary: VirtualBox - x86 hardware virtualizer
25Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86
48363591 26Name: VirtualBox
210193ea 27Version: 1.4.0
05f1b1f5 28Release: %{_rel}
48363591 29License: GPL v2
30Group: Applications/Emulators
245db1e9 31Source0: http://www.virtualbox.org/download/%{version}/VirtualBox-OSE-%{version}.tar.bz2
210193ea 32# Source0-md5: 8e89d32a67a3a39271f44039d0583a16
05f1b1f5 33Source1: virtualbox.init
7d1c0a63 34Source2: http://www.virtualbox.org/download/UserManual.pdf
35# Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284
48363591 36Patch0: %{name}-configure.patch
37Patch1: %{name}-qt-paths.patch
38URL: http://www.virtualbox.org/
39BuildRequires: SDL-devel
e5aaadde 40BuildRequires: bash
48363591 41BuildRequires: bcc
42BuildRequires: bin86
eba4b2aa 43BuildRequires: gcc >= 5:3.2.3
48363591 44BuildRequires: iasl
45%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7}
46BuildRequires: libIDL-devel
47BuildRequires: libuuid-devel
e5aaadde 48BuildRequires: libxslt-progs
49BuildRequires: qt-devel >= 6:3.3.6
48363591 50BuildRequires: rpmbuild(macros) >= 1.329
e5aaadde 51BuildRequires: xalan-c-devel >= 1.10.0
eba4b2aa 52#BuildRequires: xcursor-devel
e5aaadde 53BuildRequires: xerces-c-devel >= 2.6.0
eba4b2aa 54BuildRequires: xorg-lib-libXcursor-devel
e5aaadde 55BuildRequires: zlib-devel >= 1.2.1
eba4b2aa 56ExclusiveArch: %{ix86} %{x8664}
48363591 57BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
eba4b2aa 59%ifarch %{x8664}
5088674d 60%define _outdir amd64
61%else
62%define _outdir x86
63%endif
64
48363591 65%description
66InnoTek VirtualBox is a general-purpose full virtualizer for x86
67hardware. Targeted at server, desktop and embedded use, it is now the
68only professional-quality virtualization solution that is also Open
69Source Software.
70
71Some of the features of VirtualBox are:
72
73Modularity: VirtualBox has an extremely modular design with
74well-defined internal programming interfaces and a client/server
75design. This makes it easy to control it from several interfaces at
76once: for example, you can start a virtual machine in a typical
77virtual machine GUI and then control that machine from the command
78line. VirtualBox also comes with a full Software Development Kit: even
79though it is Open Source Software, you don't have to hack the source
80to write a new interface for VirtualBox.
81
82Virtual machine descriptions in XML: the configuration settings of
83virtual machines are stored entirely in XML and are independent of the
84local machines. Virtual machine definitions can therefore easily be
85ported to other computers.
86
fd8fc899
JR
87%description -l pl.UTF-8
88InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
89zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
90jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
91również jako Otwarte Oprogramowanie.
48363591 92
fd8fc899 93Przykładowe cechy VirtualBoksa:
48363591 94
fd8fc899
JR
95Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
96dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
97klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
98różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
99poziomu interfejsu graficznego, a później kontrolować ją z linii
100poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
101pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
48363591 102
fd8fc899
JR
103Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
104wirtualnych są w całości przechowywane w XML-u i są niezależne od
105lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
106konfigurację maszyny wirtualnej na inny komputer.
48363591 107
108%package -n kernel%{_alt_kernel}-misc-vboxdrv
eba4b2aa 109Summary: Linux kernel module for VirtualBox
4dab3322 110Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa
48363591 111Release: %{_rel}@%{_kernel_ver_str}
112Group: Base/Kernel
113Requires(post,postun): /sbin/depmod
114Requires: dev >= 2.9.0-7
115%if %{with dist_kernel}
116%requires_releq_kernel_up
117Requires(postun): %releq_kernel_up
118%endif
119Provides: kernel(vboxdrv) = %{version}-%{_rel}
120
121%description -n kernel%{_alt_kernel}-misc-vboxdrv
eba4b2aa 122Linux kernel module vboxdrv for VirtualBox.
48363591 123
fd8fc899
JR
124%description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
125Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
48363591 126
127%package -n kernel%{_alt_kernel}-smp-misc-vboxdrv
eba4b2aa 128Summary: Linux SMP kernel module for VirtualBox
4dab3322 129Summary(pl.UTF-8): Moduł jądra Linuksa SMP dla VirtualBoksa
48363591 130Release: %{_rel}@%{_kernel_ver_str}
131Group: Base/Kernel
132Requires(post,postun): /sbin/depmod
133Requires: dev >= 2.9.0-7
134%if %{with dist_kernel}
135%requires_releq_kernel_smp
136Requires(postun): %releq_kernel_smp
137%endif
138Provides: kernel(vboxdrv) = %{version}-%{_rel}
139
140%description -n kernel%{_alt_kernel}-smp-misc-vboxdrv
eba4b2aa 141Linux SMP kernel module vboxdrv for VirtualBox.
48363591 142
fd8fc899
JR
143%description -n kernel%{_alt_kernel}-smp-misc-vboxdrv -l pl.UTF-8
144Moduł jądra Linuksa SMP vboxdrv dla VirtualBoksa.
48363591 145
146%prep
b8f15f8d 147%setup -q -n %{name}-OSE-%{version}
48363591 148%patch0 -p0
149%patch1 -p0
150
5085c54c
ER
151cat > VBox.sh <<'EOF'
152#!/bin/sh
153
154if [ ! -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."
157 exit 1
158fi
159
160if [ ! -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."
163 exit 1
164fi
165
166BINFILE=$(basename "$0")
167LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"}
168EOF
169
95389e4d 170install %{SOURCE2} .
fa19f650 171
48363591 172%build
05f1b1f5 173KDIR="%{_builddir}/%{buildsubdir}/kernel"
174mkdir -p $KDIR
175cp -a %{_kernelsrcdir}/include $KDIR
176%ifarch %{x8664}
177ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
178%else
179ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
180%endif
181ln -sf $KDIR/include/linux/autoconf-up.h $KDIR/include/linux/autoconf.h
182
106d8451 183./configure \
184 --with-gcc="%{__cc}" \
05f1b1f5 185 --with-g++="%{__cxx}" \
186 --with-linux="$KDIR"
48363591 187. ./env.sh
188kmk
189
d1c4ec5b 190%if %{with kernel}
5088674d 191cd out/linux.%{_outdir}/release/bin/src
48363591 192for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
193 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
194 exit 1
195 fi
196 rm -rf o
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
203%else
204 touch o/include/config/MARKER
205 ln -sf %{_kernelsrcdir}/scripts o/scripts
206%endif
207 ln -sf ../../include/VBox o/include/VBox
208 ln -sf ../../include/iprt o/include/iprt
209 %{__make} -C %{_kernelsrcdir} clean \
210 SYSSRC=%{_kernelsrcdir} \
211 SYSOUT=$PWD/o \
212 M=$PWD O=$PWD/o \
213 %{?with_verbose:V=1}
214 %{__make} -C %{_kernelsrcdir} modules \
215 CC="%{__cc}" CPP="%{__cpp}" \
216 SYSSRC=%{_kernelsrcdir} \
217 SYSOUT=$PWD/o \
218 M=$PWD O=$PWD/o \
219 %{?with_verbose:V=1}
05f1b1f5 220 mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
48363591 221done
d1c4ec5b 222%endif
48363591 223
224%install
225rm -rf $RPM_BUILD_ROOT
226
d1c4ec5b 227%if %{with userspace}
48363591 228install -d \
229 $RPM_BUILD_ROOT%{_bindir} \
05f1b1f5 230 $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
231 $RPM_BUILD_ROOT/etc/rc.d/init.d
232
5085c54c
ER
233for 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
05f1b1f5 236done
237
210193ea 238install out/linux.%{_outdir}/release/bin/VBox{C,DD,DD2,DDU,REM,REMImp,RT,SVCM,VMM,XML,XPCOM,XPCOMIPCC}.so \
48363591 239 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
05f1b1f5 240install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
48363591 241 $RPM_BUILD_ROOT%{_libdir}/VirtualBox
242
d1c4ec5b
JB
243cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
244install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
245%endif
246
247%if %{with kernel}
48363591 248install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
05f1b1f5 249install vboxdrv-up.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko
48363591 250%if %{with smp} && %{with dist_kernel}
05f1b1f5 251install vboxdrv-smp.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko
48363591 252%endif
d1c4ec5b 253%endif
05f1b1f5 254
48363591 255%clean
256rm -rf $RPM_BUILD_ROOT
257
05f1b1f5 258%post
259/sbin/chkconfig --add virtualbox
260%service virtualbox restart "VBoxSVC daemon"
261
262%preun
263if [ "$1" = "0" ]; then
264 %service virtualbox stop
265 /sbin/chkconfig --del virtualbox
266fi
267
48363591 268%post -n kernel%{_alt_kernel}-misc-vboxdrv
269%depmod %{_kernel_ver}
270
271%postun -n kernel%{_alt_kernel}-misc-vboxdrv
272%depmod %{_kernel_ver}
273
48363591 274%post -n kernel%{_alt_kernel}-smp-misc-vboxdrv
275%depmod %{_kernel_ver}smp
276
277%postun -n kernel%{_alt_kernel}-smp-misc-vboxdrv
278%depmod %{_kernel_ver}smp
48363591 279
d1c4ec5b 280%if %{with userspace}
48363591 281%files
282%defattr(644,root,root,755)
7d1c0a63 283%doc UserManual.pdf
48363591 284%attr(755,root,root) %{_bindir}/VBox*
285%attr(755,root,root) %{_bindir}/VirtualBox
d1c4ec5b 286%dir %{_libdir}/VirtualBox
05f1b1f5 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
d1c4ec5b 295%attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
05f1b1f5 296%{_libdir}/VirtualBox/*.xpt
d1c4ec5b 297%dir %{_libdir}/VirtualBox/components
05f1b1f5 298%{_libdir}/VirtualBox/components/*
299%attr(754,root,root) /etc/rc.d/init.d/virtualbox
d1c4ec5b 300%endif
48363591 301
d1c4ec5b 302%if %{with kernel}
05f1b1f5 303%if %{with up} || %{without dist_kernel}
d1c4ec5b 304%files -n kernel%{_alt_kernel}-misc-vboxdrv
48363591 305%defattr(644,root,root,755)
d1c4ec5b 306/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
05f1b1f5 307%endif
48363591 308
309%if %{with smp} && %{with dist_kernel}
d1c4ec5b 310%files -n kernel%{_alt_kernel}-smp-misc-vboxdrv
48363591 311%defattr(644,root,root,755)
d1c4ec5b
JB
312/lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko*
313%endif
48363591 314%endif
This page took 0.109125 seconds and 4 git commands to generate.