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