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