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