]> git.pld-linux.org Git - packages/VirtualBox.git/blob - VirtualBox.spec
- packaged language files.
[packages/VirtualBox.git] / VirtualBox.spec
1 #
2 # TODO:
3 # - Find how to compile with PLD CFLAGS/CXXFLAGS/LDFLAGS.
4 # - How to package video and mouse drivers for Guest OS ?
5 #   (There are several binaries for multiple versions of X11)
6 # - Package SDK.
7 #
8 # Conditional build:
9 %bcond_without  dist_kernel     # without distribution kernel
10 %bcond_without  kernel          # don't build kernel module
11 %bcond_without  userspace       # don't build userspace package
12
13 %define         _rel            1
14
15 %if %{without kernel}
16 %undefine       with_dist_kernel
17 %endif
18
19 Summary:        VirtualBox - x86 hardware virtualizer
20 Summary(pl.UTF-8):      VirtualBox - wirtualizator sprzętu x86
21 Name:           VirtualBox
22 Version:        1.5.0
23 Release:        %{_rel}
24 License:        GPL v2
25 Group:          Applications/Emulators
26 Source0:        http://www.virtualbox.org/download/%{version}/%{name}-%{version}_OSE.tar.bz2
27 # Source0-md5:  56c074900260c109ed735c08e726fe81
28 Source1:        virtualbox.init
29 Source2:        http://www.virtualbox.org/download/UserManual.pdf
30 # Source2-md5:  2e5458bd5b4b9acd18cc86866e8a7284
31 Source3:        %{name}.desktop
32 Source4:        %{name}.sh
33 Patch0:         %{name}-configure.patch
34 Patch1:         %{name}-qt-paths.patch
35 Patch2:         %{name}-shared-libstdc++.patch
36 URL:            http://www.virtualbox.org/
37 BuildRequires:  SDL-devel
38 BuildRequires:  bash
39 BuildRequires:  bcc
40 BuildRequires:  bin86
41 BuildRequires:  gcc >= 5:3.2.3
42 BuildRequires:  iasl
43 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.7}
44 BuildRequires:  libIDL-devel
45 BuildRequires:  libuuid-devel
46 BuildRequires:  libxslt-progs
47 BuildRequires:  qt-devel >= 6:3.3.6
48 BuildRequires:  qt-linguist
49 BuildRequires:  rpmbuild(macros) >= 1.329
50 BuildRequires:  xalan-c-devel >= 1.10.0
51 #BuildRequires: xcursor-devel
52 BuildRequires:  xerces-c-devel >= 2.6.0
53 BuildRequires:  xorg-lib-libXcursor-devel
54 BuildRequires:  zlib-devel >= 1.2.1
55 Requires(postun):       /usr/sbin/groupdel
56 Requires(pre):  /usr/bin/getgid
57 Requires(pre):  /usr/sbin/groupadd
58 Suggests:       gxmessage
59 Provides:       group(vbox)
60 ExclusiveArch:  %{ix86} %{x8664}
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 %ifarch %{x8664}
64 %define         _outdir amd64
65 %else
66 %define         _outdir x86
67 %endif
68
69 %description
70 InnoTek VirtualBox is a general-purpose full virtualizer for x86
71 hardware. Targeted at server, desktop and embedded use, it is now the
72 only professional-quality virtualization solution that is also Open
73 Source Software.
74
75 Some of the features of VirtualBox are:
76
77 Modularity: VirtualBox has an extremely modular design with
78 well-defined internal programming interfaces and a client/server
79 design. This makes it easy to control it from several interfaces at
80 once: for example, you can start a virtual machine in a typical
81 virtual machine GUI and then control that machine from the command
82 line. VirtualBox also comes with a full Software Development Kit: even
83 though it is Open Source Software, you don't have to hack the source
84 to write a new interface for VirtualBox.
85
86 Virtual machine descriptions in XML: the configuration settings of
87 virtual machines are stored entirely in XML and are independent of the
88 local machines. Virtual machine definitions can therefore easily be
89 ported to other computers.
90
91 %description -l pl.UTF-8
92 InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
93 zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
94 jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
95 również jako Otwarte Oprogramowanie.
96
97 Przykładowe cechy VirtualBoksa:
98
99 Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
100 dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
101 klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
102 różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
103 poziomu interfejsu graficznego, a później kontrolować ją z linii
104 poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
105 pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
106
107 Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
108 wirtualnych są w całości przechowywane w XML-u i są niezależne od
109 lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
110 konfigurację maszyny wirtualnej na inny komputer.
111
112 %package -n kernel%{_alt_kernel}-misc-vboxadd
113 Summary:        Linux kernel module for VirtualBox
114 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
115 Release:        %{_rel}@%{_kernel_ver_str}
116 Group:          Base/Kernel
117 Requires(post,postun):  /sbin/depmod
118 Requires:       dev >= 2.9.0-7
119 %if %{with dist_kernel}
120 %requires_releq_kernel
121 Requires(postun):       %releq_kernel
122 %endif
123 Provides:       kernel(vboxadd) = %{version}-%{_rel}
124
125 %description -n kernel%{_alt_kernel}-misc-vboxadd
126 Linux kernel module vboxadd for VirtualBox.
127
128 %description -n kernel%{_alt_kernel}-misc-vboxadd -l pl.UTF-8
129 Moduł jądra Linuksa vboxadd dla VirtualBoksa.
130
131 %package -n kernel%{_alt_kernel}-misc-vboxdrv
132 Summary:        Linux kernel module for VirtualBox
133 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
134 Release:        %{_rel}@%{_kernel_ver_str}
135 Group:          Base/Kernel
136 Requires(post,postun):  /sbin/depmod
137 Requires:       dev >= 2.9.0-7
138 %if %{with dist_kernel}
139 %requires_releq_kernel
140 Requires(postun):       %releq_kernel
141 %endif
142 Provides:       kernel(vboxdrv) = %{version}-%{_rel}
143
144 %description -n kernel%{_alt_kernel}-misc-vboxdrv
145 Linux kernel module vboxdrv for VirtualBox.
146
147 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
148 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
149
150 %package -n kernel%{_alt_kernel}-misc-vboxvfs
151 Summary:        Linux kernel module for VirtualBox
152 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
153 Release:        %{_rel}@%{_kernel_ver_str}
154 Group:          Base/Kernel
155 Requires(post,postun):  /sbin/depmod
156 Requires:       dev >= 2.9.0-7
157 %if %{with dist_kernel}
158 %requires_releq_kernel
159 Requires(postun):       %releq_kernel
160 %endif
161 Provides:       kernel(vboxvfs) = %{version}-%{_rel}
162
163 %description -n kernel%{_alt_kernel}-misc-vboxvfs
164 Linux kernel module vboxvfs for VirtualBox.
165
166 %description -n kernel%{_alt_kernel}-misc-vboxvfs -l pl.UTF-8
167 Moduł jądra Linuksa vboxvfs dla VirtualBoksa.
168
169 %prep
170 %setup -q -n %{name}-%{version}_OSE
171 %patch0 -p0
172 %patch1 -p0
173 %patch2 -p1
174 install %{SOURCE2} .
175
176 %build
177 KDIR="%{_builddir}/%{buildsubdir}/kernel"
178 mkdir -p $KDIR
179 cp -Ra %{_kernelsrcdir}/include $KDIR
180 %ifarch %{x8664}
181 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
182 %else
183 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
184 %endif
185
186 %if %{with dist_kernel}
187 [ ! -f $KDIR/include/linux/autoconf.h ] && \
188     ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
189 %else
190 [ ! -f $KDIR/include/linux/autoconf.h ] && \
191     ln -sf $KDIR/include/linux/autoconf-nondist.h $KDIR/include/linux/autoconf.h
192 %endif
193
194 ./configure \
195         --with-gcc="%{__cc}" \
196         --with-g++="%{__cxx}" \
197         --with-linux="$KDIR"
198
199 %if %{with userspace}
200 . ./env.sh && kmk -j1
201 %endif
202
203 %if %{with kernel}
204 rm -rf PLD-MODULE-BUILD && mkdir PLD-MODULE-BUILD && cd PLD-MODULE-BUILD
205
206 ../src/VBox/HostDrivers/Support/linux/export_modules modules.tar.gz && \
207         tar -zxf modules.tar.gz && rm -f modules.tar.gz
208 ../src/VBox/Additions/linux/export_modules modules.tar.gz
209         tar -zxf modules.tar.gz && rm -f modules.tar.gz
210
211 %build_kernel_modules -m vboxadd -C vboxadd
212 %build_kernel_modules -m vboxdrv -C vboxdrv
213 %build_kernel_modules -m vboxvfs -C vboxvfs
214 cd ..
215 %endif
216
217 %install
218 rm -rf $RPM_BUILD_ROOT
219
220 %if %{with userspace}
221 install -d \
222         $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
223         $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
224         $RPM_BUILD_ROOT/etc/rc.d/init.d
225
226 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
227         install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
228         install %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/$f
229 done
230
231 install out/linux.%{_outdir}/release/bin/VBox*.so \
232         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
233 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
234         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
235
236 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
237
238 install -d $RPM_BUILD_ROOT%{_libdir}/VirtualBox/nls
239 cp -a out/linux.%{_outdir}/release/bin/nls/VirtualBox* $RPM_BUILD_ROOT%{_libdir}/VirtualBox/nls
240
241 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
242
243 install out/linux.%{_outdir}/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
244 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
245 %endif
246
247 %if %{with kernel}
248 cd PLD-MODULE-BUILD
249 for MODULE in *; do
250         [ ! -d $MODULE ] && continue;
251
252         cd $MODULE
253         %install_kernel_modules -m $MODULE -d misc
254         cd ..
255 done
256 cd ..
257 %endif
258
259 %clean
260 rm -rf $RPM_BUILD_ROOT
261
262 %pre
263 %groupadd -g 221 -r -f vbox
264
265 %post
266 /sbin/chkconfig --add virtualbox
267 %service virtualbox restart "VBoxSVC daemon"
268 if [ "$1" = 1 ]; then
269 %banner -e %{name} <<'EOF'
270 Remember to add users which will use VirtualBox to vbox group or they won't be
271 able to write to /dev/vboxdrv.
272 EOF
273 #'
274 fi
275
276 %preun
277 if [ "$1" = "0" ]; then
278         %service virtualbox stop
279         /sbin/chkconfig --del virtualbox
280 fi
281
282 %postun
283 if [ "$1" = "0" ]; then
284         %groupremove vbox
285 fi
286
287 %post   -n kernel%{_alt_kernel}-misc-vboxadd
288 %depmod %{_kernel_ver}
289
290 %postun -n kernel%{_alt_kernel}-misc-vboxadd
291 %depmod %{_kernel_ver}
292
293 %post   -n kernel%{_alt_kernel}-misc-vboxdrv
294 %depmod %{_kernel_ver}
295
296 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
297 %depmod %{_kernel_ver}
298
299 %post   -n kernel%{_alt_kernel}-misc-vboxvfs
300 %depmod %{_kernel_ver}
301
302 %postun -n kernel%{_alt_kernel}-misc-vboxvfs
303 %depmod %{_kernel_ver}
304
305 %if %{with userspace}
306 %files
307 %defattr(644,root,root,755)
308 %doc UserManual.pdf
309 %dir %{_libdir}/VirtualBox
310 %dir %{_libdir}/VirtualBox/components
311 %dir %{_libdir}/VirtualBox/nls
312 %attr(755,root,root) %{_bindir}/VBox*
313 %attr(755,root,root) %{_bindir}/VirtualBox
314 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
315 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
316 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
317 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
318 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
319 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
320 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
321 %{_libdir}/VirtualBox/*.gc
322 %{_libdir}/VirtualBox/*.r0
323 %{_libdir}/VirtualBox/*.xpt
324 %{_libdir}/VirtualBox/components/*
325 %lang(ar) %{_libdir}/VirtualBox/nls/VirtualBox_ar.qm
326 %lang(cs) %{_libdir}/VirtualBox/nls/VirtualBox_cs.qm
327 %lang(de) %{_libdir}/VirtualBox/nls/VirtualBox_de.qm
328 %lang(es) %{_libdir}/VirtualBox/nls/VirtualBox_es.qm
329 %lang(fi) %{_libdir}/VirtualBox/nls/VirtualBox_fi.qm
330 %lang(fr) %{_libdir}/VirtualBox/nls/VirtualBox_fr.qm
331 %lang(hu) %{_libdir}/VirtualBox/nls/VirtualBox_hu.qm
332 %lang(it) %{_libdir}/VirtualBox/nls/VirtualBox_it.qm
333 %lang(ja) %{_libdir}/VirtualBox/nls/VirtualBox_ja.qm
334 %lang(ko) %{_libdir}/VirtualBox/nls/VirtualBox_ko.qm
335 %lang(pl) %{_libdir}/VirtualBox/nls/VirtualBox_pl.qm
336 %lang(pt_BR) %{_libdir}/VirtualBox/nls/VirtualBox_pt_BR.qm
337 %lang(ro) %{_libdir}/VirtualBox/nls/VirtualBox_ro.qm
338 %lang(ru) %{_libdir}/VirtualBox/nls/VirtualBox_ru.qm
339 %lang(sv) %{_libdir}/VirtualBox/nls/VirtualBox_sv.qm
340 %lang(zh_CN) %{_libdir}/VirtualBox/nls/VirtualBox_zh_CN.qm
341 %lang(zh_TW) %{_libdir}/VirtualBox/nls/VirtualBox_zh_TW.qm
342 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
343 %{_pixmapsdir}/VBox.png
344 %{_desktopdir}/%{name}.desktop
345 %endif
346
347 %if %{with kernel}
348 %files -n kernel%{_alt_kernel}-misc-vboxadd
349 %defattr(644,root,root,755)
350 /lib/modules/%{_kernel_ver}/misc/vboxadd.ko*
351
352 %files -n kernel%{_alt_kernel}-misc-vboxdrv
353 %defattr(644,root,root,755)
354 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
355
356 %files -n kernel%{_alt_kernel}-misc-vboxvfs
357 %defattr(644,root,root,755)
358 /lib/modules/%{_kernel_ver}/misc/vboxvfs.ko*
359 %endif
This page took 0.052368 seconds and 4 git commands to generate.